Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aae9f23c
authored
May 09, 2022
by
Rakesh Kumar
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix some minor review comments in RTPH263Reader
Change-Id: I0d728c695c9e11c5a50ef6f211bde614df4bbe71
parent
f8cd3a97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH263Reader.java
View file @
aae9f23c
...
...
@@ -16,7 +16,6 @@
package
androidx
.
media3
.
exoplayer
.
rtsp
.
reader
;
import
static
androidx
.
media3
.
common
.
util
.
Assertions
.
checkStateNotNull
;
import
static
androidx
.
media3
.
common
.
util
.
Util
.
castNonNull
;
import
androidx.media3.common.C
;
import
androidx.media3.common.ParserException
;
...
...
@@ -99,9 +98,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
return
;
}
if
(
pBitIsSet
==
true
)
{
if
(
pBitIsSet
)
{
int
startCodePayload
=
data
.
peekUnsignedByte
()
&
0xfc
;
// Packets that begin with a Picture Start Code(100000). Refer RFC4629 Section 6.1.
1.
// Packets that begin with a Picture Start Code(100000). Refer RFC4629 Section 6.1.
if
(
startCodePayload
<
PICTURE_START_CODE
)
{
Log
.
w
(
TAG
,
"Picture start Code (PSC) missing, Dropping packet."
);
return
;
...
...
@@ -125,7 +124,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
if
(
fragmentedSampleSizeBytes
==
0
)
{
getBufferFlagsAndResolutionFromVop
(
data
,
isOutputFormatSet
);
parseVopHeader
(
data
,
isOutputFormatSet
);
if
(!
isOutputFormatSet
&&
isKeyFrame
)
{
if
(
width
!=
payloadFormat
.
format
.
width
||
height
!=
payloadFormat
.
format
.
height
)
{
trackOutput
.
format
(
...
...
@@ -167,14 +166,21 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/**
* Parses VOP Coding type and resolution.
*/
private
void
getBufferFlagsAndResolutionFromVop
(
ParsableByteArray
data
,
boolean
gotResolution
)
{
private
void
parseVopHeader
(
ParsableByteArray
data
,
boolean
gotResolution
)
{
// Picture Segment Packets (RFC4629 Section 6.1).
// 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
currDataOffset
=
data
.
getPosition
();
/**
* Parsing short header.
*
* <p> These values are taken from <a
* href=https://cs.android.com/android/platform/superproject/+/master:frameworks/av/media/codecs/m4v_h263/dec/src/mp4def.h;l=115
* >Android's software H263 decoder</a>.
*/
long
shortHeader
=
data
.
readUnsignedInt
();
if
((
shortHeader
&
0xffff
)
>>
10
==
0x20
)
{
if
((
(
shortHeader
>>
10
)
&
0xffff
)
==
0x20
)
{
int
header
=
data
.
peekUnsignedByte
();
int
vopType
=
((
header
>>
1
)
&
0x
0
1
);
int
vopType
=
((
header
>>
1
)
&
0x1
);
if
(!
gotResolution
&&
vopType
==
I_VOP
)
{
/**
* Parsing resolution from source format.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment