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
2ce28a16
authored
Jun 14, 2019
by
arodriguez
Committed by
Toni
Jun 14, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Support for UDP data source
parent
3fcae684
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultDataSource.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultDataSource.java
View file @
2ce28a16
...
...
@@ -55,6 +55,7 @@ public final class DefaultDataSource implements DataSource {
private
static
final
String
SCHEME_ASSET
=
"asset"
;
private
static
final
String
SCHEME_CONTENT
=
"content"
;
private
static
final
String
SCHEME_RTMP
=
"rtmp"
;
private
static
final
String
SCHEME_UDP
=
"udp"
;
private
static
final
String
SCHEME_RAW
=
RawResourceDataSource
.
RAW_RESOURCE_SCHEME
;
private
final
Context
context
;
...
...
@@ -66,6 +67,7 @@ public final class DefaultDataSource implements DataSource {
@Nullable
private
DataSource
assetDataSource
;
@Nullable
private
DataSource
contentDataSource
;
@Nullable
private
DataSource
rtmpDataSource
;
@Nullable
private
DataSource
udpDataSource
;
@Nullable
private
DataSource
dataSchemeDataSource
;
@Nullable
private
DataSource
rawResourceDataSource
;
...
...
@@ -139,6 +141,7 @@ public final class DefaultDataSource implements DataSource {
maybeAddListenerToDataSource
(
assetDataSource
,
transferListener
);
maybeAddListenerToDataSource
(
contentDataSource
,
transferListener
);
maybeAddListenerToDataSource
(
rtmpDataSource
,
transferListener
);
maybeAddListenerToDataSource
(
udpDataSource
,
transferListener
);
maybeAddListenerToDataSource
(
dataSchemeDataSource
,
transferListener
);
maybeAddListenerToDataSource
(
rawResourceDataSource
,
transferListener
);
}
...
...
@@ -161,6 +164,8 @@ public final class DefaultDataSource implements DataSource {
dataSource
=
getContentDataSource
();
}
else
if
(
SCHEME_RTMP
.
equals
(
scheme
))
{
dataSource
=
getRtmpDataSource
();
}
else
if
(
SCHEME_UDP
.
equals
(
scheme
)){
dataSource
=
getUdpDataSource
();
}
else
if
(
DataSchemeDataSource
.
SCHEME_DATA
.
equals
(
scheme
))
{
dataSource
=
getDataSchemeDataSource
();
}
else
if
(
SCHEME_RAW
.
equals
(
scheme
))
{
...
...
@@ -199,6 +204,14 @@ public final class DefaultDataSource implements DataSource {
}
}
private
DataSource
getUdpDataSource
(){
if
(
udpDataSource
==
null
)
{
udpDataSource
=
new
UdpDataSource
();
addListenersToDataSource
(
udpDataSource
);
}
return
udpDataSource
;
}
private
DataSource
getFileDataSource
()
{
if
(
fileDataSource
==
null
)
{
fileDataSource
=
new
FileDataSource
();
...
...
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