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
0c49b81b
authored
Mar 23, 2017
by
Sergio Moreno Mozota
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add DVB subtitle support, based in the TVHeadend spec, to the MatroskaExtractor
parent
937675d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
library/core/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java
View file @
0c49b81b
...
...
@@ -99,6 +99,7 @@ public final class MatroskaExtractor implements Extractor {
private
static
final
String
CODEC_ID_SUBRIP
=
"S_TEXT/UTF8"
;
private
static
final
String
CODEC_ID_VOBSUB
=
"S_VOBSUB"
;
private
static
final
String
CODEC_ID_PGS
=
"S_HDMV/PGS"
;
private
static
final
String
CODEC_ID_DVBSUB
=
"S_DVBSUB"
;
private
static
final
int
VORBIS_MAX_INPUT_SIZE
=
8192
;
private
static
final
int
OPUS_MAX_INPUT_SIZE
=
5760
;
...
...
@@ -1233,8 +1234,8 @@ public final class MatroskaExtractor implements Extractor {
||
CODEC_ID_PCM_INT_LIT
.
equals
(
codecId
)
||
CODEC_ID_SUBRIP
.
equals
(
codecId
)
||
CODEC_ID_VOBSUB
.
equals
(
codecId
)
||
CODEC_ID_PGS
.
equals
(
codecId
)
;
}
||
CODEC_ID_PGS
.
equals
(
codecId
)
||
CODEC_ID_DVBSUB
.
equals
(
codecId
);
}
/**
* Returns an array that can store (at least) {@code length} elements, which will be either a new
...
...
@@ -1461,6 +1462,14 @@ public final class MatroskaExtractor implements Extractor {
case
CODEC_ID_PGS:
mimeType
=
MimeTypes
.
APPLICATION_PGS
;
break
;
case
CODEC_ID_DVBSUB:
mimeType
=
MimeTypes
.
APPLICATION_DVBSUBS
;
initializationData
=
new
ArrayList
<>(
4
);
initializationData
.
add
(
null
);
initializationData
.
add
(
new
byte
[]
{
codecPrivate
[
0
],
codecPrivate
[
1
]});
initializationData
.
add
(
new
byte
[]
{
codecPrivate
[
2
],
codecPrivate
[
3
]});
initializationData
.
add
(
"mkv"
.
getBytes
());
break
;
default
:
throw
new
ParserException
(
"Unrecognized codec identifier."
);
}
...
...
@@ -1495,7 +1504,8 @@ public final class MatroskaExtractor implements Extractor {
format
=
Format
.
createTextSampleFormat
(
Integer
.
toString
(
trackId
),
mimeType
,
null
,
Format
.
NO_VALUE
,
selectionFlags
,
language
,
drmInitData
);
}
else
if
(
MimeTypes
.
APPLICATION_VOBSUB
.
equals
(
mimeType
)
||
MimeTypes
.
APPLICATION_PGS
.
equals
(
mimeType
))
{
||
MimeTypes
.
APPLICATION_PGS
.
equals
(
mimeType
)
||
MimeTypes
.
APPLICATION_DVBSUBS
.
equals
(
mimeType
))
{
type
=
C
.
TRACK_TYPE_TEXT
;
format
=
Format
.
createImageSampleFormat
(
Integer
.
toString
(
trackId
),
mimeType
,
null
,
Format
.
NO_VALUE
,
initializationData
,
language
,
drmInitData
);
...
...
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