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
c0ecc223
authored
Jun 10, 2015
by
Thanh Pham
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fetch next Dash manifest using URL in Location directive if exists
parent
8cf7d372
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescription.java
library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
View file @
c0ecc223
...
@@ -298,6 +298,10 @@ public class DashChunkSource implements ChunkSource {
...
@@ -298,6 +298,10 @@ public class DashChunkSource implements ChunkSource {
if
(
finishedCurrentManifest
&&
(
android
.
os
.
SystemClock
.
elapsedRealtime
()
if
(
finishedCurrentManifest
&&
(
android
.
os
.
SystemClock
.
elapsedRealtime
()
>
manifestFetcher
.
getManifestLoadTimestamp
()
+
minUpdatePeriod
))
{
>
manifestFetcher
.
getManifestLoadTimestamp
()
+
minUpdatePeriod
))
{
String
newManifestURL
=
currentManifest
.
location
;
if
(
newManifestURL
!=
null
)
{
manifestFetcher
.
updateManifestUrl
(
newManifestURL
);
}
manifestFetcher
.
requestRefresh
();
manifestFetcher
.
requestRefresh
();
}
}
}
}
...
@@ -589,7 +593,7 @@ public class DashChunkSource implements ChunkSource {
...
@@ -589,7 +593,7 @@ public class DashChunkSource implements ChunkSource {
firstRepresentation
.
periodDurationMs
,
Collections
.
singletonList
(
adaptationSet
));
firstRepresentation
.
periodDurationMs
,
Collections
.
singletonList
(
adaptationSet
));
long
duration
=
firstRepresentation
.
periodDurationMs
-
firstRepresentation
.
periodStartMs
;
long
duration
=
firstRepresentation
.
periodDurationMs
-
firstRepresentation
.
periodStartMs
;
return
new
MediaPresentationDescription
(-
1
,
duration
,
-
1
,
false
,
-
1
,
-
1
,
null
,
return
new
MediaPresentationDescription
(-
1
,
duration
,
-
1
,
false
,
-
1
,
-
1
,
null
,
Collections
.
singletonList
(
period
));
Collections
.
singletonList
(
period
)
,
null
);
}
}
private
static
class
RepresentationHolder
{
private
static
class
RepresentationHolder
{
...
...
library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescription.java
View file @
c0ecc223
...
@@ -39,9 +39,11 @@ public class MediaPresentationDescription {
...
@@ -39,9 +39,11 @@ public class MediaPresentationDescription {
public
final
UtcTimingElement
utcTiming
;
public
final
UtcTimingElement
utcTiming
;
public
final
String
location
;
public
MediaPresentationDescription
(
long
availabilityStartTime
,
long
duration
,
long
minBufferTime
,
public
MediaPresentationDescription
(
long
availabilityStartTime
,
long
duration
,
long
minBufferTime
,
boolean
dynamic
,
long
minUpdatePeriod
,
long
timeShiftBufferDepth
,
UtcTimingElement
utcTiming
,
boolean
dynamic
,
long
minUpdatePeriod
,
long
timeShiftBufferDepth
,
UtcTimingElement
utcTiming
,
List
<
Period
>
periods
)
{
List
<
Period
>
periods
,
String
location
)
{
this
.
availabilityStartTime
=
availabilityStartTime
;
this
.
availabilityStartTime
=
availabilityStartTime
;
this
.
duration
=
duration
;
this
.
duration
=
duration
;
this
.
minBufferTime
=
minBufferTime
;
this
.
minBufferTime
=
minBufferTime
;
...
@@ -50,6 +52,7 @@ public class MediaPresentationDescription {
...
@@ -50,6 +52,7 @@ public class MediaPresentationDescription {
this
.
timeShiftBufferDepth
=
timeShiftBufferDepth
;
this
.
timeShiftBufferDepth
=
timeShiftBufferDepth
;
this
.
utcTiming
=
utcTiming
;
this
.
utcTiming
=
utcTiming
;
this
.
periods
=
Collections
.
unmodifiableList
(
periods
);
this
.
periods
=
Collections
.
unmodifiableList
(
periods
);
this
.
location
=
location
;
}
}
}
}
library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java
View file @
c0ecc223
...
@@ -111,6 +111,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
...
@@ -111,6 +111,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
long
timeShiftBufferDepthMs
=
(
dynamic
)
?
parseDuration
(
xpp
,
"timeShiftBufferDepth"
,
-
1
)
long
timeShiftBufferDepthMs
=
(
dynamic
)
?
parseDuration
(
xpp
,
"timeShiftBufferDepth"
,
-
1
)
:
-
1
;
:
-
1
;
UtcTimingElement
utcTiming
=
null
;
UtcTimingElement
utcTiming
=
null
;
String
location
=
null
;
List
<
Period
>
periods
=
new
ArrayList
<>();
List
<
Period
>
periods
=
new
ArrayList
<>();
do
{
do
{
...
@@ -121,19 +122,21 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
...
@@ -121,19 +122,21 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
utcTiming
=
parseUtcTiming
(
xpp
);
utcTiming
=
parseUtcTiming
(
xpp
);
}
else
if
(
isStartTag
(
xpp
,
"Period"
))
{
}
else
if
(
isStartTag
(
xpp
,
"Period"
))
{
periods
.
add
(
parsePeriod
(
xpp
,
baseUrl
,
durationMs
));
periods
.
add
(
parsePeriod
(
xpp
,
baseUrl
,
durationMs
));
}
else
if
(
isStartTag
(
xpp
,
"Location"
))
{
location
=
xpp
.
nextText
();
}
}
}
while
(!
isEndTag
(
xpp
,
"MPD"
));
}
while
(!
isEndTag
(
xpp
,
"MPD"
));
return
buildMediaPresentationDescription
(
availabilityStartTime
,
durationMs
,
minBufferTimeMs
,
return
buildMediaPresentationDescription
(
availabilityStartTime
,
durationMs
,
minBufferTimeMs
,
dynamic
,
minUpdateTimeMs
,
timeShiftBufferDepthMs
,
utcTiming
,
periods
);
dynamic
,
minUpdateTimeMs
,
timeShiftBufferDepthMs
,
utcTiming
,
periods
,
location
);
}
}
protected
MediaPresentationDescription
buildMediaPresentationDescription
(
protected
MediaPresentationDescription
buildMediaPresentationDescription
(
long
availabilityStartTime
,
long
durationMs
,
long
minBufferTimeMs
,
boolean
dynamic
,
long
availabilityStartTime
,
long
durationMs
,
long
minBufferTimeMs
,
boolean
dynamic
,
long
minUpdateTimeMs
,
long
timeShiftBufferDepthMs
,
UtcTimingElement
utcTiming
,
long
minUpdateTimeMs
,
long
timeShiftBufferDepthMs
,
UtcTimingElement
utcTiming
,
List
<
Period
>
periods
)
{
List
<
Period
>
periods
,
String
location
)
{
return
new
MediaPresentationDescription
(
availabilityStartTime
,
durationMs
,
minBufferTimeMs
,
return
new
MediaPresentationDescription
(
availabilityStartTime
,
durationMs
,
minBufferTimeMs
,
dynamic
,
minUpdateTimeMs
,
timeShiftBufferDepthMs
,
utcTiming
,
periods
);
dynamic
,
minUpdateTimeMs
,
timeShiftBufferDepthMs
,
utcTiming
,
periods
,
location
);
}
}
protected
UtcTimingElement
parseUtcTiming
(
XmlPullParser
xpp
)
{
protected
UtcTimingElement
parseUtcTiming
(
XmlPullParser
xpp
)
{
...
...
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