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
383b6d42
authored
Mar 09, 2021
by
aquilescanta
Committed by
Ian Baker
Mar 12, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Publish API for using MediaParser in DASH
PiperOrigin-RevId: 361828018
parent
bcb9eb43
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java
library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSourceTest.java
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java
View file @
383b6d42
...
@@ -62,12 +62,37 @@ public class DefaultDashChunkSource implements DashChunkSource {
...
@@ -62,12 +62,37 @@ public class DefaultDashChunkSource implements DashChunkSource {
private
final
DataSource
.
Factory
dataSourceFactory
;
private
final
DataSource
.
Factory
dataSourceFactory
;
private
final
int
maxSegmentsPerLoad
;
private
final
int
maxSegmentsPerLoad
;
private
final
ChunkExtractor
.
Factory
chunkExtractorFactory
;
/**
* Equivalent to {@link #Factory(ChunkExtractor.Factory, DataSource.Factory, int) new
* Factory(BundledChunkExtractor.FACTORY, dataSourceFactory, maxSegmentsPerLoad = 1)}.
*/
public
Factory
(
DataSource
.
Factory
dataSourceFactory
)
{
public
Factory
(
DataSource
.
Factory
dataSourceFactory
)
{
this
(
dataSourceFactory
,
/* maxSegmentsPerLoad= */
1
);
this
(
dataSourceFactory
,
/* maxSegmentsPerLoad= */
1
);
}
}
/**
* Equivalent to {@link #Factory(ChunkExtractor.Factory, DataSource.Factory, int) new
* Factory(BundledChunkExtractor.FACTORY, dataSourceFactory, maxSegmentsPerLoad)}.
*/
public
Factory
(
DataSource
.
Factory
dataSourceFactory
,
int
maxSegmentsPerLoad
)
{
public
Factory
(
DataSource
.
Factory
dataSourceFactory
,
int
maxSegmentsPerLoad
)
{
this
(
BundledChunkExtractor
.
FACTORY
,
dataSourceFactory
,
maxSegmentsPerLoad
);
}
/**
* Creates a new instance.
*
* @param chunkExtractorFactory Creates {@link ChunkExtractor} instances to use for extracting
* chunks.
* @param dataSourceFactory Creates the {@link DataSource} to use for downloading chunks.
* @param maxSegmentsPerLoad See {@link DefaultDashChunkSource#DefaultDashChunkSource}.
*/
public
Factory
(
ChunkExtractor
.
Factory
chunkExtractorFactory
,
DataSource
.
Factory
dataSourceFactory
,
int
maxSegmentsPerLoad
)
{
this
.
chunkExtractorFactory
=
chunkExtractorFactory
;
this
.
dataSourceFactory
=
dataSourceFactory
;
this
.
dataSourceFactory
=
dataSourceFactory
;
this
.
maxSegmentsPerLoad
=
maxSegmentsPerLoad
;
this
.
maxSegmentsPerLoad
=
maxSegmentsPerLoad
;
}
}
...
@@ -90,6 +115,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
...
@@ -90,6 +115,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
dataSource
.
addTransferListener
(
transferListener
);
dataSource
.
addTransferListener
(
transferListener
);
}
}
return
new
DefaultDashChunkSource
(
return
new
DefaultDashChunkSource
(
chunkExtractorFactory
,
manifestLoaderErrorThrower
,
manifestLoaderErrorThrower
,
manifest
,
manifest
,
periodIndex
,
periodIndex
,
...
@@ -123,6 +149,8 @@ public class DefaultDashChunkSource implements DashChunkSource {
...
@@ -123,6 +149,8 @@ public class DefaultDashChunkSource implements DashChunkSource {
private
boolean
missingLastSegment
;
private
boolean
missingLastSegment
;
/**
/**
* @param chunkExtractorFactory Creates {@link ChunkExtractor} instances to use for extracting
* chunks.
* @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
* @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
* @param manifest The initial manifest.
* @param manifest The initial manifest.
* @param periodIndex The index of the period in the manifest.
* @param periodIndex The index of the period in the manifest.
...
@@ -142,6 +170,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
...
@@ -142,6 +170,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
* messages targeting the player. Maybe null if this is not necessary.
* messages targeting the player. Maybe null if this is not necessary.
*/
*/
public
DefaultDashChunkSource
(
public
DefaultDashChunkSource
(
ChunkExtractor
.
Factory
chunkExtractorFactory
,
LoaderErrorThrower
manifestLoaderErrorThrower
,
LoaderErrorThrower
manifestLoaderErrorThrower
,
DashManifest
manifest
,
DashManifest
manifest
,
int
periodIndex
,
int
periodIndex
,
...
...
library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSourceTest.java
View file @
383b6d42
...
@@ -24,6 +24,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
...
@@ -24,6 +24,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.source.TrackGroup
;
import
com.google.android.exoplayer2.source.TrackGroup
;
import
com.google.android.exoplayer2.source.chunk.BundledChunkExtractor
;
import
com.google.android.exoplayer2.source.chunk.ChunkHolder
;
import
com.google.android.exoplayer2.source.chunk.ChunkHolder
;
import
com.google.android.exoplayer2.source.dash.manifest.DashManifest
;
import
com.google.android.exoplayer2.source.dash.manifest.DashManifest
;
import
com.google.android.exoplayer2.source.dash.manifest.DashManifestParser
;
import
com.google.android.exoplayer2.source.dash.manifest.DashManifestParser
;
...
@@ -58,6 +59,7 @@ public class DefaultDashChunkSourceTest {
...
@@ -58,6 +59,7 @@ public class DefaultDashChunkSourceTest {
SAMPLE_MPD_LIVE_WITH_OFFSET_INSIDE_WINDOW
));
SAMPLE_MPD_LIVE_WITH_OFFSET_INSIDE_WINDOW
));
DefaultDashChunkSource
chunkSource
=
DefaultDashChunkSource
chunkSource
=
new
DefaultDashChunkSource
(
new
DefaultDashChunkSource
(
BundledChunkExtractor
.
FACTORY
,
new
LoaderErrorThrower
.
Dummy
(),
new
LoaderErrorThrower
.
Dummy
(),
manifest
,
manifest
,
/* periodIndex= */
0
,
/* periodIndex= */
0
,
...
@@ -104,6 +106,7 @@ public class DefaultDashChunkSourceTest {
...
@@ -104,6 +106,7 @@ public class DefaultDashChunkSourceTest {
ApplicationProvider
.
getApplicationContext
(),
SAMPLE_MPD_VOD
));
ApplicationProvider
.
getApplicationContext
(),
SAMPLE_MPD_VOD
));
DefaultDashChunkSource
chunkSource
=
DefaultDashChunkSource
chunkSource
=
new
DefaultDashChunkSource
(
new
DefaultDashChunkSource
(
BundledChunkExtractor
.
FACTORY
,
new
LoaderErrorThrower
.
Dummy
(),
new
LoaderErrorThrower
.
Dummy
(),
manifest
,
manifest
,
/* periodIndex= */
0
,
/* periodIndex= */
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