Add support for RTSP H263#63
Conversation
Added H263 RTP Packet reader and added support for H263 playback through RTSP. Change-Id: I348cc4d8e974b5275409b816a9d52aa29f593233
claincly
left a comment
There was a problem hiding this comment.
Please make sure you sync to the newest head in main.
P.S. Take a look at the style guide for future reference.
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
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Show resolved
Hide resolved
Change-Id: I987baf379ecf3ba3f387cb38f22646023739addb
Change-Id: If1f80a369b47319251e262c8f171091bb37e90c5
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Outdated
Show resolved
Hide resolved
|
|
||
| if (pBitIsSet == true) { | ||
| int startCodePayload = data.peekUnsignedByte() & 0xfc; | ||
| // Packets that begin with a Picture Start Code(100000). Refer RFC4629 Section 6.1.1. |
There was a problem hiding this comment.
i have difficulty understanding here: if picture start code is 0b100000 which is 64, then it'll always fail the check startCodePayload < PICTURE_START_CODE. Maybe you quoted a wrong RFC section?
There was a problem hiding this comment.
Picture start code is "100000" from msb, so it is 128. If startCodePayload is less than 128 then packet is follow-On.
| // Search for SHORT_VIDEO_START_MARKER (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0). | ||
| int currPosition = data.getPosition(); | ||
| int currDataOffset = data.getPosition(); | ||
| long shortHeader = data.readUnsignedInt(); |
There was a problem hiding this comment.
what is the reason to name this shortHeader? It's not of type short and I can't find reference to any 'short' in the RFC
There was a problem hiding this comment.
Its taken from h263 decoder. Added link for the same in javaDoc.
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Outdated
Show resolved
Hide resolved
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
Show resolved
Hide resolved
| @@ -190,11 +192,11 @@ private void getBufferFlagsAndResolutionFromVop(ParsableByteArray data, boolean | |||
| height = (short) (144 << (sourceFormat - 2)); | |||
There was a problem hiding this comment.
Can you explain a bit here? I'm particularly lost why the shift bits are derived from a sourceFormat. Is the related logic in the H263 spec? I can't find it in RFC4629.
There was a problem hiding this comment.
https://cs.android.com/android/platform/superproject/+/master:frameworks/av/media/codecs/m4v_h263/dec/src/vop.cpp;l=1128. According to this logic :
sourceFormat 2 is 176x144, sourceFormat 3 is 1762x1442, sourceFormat 4 is 17622x14422 and so on.
| } | ||
|
|
||
| if (fragmentedSampleSizeBytes == 0) { | ||
| getBufferFlagsAndResolutionFromVop(data, isOutputFormatSet); |
There was a problem hiding this comment.
Again, if the method does not return anything, can you rename it to parseVopHeader and specify it sets width/height/flags in the javadoc.
Change-Id: I0d728c695c9e11c5a50ef6f211bde614df4bbe71
Change-Id: I6ae45dc710245769f36130ead4077d8e9980bf54
|
Can you do a merge with head? I can't merge the PR internally until then. |
PiperOrigin-RevId: 455347182 (cherry picked from commit dc0e5c4)
PiperOrigin-RevId: 455347182
PiperOrigin-RevId: 455347182 (cherry picked from commit e220f53)
Added H263 RTP Packet reader and added support for H263 playback through
RTSP.
Change-Id: I348cc4d8e974b5275409b816a9d52aa29f593233