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
b03278f2
authored
Oct 26, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Don't assume representations are video in first two DashChunkSource constructors.
parent
4d9dd3f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
demo_misc/vp9_opus_sw/src/main/java/com/google/android/exoplayer/demo/vp9opus/DashRendererBuilder.java
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
demo_misc/vp9_opus_sw/src/main/java/com/google/android/exoplayer/demo/vp9opus/DashRendererBuilder.java
View file @
b03278f2
...
@@ -24,6 +24,7 @@ import com.google.android.exoplayer.chunk.ChunkSampleSource;
...
@@ -24,6 +24,7 @@ import com.google.android.exoplayer.chunk.ChunkSampleSource;
import
com.google.android.exoplayer.chunk.ChunkSource
;
import
com.google.android.exoplayer.chunk.ChunkSource
;
import
com.google.android.exoplayer.chunk.FormatEvaluator.AdaptiveEvaluator
;
import
com.google.android.exoplayer.chunk.FormatEvaluator.AdaptiveEvaluator
;
import
com.google.android.exoplayer.dash.DashChunkSource
;
import
com.google.android.exoplayer.dash.DashChunkSource
;
import
com.google.android.exoplayer.dash.DefaultDashTrackSelector
;
import
com.google.android.exoplayer.dash.mpd.AdaptationSet
;
import
com.google.android.exoplayer.dash.mpd.AdaptationSet
;
import
com.google.android.exoplayer.dash.mpd.MediaPresentationDescription
;
import
com.google.android.exoplayer.dash.mpd.MediaPresentationDescription
;
import
com.google.android.exoplayer.dash.mpd.MediaPresentationDescriptionParser
;
import
com.google.android.exoplayer.dash.mpd.MediaPresentationDescriptionParser
;
...
@@ -108,7 +109,8 @@ public class DashRendererBuilder implements ManifestCallback<MediaPresentationDe
...
@@ -108,7 +109,8 @@ public class DashRendererBuilder implements ManifestCallback<MediaPresentationDe
LibvpxVideoTrackRenderer
videoRenderer
=
null
;
LibvpxVideoTrackRenderer
videoRenderer
=
null
;
if
(!
videoRepresentationsList
.
isEmpty
())
{
if
(!
videoRepresentationsList
.
isEmpty
())
{
DataSource
videoDataSource
=
new
DefaultUriDataSource
(
player
,
bandwidthMeter
,
userAgent
);
DataSource
videoDataSource
=
new
DefaultUriDataSource
(
player
,
bandwidthMeter
,
userAgent
);
ChunkSource
videoChunkSource
=
new
DashChunkSource
(
videoDataSource
,
ChunkSource
videoChunkSource
=
new
DashChunkSource
(
DefaultDashTrackSelector
.
newVideoInstance
(
null
,
false
,
false
),
videoDataSource
,
new
AdaptiveEvaluator
(
bandwidthMeter
),
manifest
.
getPeriodDuration
(
0
),
new
AdaptiveEvaluator
(
bandwidthMeter
),
manifest
.
getPeriodDuration
(
0
),
AdaptationSet
.
TYPE_VIDEO
,
videoRepresentations
);
AdaptationSet
.
TYPE_VIDEO
,
videoRepresentations
);
ChunkSampleSource
videoSampleSource
=
new
ChunkSampleSource
(
videoChunkSource
,
loadControl
,
ChunkSampleSource
videoSampleSource
=
new
ChunkSampleSource
(
videoChunkSource
,
loadControl
,
...
@@ -123,8 +125,9 @@ public class DashRendererBuilder implements ManifestCallback<MediaPresentationDe
...
@@ -123,8 +125,9 @@ public class DashRendererBuilder implements ManifestCallback<MediaPresentationDe
audioRenderer
=
null
;
audioRenderer
=
null
;
}
else
{
}
else
{
DataSource
audioDataSource
=
new
DefaultUriDataSource
(
player
,
bandwidthMeter
,
userAgent
);
DataSource
audioDataSource
=
new
DefaultUriDataSource
(
player
,
bandwidthMeter
,
userAgent
);
DashChunkSource
audioChunkSource
=
new
DashChunkSource
(
audioDataSource
,
null
,
DashChunkSource
audioChunkSource
=
new
DashChunkSource
(
manifest
.
getPeriodDuration
(
0
),
AdaptationSet
.
TYPE_AUDIO
,
audioRepresentation
);
DefaultDashTrackSelector
.
newAudioInstance
(),
audioDataSource
,
null
,
manifest
.
getPeriodDuration
(
0
),
AdaptationSet
.
TYPE_AUDIO
,
audioRepresentation
);
SampleSource
audioSampleSource
=
new
ChunkSampleSource
(
audioChunkSource
,
loadControl
,
SampleSource
audioSampleSource
=
new
ChunkSampleSource
(
audioChunkSource
,
loadControl
,
AUDIO_BUFFER_SEGMENTS
*
BUFFER_SEGMENT_SIZE
);
AUDIO_BUFFER_SEGMENTS
*
BUFFER_SEGMENT_SIZE
);
if
(
audioRepresentationIsOpus
)
{
if
(
audioRepresentationIsOpus
)
{
...
...
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
View file @
b03278f2
...
@@ -133,6 +133,7 @@ public class DashChunkSource implements ChunkSource, Output {
...
@@ -133,6 +133,7 @@ public class DashChunkSource implements ChunkSource, Output {
/**
/**
* Lightweight constructor to use for fixed duration content.
* Lightweight constructor to use for fixed duration content.
*
*
* @param trackSelector Selects tracks to be exposed by this source.
* @param dataSource A {@link DataSource} suitable for loading the media data.
* @param dataSource A {@link DataSource} suitable for loading the media data.
* @param adaptiveFormatEvaluator For adaptive tracks, selects from the available formats.
* @param adaptiveFormatEvaluator For adaptive tracks, selects from the available formats.
* @param durationMs The duration of the content.
* @param durationMs The duration of the content.
...
@@ -141,15 +142,17 @@ public class DashChunkSource implements ChunkSource, Output {
...
@@ -141,15 +142,17 @@ public class DashChunkSource implements ChunkSource, Output {
* {@link AdaptationSet#TYPE_TEXT}.
* {@link AdaptationSet#TYPE_TEXT}.
* @param representations The representations to be considered by the source.
* @param representations The representations to be considered by the source.
*/
*/
public
DashChunkSource
(
DataSource
dataSource
,
FormatEvaluator
adaptiveFormatEvaluator
,
public
DashChunkSource
(
DashTrackSelector
trackSelector
,
DataSource
dataSource
,
long
durationMs
,
int
adaptationSetType
,
Representation
...
representations
)
{
FormatEvaluator
adaptiveFormatEvaluator
,
long
durationMs
,
int
adaptationSetType
,
this
(
dataSource
,
adaptiveFormatEvaluator
,
durationMs
,
adaptationSetType
,
Representation
...
representations
)
{
this
(
trackSelector
,
dataSource
,
adaptiveFormatEvaluator
,
durationMs
,
adaptationSetType
,
Arrays
.
asList
(
representations
));
Arrays
.
asList
(
representations
));
}
}
/**
/**
* Lightweight constructor to use for fixed duration content.
* Lightweight constructor to use for fixed duration content.
*
*
* @param trackSelector Selects tracks to be exposed by this source.
* @param dataSource A {@link DataSource} suitable for loading the media data.
* @param dataSource A {@link DataSource} suitable for loading the media data.
* @param adaptiveFormatEvaluator For adaptive tracks, selects from the available formats.
* @param adaptiveFormatEvaluator For adaptive tracks, selects from the available formats.
* @param durationMs The duration of the content.
* @param durationMs The duration of the content.
...
@@ -158,10 +161,10 @@ public class DashChunkSource implements ChunkSource, Output {
...
@@ -158,10 +161,10 @@ public class DashChunkSource implements ChunkSource, Output {
* {@link AdaptationSet#TYPE_TEXT}.
* {@link AdaptationSet#TYPE_TEXT}.
* @param representations The representations to be considered by the source.
* @param representations The representations to be considered by the source.
*/
*/
public
DashChunkSource
(
Da
taSource
dataSource
,
FormatEvaluator
adaptiveFormatEvaluator
,
public
DashChunkSource
(
Da
shTrackSelector
trackSelector
,
DataSource
dataSource
,
long
durationMs
,
int
adaptationSetType
,
List
<
Representation
>
representations
)
{
FormatEvaluator
adaptiveFormatEvaluator
,
long
durationMs
,
int
adaptationSetType
,
this
(
buildManifest
(
durationMs
,
adaptationSetType
,
representations
),
List
<
Representation
>
representations
)
{
DefaultDashTrackSelector
.
newVideoInstance
(
null
,
false
,
false
)
,
dataSource
,
this
(
buildManifest
(
durationMs
,
adaptationSetType
,
representations
),
trackSelector
,
dataSource
,
adaptiveFormatEvaluator
);
adaptiveFormatEvaluator
);
}
}
...
...
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