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
c7fbf343
authored
Jul 19, 2022
by
Manisha Jajoo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Revert "Keep the input data constant in consume method"
This reverts commit
3bacb164
.
parent
69a716f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 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 @
c7fbf343
...
...
@@ -104,8 +104,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
// | RR |P|V| PLEN |PEBIT|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
int
currentPosition
=
data
.
getPosition
();
ParsableByteArray
bitstreamData
=
new
ParsableByteArray
(
data
.
getData
().
clone
());
int
header
=
bitstreamData
.
readUnsignedShort
();
int
header
=
data
.
readUnsignedShort
();
boolean
pBitIsSet
=
(
header
&
0x400
)
>
0
;
// Check if optional V (Video Redundancy Coding), PLEN or PEBIT is present, RFC4629 Section 5.1.
...
...
@@ -124,16 +123,16 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
gotFirstPacketOfH263Frame
=
true
;
int
payloadStartCode
=
bitstreamD
ata
.
peekUnsignedByte
()
&
0xFC
;
int
payloadStartCode
=
d
ata
.
peekUnsignedByte
()
&
0xFC
;
// Packets that begin with a Picture Start Code(100000). Refer RFC4629 Section 6.1.
if
(
payloadStartCode
<
PICTURE_START_CODE
)
{
Log
.
w
(
TAG
,
"Picture start Code (PSC) missing, dropping packet."
);
return
;
}
// Setting first two bytes of the start code. Refer RFC4629 Section 6.1.1.
bitstreamD
ata
.
getData
()[
currentPosition
]
=
0
;
bitstreamD
ata
.
getData
()[
currentPosition
+
1
]
=
0
;
bitstreamD
ata
.
setPosition
(
currentPosition
);
d
ata
.
getData
()[
currentPosition
]
=
0
;
d
ata
.
getData
()[
currentPosition
+
1
]
=
0
;
d
ata
.
setPosition
(
currentPosition
);
}
else
if
(
gotFirstPacketOfH263Frame
)
{
// Check that this packet is in the sequence of the previous packet.
int
expectedSequenceNumber
=
RtpPacket
.
getNextSequenceNumber
(
previousSequenceNumber
);
...
...
@@ -155,7 +154,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
if
(
fragmentedSampleSizeBytes
==
0
)
{
parseVopHeader
(
bitstreamD
ata
,
isOutputFormatSet
);
parseVopHeader
(
d
ata
,
isOutputFormatSet
);
if
(!
isOutputFormatSet
&&
isKeyFrame
)
{
if
(
width
!=
payloadFormat
.
format
.
width
||
height
!=
payloadFormat
.
format
.
height
)
{
trackOutput
.
format
(
...
...
@@ -164,9 +163,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
isOutputFormatSet
=
true
;
}
}
int
fragmentSize
=
bitstreamD
ata
.
bytesLeft
();
int
fragmentSize
=
d
ata
.
bytesLeft
();
// Write the video sample.
trackOutput
.
sampleData
(
bitstreamD
ata
,
fragmentSize
);
trackOutput
.
sampleData
(
d
ata
,
fragmentSize
);
fragmentedSampleSizeBytes
+=
fragmentSize
;
sampleTimeUsOfFragmentedSample
=
toSampleUs
(
startTimeOffsetUs
,
timestamp
,
firstReceivedTimestamp
);
...
...
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