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
bb9e34f5
authored
Jan 21, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Minor style tweaks.
parent
5941882d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
library/src/main/java/com/google/android/exoplayer/FrameworkSampleSource.java
library/src/main/java/com/google/android/exoplayer/FrameworkSampleSource.java
View file @
bb9e34f5
...
...
@@ -40,13 +40,15 @@ public final class FrameworkSampleSource implements SampleSource {
private
static
final
int
TRACK_STATE_ENABLED
=
1
;
private
static
final
int
TRACK_STATE_FORMAT_SENT
=
2
;
// Parameters for a Uri data source.
private
final
Context
context
;
private
final
Uri
uri
;
private
final
Map
<
String
,
String
>
headers
;
// Parameters for a FileDescriptor data source.
private
final
FileDescriptor
fileDescriptor
;
private
final
long
f
d
Offset
;
private
final
long
f
d
Length
;
private
final
long
f
ileDescriptor
Offset
;
private
final
long
f
ileDescriptor
Length
;
private
MediaExtractor
extractor
;
private
TrackInfo
[]
trackInfos
;
...
...
@@ -60,25 +62,26 @@ public final class FrameworkSampleSource implements SampleSource {
public
FrameworkSampleSource
(
Context
context
,
Uri
uri
,
Map
<
String
,
String
>
headers
,
int
downstreamRendererCount
)
{
Assertions
.
checkState
(
Util
.
SDK_INT
>=
16
);
this
.
remainingReleaseCount
=
downstreamRendererCount
;
this
.
context
=
context
;
this
.
uri
=
uri
;
this
.
headers
=
headers
;
this
.
remainingReleaseCount
=
downstreamRendererCount
;
this
.
fileDescriptor
=
null
;
this
.
f
d
Offset
=
0
;
this
.
f
d
Length
=
0
;
this
.
f
ileDescriptor
Offset
=
0
;
this
.
f
ileDescriptor
Length
=
0
;
}
public
FrameworkSampleSource
(
FileDescriptor
fileDescriptor
,
long
offset
,
long
length
,
int
downstreamRendererCount
)
{
Assertions
.
checkState
(
Util
.
SDK_INT
>=
16
);
this
.
fileDescriptor
=
fileDescriptor
;
this
.
fdOffset
=
offset
;
this
.
fdLength
=
length
;
this
.
remainingReleaseCount
=
downstreamRendererCount
;
this
.
fileDescriptor
=
fileDescriptor
;
this
.
fileDescriptorOffset
=
offset
;
this
.
fileDescriptorLength
=
length
;
this
.
context
=
null
;
this
.
uri
=
null
;
this
.
headers
=
null
;
...
...
@@ -88,12 +91,12 @@ public final class FrameworkSampleSource implements SampleSource {
public
boolean
prepare
()
throws
IOException
{
if
(!
prepared
)
{
extractor
=
new
MediaExtractor
();
if
(
context
!=
null
)
extractor
.
setDataSource
(
context
,
uri
,
headers
);
else
extractor
.
setDataSource
(
fileDescriptor
,
f
dOffset
,
fd
Length
);
extractor
.
setDataSource
(
fileDescriptor
,
f
ileDescriptorOffset
,
fileDescriptor
Length
);
trackStates
=
new
int
[
extractor
.
getTrackCount
()];
pendingDiscontinuities
=
new
boolean
[
trackStates
.
length
];
trackInfos
=
new
TrackInfo
[
trackStates
.
length
];
...
...
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