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
3d775c16
authored
Dec 03, 2014
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use C constants + minor cleanup.
parent
511dd943
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
demo/src/main/java/com/google/android/exoplayer/demo/DemoUtil.java
library/src/main/java/com/google/android/exoplayer/hls/HlsChunkSource.java
library/src/main/java/com/google/android/exoplayer/hls/HlsMediaPlaylist.java
library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java
library/src/main/java/com/google/android/exoplayer/hls/TsExtractor.java
demo/src/main/java/com/google/android/exoplayer/demo/DemoUtil.java
View file @
3d775c16
...
@@ -50,9 +50,7 @@ public class DemoUtil {
...
@@ -50,9 +50,7 @@ public class DemoUtil {
public
static
final
int
TYPE_DASH
=
0
;
public
static
final
int
TYPE_DASH
=
0
;
public
static
final
int
TYPE_SS
=
1
;
public
static
final
int
TYPE_SS
=
1
;
public
static
final
int
TYPE_OTHER
=
2
;
public
static
final
int
TYPE_OTHER
=
2
;
public
static
final
int
TYPE_DASH_LIVE
=
3
;
public
static
final
int
TYPE_HLS
=
3
;
public
static
final
int
TYPE_DASH_LIVE_DVR
=
4
;
public
static
final
int
TYPE_HLS
=
5
;
public
static
final
boolean
EXPOSE_EXPERIMENTAL_FEATURES
=
false
;
public
static
final
boolean
EXPOSE_EXPERIMENTAL_FEATURES
=
false
;
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsChunkSource.java
View file @
3d775c16
...
@@ -17,7 +17,6 @@ package com.google.android.exoplayer.hls;
...
@@ -17,7 +17,6 @@ package com.google.android.exoplayer.hls;
import
com.google.android.exoplayer.C
;
import
com.google.android.exoplayer.C
;
import
com.google.android.exoplayer.MediaFormat
;
import
com.google.android.exoplayer.MediaFormat
;
import
com.google.android.exoplayer.TrackRenderer
;
import
com.google.android.exoplayer.hls.TsExtractor.SamplePool
;
import
com.google.android.exoplayer.hls.TsExtractor.SamplePool
;
import
com.google.android.exoplayer.upstream.Aes128DataSource
;
import
com.google.android.exoplayer.upstream.Aes128DataSource
;
import
com.google.android.exoplayer.upstream.BandwidthMeter
;
import
com.google.android.exoplayer.upstream.BandwidthMeter
;
...
@@ -193,7 +192,7 @@ public class HlsChunkSource {
...
@@ -193,7 +192,7 @@ public class HlsChunkSource {
}
}
public
long
getDurationUs
()
{
public
long
getDurationUs
()
{
return
live
?
TrackRenderer
.
UNKNOWN_TIME_US
:
durationUs
;
return
live
?
C
.
UNKNOWN_TIME_US
:
durationUs
;
}
}
/**
/**
...
@@ -313,7 +312,7 @@ public class HlsChunkSource {
...
@@ -313,7 +312,7 @@ public class HlsChunkSource {
}
else
/* Not live */
{
}
else
/* Not live */
{
startTimeUs
=
segment
.
startTimeUs
;
startTimeUs
=
segment
.
startTimeUs
;
}
}
long
endTimeUs
=
startTimeUs
+
(
long
)
(
segment
.
durationSecs
*
1000000
);
long
endTimeUs
=
startTimeUs
+
(
long
)
(
segment
.
durationSecs
*
C
.
MICROS_PER_SECOND
);
boolean
isLastChunk
=
!
mediaPlaylist
.
live
&&
chunkIndex
==
mediaPlaylist
.
segments
.
size
()
-
1
;
boolean
isLastChunk
=
!
mediaPlaylist
.
live
&&
chunkIndex
==
mediaPlaylist
.
segments
.
size
()
-
1
;
// Configure the extractor that will read the chunk.
// Configure the extractor that will read the chunk.
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsMediaPlaylist.java
View file @
3d775c16
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
package
com
.
google
.
android
.
exoplayer
.
hls
;
package
com
.
google
.
android
.
exoplayer
.
hls
;
import
com.google.android.exoplayer.C
;
import
android.net.Uri
;
import
android.net.Uri
;
import
java.util.List
;
import
java.util.List
;
...
@@ -77,11 +79,11 @@ public final class HlsMediaPlaylist extends HlsPlaylist {
...
@@ -77,11 +79,11 @@ public final class HlsMediaPlaylist extends HlsPlaylist {
this
.
live
=
live
;
this
.
live
=
live
;
this
.
segments
=
segments
;
this
.
segments
=
segments
;
if
(
this
.
segments
.
size
()
>
0
)
{
if
(
!
segments
.
isEmpty
()
)
{
Segment
last
Segment
=
segments
.
get
(
this
.
segments
.
size
()
-
1
);
Segment
last
=
segments
.
get
(
segments
.
size
()
-
1
);
this
.
durationUs
=
lastSegment
.
startTimeUs
+
(
long
)
(
lastSegment
.
durationSecs
*
1000000
);
durationUs
=
last
.
startTimeUs
+
(
long
)
(
last
.
durationSecs
*
C
.
MICROS_PER_SECOND
);
}
else
{
}
else
{
this
.
durationUs
=
0
;
durationUs
=
0
;
}
}
}
}
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java
View file @
3d775c16
...
@@ -223,7 +223,7 @@ public final class HlsPlaylistParser implements ManifestParser<HlsPlaylist> {
...
@@ -223,7 +223,7 @@ public final class HlsPlaylistParser implements ManifestParser<HlsPlaylist> {
segments
.
add
(
new
Segment
(
line
,
segmentDurationSecs
,
segmentDiscontinuity
,
segments
.
add
(
new
Segment
(
line
,
segmentDurationSecs
,
segmentDiscontinuity
,
segmentStartTimeUs
,
segmentEncryptionMethod
,
segmentEncryptionKeyUri
,
segmentStartTimeUs
,
segmentEncryptionMethod
,
segmentEncryptionKeyUri
,
segmentEncryptionIV
,
segmentByterangeOffset
,
segmentByterangeLength
));
segmentEncryptionIV
,
segmentByterangeOffset
,
segmentByterangeLength
));
segmentStartTimeUs
+=
(
long
)
(
segmentDurationSecs
*
1000000
);
segmentStartTimeUs
+=
(
long
)
(
segmentDurationSecs
*
C
.
MICROS_PER_SECOND
);
segmentDiscontinuity
=
false
;
segmentDiscontinuity
=
false
;
segmentDurationSecs
=
0.0
;
segmentDurationSecs
=
0.0
;
if
(
segmentByterangeLength
!=
C
.
LENGTH_UNBOUNDED
)
{
if
(
segmentByterangeLength
!=
C
.
LENGTH_UNBOUNDED
)
{
...
...
library/src/main/java/com/google/android/exoplayer/hls/TsExtractor.java
View file @
3d775c16
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
*/
*/
package
com
.
google
.
android
.
exoplayer
.
hls
;
package
com
.
google
.
android
.
exoplayer
.
hls
;
import
com.google.android.exoplayer.C
;
import
com.google.android.exoplayer.MediaFormat
;
import
com.google.android.exoplayer.MediaFormat
;
import
com.google.android.exoplayer.SampleHolder
;
import
com.google.android.exoplayer.SampleHolder
;
import
com.google.android.exoplayer.metadata.Eia608Parser
;
import
com.google.android.exoplayer.metadata.Eia608Parser
;
...
@@ -480,7 +481,7 @@ public final class TsExtractor {
...
@@ -480,7 +481,7 @@ public final class TsExtractor {
pesBuffer
.
skipBits
(
1
);
pesBuffer
.
skipBits
(
1
);
pts
|=
pesBuffer
.
readBitsLong
(
15
);
pts
|=
pesBuffer
.
readBitsLong
(
15
);
pesBuffer
.
skipBits
(
1
);
pesBuffer
.
skipBits
(
1
);
timeUs
=
pts
*
1000000
/
90000
;
timeUs
=
(
pts
*
C
.
MICROS_PER_SECOND
)
/
90000
;
// Skip the rest of the header.
// Skip the rest of the header.
pesBuffer
.
skipBytes
(
headerDataLength
-
5
);
pesBuffer
.
skipBytes
(
headerDataLength
-
5
);
}
else
{
}
else
{
...
@@ -1035,7 +1036,7 @@ public final class TsExtractor {
...
@@ -1035,7 +1036,7 @@ public final class TsExtractor {
MediaFormat
mediaFormat
=
MediaFormat
.
createAudioFormat
(
MimeTypes
.
AUDIO_AAC
,
MediaFormat
mediaFormat
=
MediaFormat
.
createAudioFormat
(
MimeTypes
.
AUDIO_AAC
,
MediaFormat
.
NO_VALUE
,
audioParams
.
second
,
audioParams
.
first
,
MediaFormat
.
NO_VALUE
,
audioParams
.
second
,
audioParams
.
first
,
Collections
.
singletonList
(
audioSpecificConfig
));
Collections
.
singletonList
(
audioSpecificConfig
));
frameDurationUs
=
(
1000000
*
1024L
)
/
mediaFormat
.
sampleRate
;
frameDurationUs
=
(
C
.
MICROS_PER_SECOND
*
1024L
)
/
mediaFormat
.
sampleRate
;
setMediaFormat
(
mediaFormat
);
setMediaFormat
(
mediaFormat
);
}
else
{
}
else
{
adtsBuffer
.
skipBits
(
10
);
adtsBuffer
.
skipBits
(
10
);
...
...
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