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
b5c4148f
authored
Oct 27, 2014
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use UriDataSource in demo app.
parent
192cdc66
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
demo/src/main/java/com/google/android/exoplayer/demo/full/player/DashVodRendererBuilder.java
demo/src/main/java/com/google/android/exoplayer/demo/full/player/SmoothStreamingRendererBuilder.java
demo/src/main/java/com/google/android/exoplayer/demo/simple/DashVodRendererBuilder.java
demo/src/main/java/com/google/android/exoplayer/demo/simple/SmoothStreamingRendererBuilder.java
demo/src/main/java/com/google/android/exoplayer/demo/full/player/DashVodRendererBuilder.java
View file @
b5c4148f
...
@@ -43,7 +43,7 @@ import com.google.android.exoplayer.drm.StreamingDrmSessionManager;
...
@@ -43,7 +43,7 @@ import com.google.android.exoplayer.drm.StreamingDrmSessionManager;
import
com.google.android.exoplayer.upstream.BufferPool
;
import
com.google.android.exoplayer.upstream.BufferPool
;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DefaultBandwidthMeter
;
import
com.google.android.exoplayer.upstream.DefaultBandwidthMeter
;
import
com.google.android.exoplayer.upstream.
Http
DataSource
;
import
com.google.android.exoplayer.upstream.
Uri
DataSource
;
import
com.google.android.exoplayer.util.ManifestFetcher
;
import
com.google.android.exoplayer.util.ManifestFetcher
;
import
com.google.android.exoplayer.util.ManifestFetcher.ManifestCallback
;
import
com.google.android.exoplayer.util.ManifestFetcher.ManifestCallback
;
import
com.google.android.exoplayer.util.MimeTypes
;
import
com.google.android.exoplayer.util.MimeTypes
;
...
@@ -162,7 +162,7 @@ public class DashVodRendererBuilder implements RendererBuilder,
...
@@ -162,7 +162,7 @@ public class DashVodRendererBuilder implements RendererBuilder,
}
}
// Build the video renderer.
// Build the video renderer.
DataSource
videoDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
videoDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
ChunkSource
videoChunkSource
;
ChunkSource
videoChunkSource
;
String
mimeType
=
videoRepresentations
[
0
].
format
.
mimeType
;
String
mimeType
=
videoRepresentations
[
0
].
format
.
mimeType
;
if
(
mimeType
.
equals
(
MimeTypes
.
VIDEO_MP4
)
||
mimeType
.
equals
(
MimeTypes
.
VIDEO_WEBM
))
{
if
(
mimeType
.
equals
(
MimeTypes
.
VIDEO_MP4
)
||
mimeType
.
equals
(
MimeTypes
.
VIDEO_WEBM
))
{
...
@@ -187,7 +187,7 @@ public class DashVodRendererBuilder implements RendererBuilder,
...
@@ -187,7 +187,7 @@ public class DashVodRendererBuilder implements RendererBuilder,
audioChunkSource
=
null
;
audioChunkSource
=
null
;
audioRenderer
=
null
;
audioRenderer
=
null
;
}
else
{
}
else
{
DataSource
audioDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
audioDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
audioTrackNames
=
new
String
[
audioRepresentationsList
.
size
()];
audioTrackNames
=
new
String
[
audioRepresentationsList
.
size
()];
ChunkSource
[]
audioChunkSources
=
new
ChunkSource
[
audioRepresentationsList
.
size
()];
ChunkSource
[]
audioChunkSources
=
new
ChunkSource
[
audioRepresentationsList
.
size
()];
FormatEvaluator
audioEvaluator
=
new
FormatEvaluator
.
FixedEvaluator
();
FormatEvaluator
audioEvaluator
=
new
FormatEvaluator
.
FixedEvaluator
();
...
...
demo/src/main/java/com/google/android/exoplayer/demo/full/player/SmoothStreamingRendererBuilder.java
View file @
b5c4148f
...
@@ -41,7 +41,7 @@ import com.google.android.exoplayer.text.ttml.TtmlParser;
...
@@ -41,7 +41,7 @@ import com.google.android.exoplayer.text.ttml.TtmlParser;
import
com.google.android.exoplayer.upstream.BufferPool
;
import
com.google.android.exoplayer.upstream.BufferPool
;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DefaultBandwidthMeter
;
import
com.google.android.exoplayer.upstream.DefaultBandwidthMeter
;
import
com.google.android.exoplayer.upstream.
Http
DataSource
;
import
com.google.android.exoplayer.upstream.
Uri
DataSource
;
import
com.google.android.exoplayer.util.ManifestFetcher
;
import
com.google.android.exoplayer.util.ManifestFetcher
;
import
com.google.android.exoplayer.util.Util
;
import
com.google.android.exoplayer.util.Util
;
...
@@ -155,7 +155,7 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
...
@@ -155,7 +155,7 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
}
}
// Build the video renderer.
// Build the video renderer.
DataSource
videoDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
videoDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
ChunkSource
videoChunkSource
=
new
SmoothStreamingChunkSource
(
manifestFetcher
,
ChunkSource
videoChunkSource
=
new
SmoothStreamingChunkSource
(
manifestFetcher
,
videoStreamElementIndex
,
videoTrackIndices
,
videoDataSource
,
videoStreamElementIndex
,
videoTrackIndices
,
videoDataSource
,
new
AdaptiveEvaluator
(
bandwidthMeter
),
LIVE_EDGE_LATENCY_MS
);
new
AdaptiveEvaluator
(
bandwidthMeter
),
LIVE_EDGE_LATENCY_MS
);
...
@@ -177,7 +177,7 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
...
@@ -177,7 +177,7 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
}
else
{
}
else
{
audioTrackNames
=
new
String
[
audioStreamElementCount
];
audioTrackNames
=
new
String
[
audioStreamElementCount
];
ChunkSource
[]
audioChunkSources
=
new
ChunkSource
[
audioStreamElementCount
];
ChunkSource
[]
audioChunkSources
=
new
ChunkSource
[
audioStreamElementCount
];
DataSource
audioDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
audioDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
FormatEvaluator
audioFormatEvaluator
=
new
FormatEvaluator
.
FixedEvaluator
();
FormatEvaluator
audioFormatEvaluator
=
new
FormatEvaluator
.
FixedEvaluator
();
audioStreamElementCount
=
0
;
audioStreamElementCount
=
0
;
for
(
int
i
=
0
;
i
<
manifest
.
streamElements
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
manifest
.
streamElements
.
length
;
i
++)
{
...
@@ -208,7 +208,7 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
...
@@ -208,7 +208,7 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
}
else
{
}
else
{
textTrackNames
=
new
String
[
textStreamElementCount
];
textTrackNames
=
new
String
[
textStreamElementCount
];
ChunkSource
[]
textChunkSources
=
new
ChunkSource
[
textStreamElementCount
];
ChunkSource
[]
textChunkSources
=
new
ChunkSource
[
textStreamElementCount
];
DataSource
ttmlDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
ttmlDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
FormatEvaluator
ttmlFormatEvaluator
=
new
FormatEvaluator
.
FixedEvaluator
();
FormatEvaluator
ttmlFormatEvaluator
=
new
FormatEvaluator
.
FixedEvaluator
();
textStreamElementCount
=
0
;
textStreamElementCount
=
0
;
for
(
int
i
=
0
;
i
<
manifest
.
streamElements
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
manifest
.
streamElements
.
length
;
i
++)
{
...
...
demo/src/main/java/com/google/android/exoplayer/demo/simple/DashVodRendererBuilder.java
View file @
b5c4148f
...
@@ -37,7 +37,7 @@ import com.google.android.exoplayer.demo.simple.SimplePlayerActivity.RendererBui
...
@@ -37,7 +37,7 @@ import com.google.android.exoplayer.demo.simple.SimplePlayerActivity.RendererBui
import
com.google.android.exoplayer.upstream.BufferPool
;
import
com.google.android.exoplayer.upstream.BufferPool
;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DefaultBandwidthMeter
;
import
com.google.android.exoplayer.upstream.DefaultBandwidthMeter
;
import
com.google.android.exoplayer.upstream.
Http
DataSource
;
import
com.google.android.exoplayer.upstream.
Uri
DataSource
;
import
com.google.android.exoplayer.util.ManifestFetcher
;
import
com.google.android.exoplayer.util.ManifestFetcher
;
import
com.google.android.exoplayer.util.ManifestFetcher.ManifestCallback
;
import
com.google.android.exoplayer.util.ManifestFetcher.ManifestCallback
;
...
@@ -118,7 +118,7 @@ import java.util.ArrayList;
...
@@ -118,7 +118,7 @@ import java.util.ArrayList;
videoRepresentationsList
.
toArray
(
videoRepresentations
);
videoRepresentationsList
.
toArray
(
videoRepresentations
);
// Build the video renderer.
// Build the video renderer.
DataSource
videoDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
videoDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
ChunkSource
videoChunkSource
=
new
DashChunkSource
(
videoDataSource
,
ChunkSource
videoChunkSource
=
new
DashChunkSource
(
videoDataSource
,
new
AdaptiveEvaluator
(
bandwidthMeter
),
videoRepresentations
);
new
AdaptiveEvaluator
(
bandwidthMeter
),
videoRepresentations
);
ChunkSampleSource
videoSampleSource
=
new
ChunkSampleSource
(
videoChunkSource
,
loadControl
,
ChunkSampleSource
videoSampleSource
=
new
ChunkSampleSource
(
videoChunkSource
,
loadControl
,
...
@@ -127,7 +127,7 @@ import java.util.ArrayList;
...
@@ -127,7 +127,7 @@ import java.util.ArrayList;
MediaCodec
.
VIDEO_SCALING_MODE_SCALE_TO_FIT
,
0
,
mainHandler
,
playerActivity
,
50
);
MediaCodec
.
VIDEO_SCALING_MODE_SCALE_TO_FIT
,
0
,
mainHandler
,
playerActivity
,
50
);
// Build the audio renderer.
// Build the audio renderer.
DataSource
audioDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
audioDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
ChunkSource
audioChunkSource
=
new
DashChunkSource
(
audioDataSource
,
ChunkSource
audioChunkSource
=
new
DashChunkSource
(
audioDataSource
,
new
FormatEvaluator
.
FixedEvaluator
(),
audioRepresentation
);
new
FormatEvaluator
.
FixedEvaluator
(),
audioRepresentation
);
SampleSource
audioSampleSource
=
new
ChunkSampleSource
(
audioChunkSource
,
loadControl
,
SampleSource
audioSampleSource
=
new
ChunkSampleSource
(
audioChunkSource
,
loadControl
,
...
...
demo/src/main/java/com/google/android/exoplayer/demo/simple/SmoothStreamingRendererBuilder.java
View file @
b5c4148f
...
@@ -35,7 +35,7 @@ import com.google.android.exoplayer.smoothstreaming.SmoothStreamingManifestParse
...
@@ -35,7 +35,7 @@ import com.google.android.exoplayer.smoothstreaming.SmoothStreamingManifestParse
import
com.google.android.exoplayer.upstream.BufferPool
;
import
com.google.android.exoplayer.upstream.BufferPool
;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DefaultBandwidthMeter
;
import
com.google.android.exoplayer.upstream.DefaultBandwidthMeter
;
import
com.google.android.exoplayer.upstream.
Http
DataSource
;
import
com.google.android.exoplayer.upstream.
Uri
DataSource
;
import
com.google.android.exoplayer.util.ManifestFetcher
;
import
com.google.android.exoplayer.util.ManifestFetcher
;
import
com.google.android.exoplayer.util.ManifestFetcher.ManifestCallback
;
import
com.google.android.exoplayer.util.ManifestFetcher.ManifestCallback
;
...
@@ -121,7 +121,7 @@ import java.util.ArrayList;
...
@@ -121,7 +121,7 @@ import java.util.ArrayList;
}
}
// Build the video renderer.
// Build the video renderer.
DataSource
videoDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
videoDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
ChunkSource
videoChunkSource
=
new
SmoothStreamingChunkSource
(
manifestFetcher
,
ChunkSource
videoChunkSource
=
new
SmoothStreamingChunkSource
(
manifestFetcher
,
videoStreamElementIndex
,
videoTrackIndices
,
videoDataSource
,
videoStreamElementIndex
,
videoTrackIndices
,
videoDataSource
,
new
AdaptiveEvaluator
(
bandwidthMeter
),
LIVE_EDGE_LATENCY_MS
);
new
AdaptiveEvaluator
(
bandwidthMeter
),
LIVE_EDGE_LATENCY_MS
);
...
@@ -131,7 +131,7 @@ import java.util.ArrayList;
...
@@ -131,7 +131,7 @@ import java.util.ArrayList;
MediaCodec
.
VIDEO_SCALING_MODE_SCALE_TO_FIT
,
0
,
mainHandler
,
playerActivity
,
50
);
MediaCodec
.
VIDEO_SCALING_MODE_SCALE_TO_FIT
,
0
,
mainHandler
,
playerActivity
,
50
);
// Build the audio renderer.
// Build the audio renderer.
DataSource
audioDataSource
=
new
HttpDataSource
(
userAgent
,
null
,
bandwidthMeter
);
DataSource
audioDataSource
=
new
UriDataSource
(
userAgent
,
bandwidthMeter
);
ChunkSource
audioChunkSource
=
new
SmoothStreamingChunkSource
(
manifestFetcher
,
ChunkSource
audioChunkSource
=
new
SmoothStreamingChunkSource
(
manifestFetcher
,
audioStreamElementIndex
,
new
int
[]
{
0
},
audioDataSource
,
audioStreamElementIndex
,
new
int
[]
{
0
},
audioDataSource
,
new
FormatEvaluator
.
FixedEvaluator
(),
LIVE_EDGE_LATENCY_MS
);
new
FormatEvaluator
.
FixedEvaluator
(),
LIVE_EDGE_LATENCY_MS
);
...
...
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