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
f91ea903
authored
Oct 27, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Read AC-3 and HEVC signaled by private registration_descriptor.
Issue: #898
parent
6fb5052d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
library/src/main/java/com/google/android/exoplayer/extractor/ts/TsExtractor.java
library/src/main/java/com/google/android/exoplayer/extractor/ts/TsExtractor.java
View file @
f91ea903
...
@@ -22,6 +22,7 @@ import com.google.android.exoplayer.extractor.PositionHolder;
...
@@ -22,6 +22,7 @@ import com.google.android.exoplayer.extractor.PositionHolder;
import
com.google.android.exoplayer.extractor.SeekMap
;
import
com.google.android.exoplayer.extractor.SeekMap
;
import
com.google.android.exoplayer.util.ParsableBitArray
;
import
com.google.android.exoplayer.util.ParsableBitArray
;
import
com.google.android.exoplayer.util.ParsableByteArray
;
import
com.google.android.exoplayer.util.ParsableByteArray
;
import
com.google.android.exoplayer.util.Util
;
import
android.util.Log
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.util.SparseArray
;
...
@@ -50,6 +51,9 @@ public final class TsExtractor implements Extractor {
...
@@ -50,6 +51,9 @@ public final class TsExtractor implements Extractor {
private
static
final
int
TS_STREAM_TYPE_ID3
=
0x15
;
private
static
final
int
TS_STREAM_TYPE_ID3
=
0x15
;
private
static
final
int
TS_STREAM_TYPE_EIA608
=
0x100
;
// 0xFF + 1
private
static
final
int
TS_STREAM_TYPE_EIA608
=
0x100
;
// 0xFF + 1
private
static
final
long
AC3_FORMAT_IDENTIFIER
=
Util
.
getIntegerCodeForString
(
"AC-3"
);
private
static
final
long
HEVC_FORMAT_IDENTIFIER
=
Util
.
getIntegerCodeForString
(
"HEVC"
);
private
final
PtsTimestampAdjuster
ptsTimestampAdjuster
;
private
final
PtsTimestampAdjuster
ptsTimestampAdjuster
;
private
final
ParsableByteArray
tsPacketBuffer
;
private
final
ParsableByteArray
tsPacketBuffer
;
private
final
ParsableBitArray
tsScratch
;
private
final
ParsableBitArray
tsScratch
;
...
@@ -283,8 +287,21 @@ public final class TsExtractor implements Extractor {
...
@@ -283,8 +287,21 @@ public final class TsExtractor implements Extractor {
pmtScratch
.
skipBits
(
4
);
// reserved
pmtScratch
.
skipBits
(
4
);
// reserved
int
esInfoLength
=
pmtScratch
.
readBits
(
12
);
int
esInfoLength
=
pmtScratch
.
readBits
(
12
);
// Skip the descriptors.
int
descriptorPosition
=
data
.
getPosition
();
data
.
skipBytes
(
esInfoLength
);
if
(
streamType
==
0x06
)
{
int
descriptorTag
=
data
.
readUnsignedByte
();
if
(
descriptorTag
==
0x05
)
{
// registration_descriptor
data
.
skipBytes
(
1
);
// descriptor_length
long
formatIdentifier
=
data
.
readUnsignedInt
();
if
(
formatIdentifier
==
AC3_FORMAT_IDENTIFIER
)
{
streamType
=
TS_STREAM_TYPE_ATSC_AC3
;
}
else
if
(
formatIdentifier
==
HEVC_FORMAT_IDENTIFIER
)
{
streamType
=
TS_STREAM_TYPE_H265
;
}
// Ignore additional_identification_info.
}
}
data
.
setPosition
(
descriptorPosition
+
esInfoLength
);
entriesSize
-=
esInfoLength
+
5
;
entriesSize
-=
esInfoLength
+
5
;
if
(
streamTypes
.
get
(
streamType
))
{
if
(
streamTypes
.
get
(
streamType
))
{
...
...
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