-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for RTSP AMR-NB/WB #46
Conversation
Added AMR-NB/WB RTP packet reader and added support for AMR-NB/WB playback through RTSP Change-Id: I0a975fa1e1aa8450bda1c828599a523ba796bc48
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/RtspMediaTrack.java
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/RtspMediaTrack.java
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpAmrReader.java
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpAmrReader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpAmrReader.java
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpAmrReader.java
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpAmrReader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpAmrReader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpAmrReader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpAmrReader.java
Outdated
Show resolved
Hide resolved
case RTP_MEDIA_AMR: | ||
return MimeTypes.AUDIO_AMR_NB; | ||
case RTP_MEDIA_AMR_WB: | ||
return MimeTypes.AUDIO_AMR_WB; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Merged internally. The issue will be marked as merged automatically when we do a push. Thanks for the contribution! |
Added AMR-NB/WB RTP packet reader and added support for AMR-NB/WB
playback through RTSP
Change-Id: I0a975fa1e1aa8450bda1c828599a523ba796bc48