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
c37af0b5
authored
Jun 08, 2020
by
aquilescanta
Committed by
Ian Baker
Jun 08, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make ChunkExtractor return a ChunkIndex instead of a SeekMap
PiperOrigin-RevId: 315283645
parent
770df863
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/BundledChunkExtractor.java
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkExtractor.java
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashUtil.java
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/BundledChunkExtractor.java
View file @
c37af0b5
...
...
@@ -21,6 +21,7 @@ import android.util.SparseArray;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.extractor.ChunkIndex
;
import
com.google.android.exoplayer2.extractor.DummyTrackOutput
;
import
com.google.android.exoplayer2.extractor.Extractor
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
...
...
@@ -74,8 +75,8 @@ public final class BundledChunkExtractor implements ExtractorOutput, ChunkExtrac
@Override
@Nullable
public
SeekMap
getSeekMap
()
{
return
seekMap
;
public
ChunkIndex
getChunkIndex
()
{
return
seekMap
instanceof
ChunkIndex
?
(
ChunkIndex
)
seekMap
:
null
;
}
@Override
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkExtractor.java
View file @
c37af0b5
...
...
@@ -18,9 +18,9 @@ package com.google.android.exoplayer2.source.chunk;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.extractor.ChunkIndex
;
import
com.google.android.exoplayer2.extractor.Extractor
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.SeekMap
;
import
com.google.android.exoplayer2.extractor.TrackOutput
;
import
java.io.IOException
;
...
...
@@ -50,11 +50,11 @@ public interface ChunkExtractor {
}
/**
* Returns the {@link
SeekMap} most recently output by the extractor, or null if the extractor has
*
not output a {@link SeekMap}
.
* Returns the {@link
ChunkIndex} most recently obtained from the chunks, or null if a {@link
*
ChunkIndex} has not been obtained
.
*/
@Nullable
SeekMap
getSeekMap
();
ChunkIndex
getChunkIndex
();
/**
* Returns the sample {@link Format}s for the tracks identified by the extractor, or null if the
...
...
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashUtil.java
View file @
c37af0b5
...
...
@@ -136,9 +136,10 @@ public final class DashUtil {
@Nullable
public
static
ChunkIndex
loadChunkIndex
(
DataSource
dataSource
,
int
trackType
,
Representation
representation
)
throws
IOException
{
@Nullable
ChunkExtractor
chunkExtractor
=
loadInitializationData
(
dataSource
,
trackType
,
representation
,
true
);
return
chunkExtractor
==
null
?
null
:
(
ChunkIndex
)
chunkExtractor
.
getSeekMap
();
return
chunkExtractor
==
null
?
null
:
chunkExtractor
.
getChunkIndex
();
}
/**
...
...
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java
View file @
c37af0b5
...
...
@@ -24,7 +24,6 @@ import com.google.android.exoplayer2.Format;
import
com.google.android.exoplayer2.SeekParameters
;
import
com.google.android.exoplayer2.extractor.ChunkIndex
;
import
com.google.android.exoplayer2.extractor.Extractor
;
import
com.google.android.exoplayer2.extractor.SeekMap
;
import
com.google.android.exoplayer2.extractor.TrackOutput
;
import
com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor
;
import
com.google.android.exoplayer2.extractor.mp4.FragmentedMp4Extractor
;
...
...
@@ -400,13 +399,12 @@ public class DefaultDashChunkSource implements DashChunkSource {
// from the stream. If the manifest defines an index then the stream shouldn't, but in cases
// where it does we should ignore it.
if
(
representationHolder
.
segmentIndex
==
null
)
{
SeekMap
seekMap
=
representationHolder
.
chunkExtractor
.
getSeekMap
();
if
(
seekMap
!=
null
)
{
@Nullable
ChunkIndex
chunkIndex
=
representationHolder
.
chunkExtractor
.
getChunkIndex
();
if
(
chunkIndex
!=
null
)
{
representationHolders
[
trackIndex
]
=
representationHolder
.
copyWithNewSegmentIndex
(
new
DashWrappingSegmentIndex
(
(
ChunkIndex
)
seekMap
,
representationHolder
.
representation
.
presentationTimeOffsetUs
));
chunkIndex
,
representationHolder
.
representation
.
presentationTimeOffsetUs
));
}
}
}
...
...
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