Skip to content

Conversation

@ManishaJajoo
Copy link
Contributor

Added AMR-NB/WB RTP packet reader and added support for AMR-NB/WB
playback through RTSP

Change-Id: I0a975fa1e1aa8450bda1c828599a523ba796bc48

Added AMR-NB/WB RTP packet reader and added support for AMR-NB/WB playback through RTSP Change-Id: I0a975fa1e1aa8450bda1c828599a523ba796bc48
caseRTP_MEDIA_AMR:
returnMimeTypes.AUDIO_AMR_NB;
caseRTP_MEDIA_AMR_WB:
returnMimeTypes.AUDIO_AMR_WB;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. RTP_MEDIA_AMR (which is "AMR"), corresponds to MIME type AUDIO_AMR_NB ("audio/3gpp") and not to AUDIO_AMR ("audio/amr")?

Do you know what would happen if you to map RTP_MEDIA_AMR to MimeTypes.AUDIO_AMR? Would the decoder work?

I skimmed through rfc4867 and I see that both AMR and AMR_WB can be stored in 3gpp files so I'd be tempted to see what happens when AMR_WB is also mapped to audio/3gpp.

Copy link
ContributorAuthor

@ManishaJajooManishaJajooMar 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon setting the mimeType as AUDIO_AMR, the player fails in selectTracks. The reason for this failure is: AUDIO_AMR is treated as an unsupported mime type and therefore result.second is set to null here:
https://github.com/androidx/media/blob/main/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/MappingTrackSelector.java#L422

Regarding the second change, i.e. mapping AMR_WB to audio/3gpp, since AUDIO_AMR_NB creates an AMR_NB decoder and AUDIO_AMR_WB creates AMR_WB decoder we see the following playback error:
MediaCodecDecoderException: Decoder failed: c2.android.amrnb.decoder

@claincly
Copy link
Contributor

Merged internally. The issue will be marked as merged automatically when we do a push. Thanks for the contribution!

@icbakericbaker merged commit a11c22b into androidx:mainApr 11, 2022
icbaker added a commit that referenced this pull request May 9, 2022
@androidxandroidx locked and limited conversation to collaborators Mar 4, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ManishaJajoo@claincly@icbaker