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
e7da2636
authored
Jun 10, 2020
by
aquilescanta
Committed by
Oliver Woodman
Jun 11, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add MediaParser-based implementation of ChunkExtractor
PiperOrigin-RevId: 315720712
parent
3ce57ae2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java
library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java
View file @
e7da2636
...
...
@@ -529,6 +529,16 @@ public final class MimeTypes {
}
}
/** Returns whether the given {@code mimeType} is a WebM MIME type. */
public
static
boolean
isWebm
(
@Nullable
String
mimeType
)
{
if
(
mimeType
==
null
)
{
return
false
;
}
return
mimeType
.
startsWith
(
MimeTypes
.
VIDEO_WEBM
)
||
mimeType
.
startsWith
(
MimeTypes
.
AUDIO_WEBM
)
||
mimeType
.
startsWith
(
MimeTypes
.
APPLICATION_WEBM
);
}
/**
* Returns the top-level type of {@code mimeType}, or null if {@code mimeType} is null or does not
* contain a forward slash character ({@code '/'}).
...
...
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java
View file @
e7da2636
...
...
@@ -771,11 +771,6 @@ public class DefaultDashChunkSource implements DashChunkSource {
return
getFirstSegmentNum
()
+
availableSegmentCount
-
1
;
}
private
static
boolean
mimeTypeIsWebm
(
String
mimeType
)
{
return
mimeType
.
startsWith
(
MimeTypes
.
VIDEO_WEBM
)
||
mimeType
.
startsWith
(
MimeTypes
.
AUDIO_WEBM
)
||
mimeType
.
startsWith
(
MimeTypes
.
APPLICATION_WEBM
);
}
@Nullable
private
static
ChunkExtractor
createChunkExtractor
(
int
trackType
,
...
...
@@ -784,6 +779,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
List
<
Format
>
closedCaptionFormats
,
@Nullable
TrackOutput
playerEmsgTrackOutput
)
{
String
containerMimeType
=
representation
.
format
.
containerMimeType
;
Extractor
extractor
;
if
(
MimeTypes
.
isText
(
containerMimeType
))
{
if
(
MimeTypes
.
APPLICATION_RAWCC
.
equals
(
containerMimeType
))
{
...
...
@@ -793,7 +789,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
// All other text types are raw formats that do not need an extractor.
return
null
;
}
}
else
if
(
mimeTypeI
sWebm
(
containerMimeType
))
{
}
else
if
(
MimeTypes
.
i
sWebm
(
containerMimeType
))
{
extractor
=
new
MatroskaExtractor
(
MatroskaExtractor
.
FLAG_DISABLE_SEEK_FOR_CUES
);
}
else
{
int
flags
=
0
;
...
...
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