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
0de9c007
authored
May 18, 2020
by
olly
Committed by
Oliver Woodman
May 18, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix naming to reflect that CEA-708 is supported too
PiperOrigin-RevId: 312131816
parent
be098401
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/CeaUtil.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/SeiReader.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/CeaUtil.java
View file @
0de9c007
...
...
@@ -33,8 +33,8 @@ public final class CeaUtil {
private
static
final
int
PROVIDER_CODE_DIRECTV
=
0x2F
;
/**
* Consumes the unescaped content of an SEI NAL unit, writing the content of any CEA-608
messages
* as samples to all of the provided outputs.
* Consumes the unescaped content of an SEI NAL unit, writing the content of any CEA-608
/708
*
messages
as samples to all of the provided outputs.
*
* @param presentationTimeUs The presentation time in microseconds for any samples.
* @param seiBuffer The unescaped SEI NAL unit data, excluding the NAL unit start code and type.
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java
View file @
0de9c007
...
...
@@ -171,7 +171,7 @@ public class FragmentedMp4Extractor implements Extractor {
// Extractor output.
private
@MonotonicNonNull
ExtractorOutput
extractorOutput
;
private
TrackOutput
[]
emsgTrackOutputs
;
private
TrackOutput
[]
cea
608
TrackOutputs
;
private
TrackOutput
[]
ceaTrackOutputs
;
// Whether extractorOutput.seekMap has been called.
private
boolean
haveOutputSeekMap
;
...
...
@@ -576,12 +576,12 @@ public class FragmentedMp4Extractor implements Extractor {
eventMessageTrackOutput
.
format
(
EMSG_FORMAT
);
}
}
if
(
cea
608
TrackOutputs
==
null
)
{
cea
608
TrackOutputs
=
new
TrackOutput
[
closedCaptionFormats
.
size
()];
for
(
int
i
=
0
;
i
<
cea
608
TrackOutputs
.
length
;
i
++)
{
if
(
ceaTrackOutputs
==
null
)
{
ceaTrackOutputs
=
new
TrackOutput
[
closedCaptionFormats
.
size
()];
for
(
int
i
=
0
;
i
<
ceaTrackOutputs
.
length
;
i
++)
{
TrackOutput
output
=
extractorOutput
.
track
(
trackBundles
.
size
()
+
1
+
i
,
C
.
TRACK_TYPE_TEXT
);
output
.
format
(
closedCaptionFormats
.
get
(
i
));
cea
608
TrackOutputs
[
i
]
=
output
;
ceaTrackOutputs
[
i
]
=
output
;
}
}
}
...
...
@@ -1328,8 +1328,9 @@ public class FragmentedMp4Extractor implements Extractor {
output
.
sampleData
(
nalStartCode
,
4
);
// Write the NAL unit type byte.
output
.
sampleData
(
nalPrefix
,
1
);
processSeiNalUnitPayload
=
cea608TrackOutputs
.
length
>
0
&&
NalUnitUtil
.
isNalUnitSei
(
track
.
format
.
sampleMimeType
,
nalPrefixData
[
4
]);
processSeiNalUnitPayload
=
ceaTrackOutputs
.
length
>
0
&&
NalUnitUtil
.
isNalUnitSei
(
track
.
format
.
sampleMimeType
,
nalPrefixData
[
4
]);
sampleBytesWritten
+=
5
;
sampleSize
+=
nalUnitLengthFieldLengthDiff
;
}
else
{
...
...
@@ -1345,7 +1346,7 @@ public class FragmentedMp4Extractor implements Extractor {
// If the format is H.265/HEVC the NAL unit header has two bytes so skip one more byte.
nalBuffer
.
setPosition
(
MimeTypes
.
VIDEO_H265
.
equals
(
track
.
format
.
sampleMimeType
)
?
1
:
0
);
nalBuffer
.
setLimit
(
unescapedLength
);
CeaUtil
.
consume
(
sampleTimeUs
,
nalBuffer
,
cea
608
TrackOutputs
);
CeaUtil
.
consume
(
sampleTimeUs
,
nalBuffer
,
ceaTrackOutputs
);
}
else
{
// Write the payload of the NAL unit.
writtenBytes
=
output
.
sampleData
(
input
,
sampleCurrentNalBytesRemaining
,
false
);
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/SeiReader.java
View file @
0de9c007
...
...
@@ -27,7 +27,7 @@ import com.google.android.exoplayer2.util.MimeTypes;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
java.util.List
;
/** Consumes SEI buffers, outputting contained CEA-608 messages to a {@link TrackOutput}. */
/** Consumes SEI buffers, outputting contained CEA-608
/708
messages to a {@link TrackOutput}. */
public
final
class
SeiReader
{
private
final
List
<
Format
>
closedCaptionFormats
;
...
...
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