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
743437e3
authored
Jan 31, 2022
by
Manisha Jajoo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Clean up RtpMpeg4Reader
parent
d2f807eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
34 deletions
libraries/common/src/main/java/androidx/media3/common/util/CodecSpecificDataUtil.java
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpMPEG4Reader.java
libraries/common/src/main/java/androidx/media3/common/util/CodecSpecificDataUtil.java
View file @
743437e3
...
...
@@ -36,7 +36,6 @@ public final class CodecSpecificDataUtil {
private
static
final
int
VISUAL_OBJECT_LAYER_START
=
0x20
;
private
static
final
int
EXTENDED_PAR
=
0x0F
;
private
static
final
int
RECTANGULAR
=
0x00
;
private
static
final
int
FINE_GRANULARITY_SCALABLE
=
0x12
;
/**
* Parses an ALAC AudioSpecificConfig (i.e. an <a
...
...
@@ -101,14 +100,12 @@ public final class CodecSpecificDataUtil {
break
;
}
Assertions
.
checkArgument
(
foundVOL
);
Assertions
.
checkArgument
(
foundVOL
,
"Invalid input. VOL not found"
);
ParsableBitArray
scdScratchBits
=
new
ParsableBitArray
(
videoSpecificConfig
);
scdScratchBits
.
skipBits
((
offset
+
4
)
*
8
);
scdScratchBits
.
skipBits
(
1
);
// random_accessible_vol
int
videoObjectTypeIndication
=
scdScratchBits
.
readBits
(
8
);
Assertions
.
checkArgument
(
videoObjectTypeIndication
!=
FINE_GRANULARITY_SCALABLE
);
scdScratchBits
.
skipBits
(
8
);
// video_object_type_indication
if
(
scdScratchBits
.
readBit
())
{
// object_layer_identifier
scdScratchBits
.
skipBits
(
4
);
// video_object_layer_verid
...
...
@@ -130,14 +127,14 @@ public final class CodecSpecificDataUtil {
}
int
videoObjectLayerShape
=
scdScratchBits
.
readBits
(
2
);
Assertions
.
checkArgument
(
videoObjectLayerShape
==
RECTANGULAR
);
Assertions
.
checkArgument
(
videoObjectLayerShape
==
RECTANGULAR
,
"Unsupported feature"
);
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
());
// marker_bit
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
()
,
"Invalid input"
);
// marker_bit
int
vopTimeIncrementResolution
=
scdScratchBits
.
readBits
(
16
);
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
());
// marker_bit
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
()
,
"Invalid input"
);
// marker_bit
if
(
scdScratchBits
.
readBit
())
{
// fixed_vop_rate
Assertions
.
checkArgument
(
vopTimeIncrementResolution
>
0
);
Assertions
.
checkArgument
(
vopTimeIncrementResolution
>
0
,
"Invalid input"
);
--
vopTimeIncrementResolution
;
int
numBits
=
0
;
while
(
vopTimeIncrementResolution
>
0
)
{
...
...
@@ -147,11 +144,11 @@ public final class CodecSpecificDataUtil {
scdScratchBits
.
skipBits
(
numBits
);
// fixed_vop_time_increment
}
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
());
// marker_bit
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
()
,
"Invalid input"
);
// marker_bit
int
videoObjectLayerWidth
=
scdScratchBits
.
readBits
(
13
);
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
());
// marker_bit
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
()
,
"Invalid input"
);
// marker_bit
int
videoObjectLayerHeight
=
scdScratchBits
.
readBits
(
13
);
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
());
// marker_bit
Assertions
.
checkArgument
(
scdScratchBits
.
readBit
()
,
"Invalid input"
);
// marker_bit
scdScratchBits
.
skipBits
(
1
);
// interlaced
...
...
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpMPEG4Reader.java
View file @
743437e3
...
...
@@ -27,9 +27,6 @@ import androidx.media3.exoplayer.rtsp.RtpPayloadFormat;
import
androidx.media3.extractor.ExtractorOutput
;
import
androidx.media3.extractor.TrackOutput
;
import
com.google.common.primitives.Bytes
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
org.checkerframework.checker.nullness.qual.MonotonicNonNull
;
/**
...
...
@@ -59,22 +56,12 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private
int
sampleLength
;
File
output
=
null
;
FileOutputStream
outputStream
=
null
;
/** Creates an instance. */
public
RtpMPEG4Reader
(
RtpPayloadFormat
payloadFormat
)
{
this
.
payloadFormat
=
payloadFormat
;
firstReceivedTimestamp
=
C
.
TIME_UNSET
;
previousSequenceNumber
=
C
.
INDEX_UNSET
;
sampleLength
=
0
;
try
{
output
=
new
File
(
"/data/local/tmp/"
+
"mpeg4v_es.out"
);
outputStream
=
new
FileOutputStream
(
output
);
}
catch
(
IOException
e
)
{
//do nothing;
}
}
private
static
long
toSampleUs
(
...
...
@@ -110,15 +97,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
sampleLength
+=
limit
;
parseVopType
(
data
);
// Write the video sample
if
(
outputStream
!=
null
)
{
try
{
outputStream
.
write
(
data
.
getData
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
// Marker (M) bit: The marker bit is set to 1 to indicate the last RTP
// packet(or only RTP packet) of a VOP. When multiple VOPs are carried
// in the same RTP packet, the marker bit is set to 1.
...
...
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