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
7acc0ee7
authored
Mar 11, 2019
by
andrewlewis
Committed by
Oliver Woodman
Mar 15, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix ProgressiveMediaSource DefaultExtractorsFactory proguarding
PiperOrigin-RevId: 237900673
parent
7bf963c0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
11 deletions
RELEASENOTES.md
extensions/flac/src/androidTest/java/com/google/android/exoplayer2/ext/flac/FlacPlaybackTest.java
extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java
extensions/vp9/src/androidTest/java/com/google/android/exoplayer2/ext/vp9/VpxPlaybackTest.java
library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java
RELEASENOTES.md
View file @
7acc0ee7
...
...
@@ -70,6 +70,11 @@
*
Update
`DefaultTimeBar`
based on duration of media and add parameter to set
the minimum update interval to control the smoothness of the updates
(
[
#5040
](
https://github.com/google/ExoPlayer/issues/5040
)
).
*
Fix issue where using
`ProgressiveMediaSource.Factory`
would mean that
`DefaultExtractorsFactory`
would be kept by proguard. Custom
`ExtractorsFactory`
instances must now be passed via the
`ProgressiveMediaSource.Factory`
constructor, and
`setExtractorsFactory`
is
deprecated.
### 2.9.6 ###
...
...
extensions/flac/src/androidTest/java/com/google/android/exoplayer2/ext/flac/FlacPlaybackTest.java
View file @
7acc0ee7
...
...
@@ -87,8 +87,8 @@ public class FlacPlaybackTest {
player
.
addListener
(
this
);
MediaSource
mediaSource
=
new
ProgressiveMediaSource
.
Factory
(
new
DefaultDataSourceFactory
(
context
,
"ExoPlayerExtFlacTest"
)
)
.
setExtractorsFactory
(
MatroskaExtractor
.
FACTORY
)
new
DefaultDataSourceFactory
(
context
,
"ExoPlayerExtFlacTest"
)
,
MatroskaExtractor
.
FACTORY
)
.
createMediaSource
(
uri
);
player
.
prepare
(
mediaSource
);
player
.
setPlayWhenReady
(
true
);
...
...
extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java
View file @
7acc0ee7
...
...
@@ -87,8 +87,8 @@ public class OpusPlaybackTest {
player
.
addListener
(
this
);
MediaSource
mediaSource
=
new
ProgressiveMediaSource
.
Factory
(
new
DefaultDataSourceFactory
(
context
,
"ExoPlayerExtOpusTest"
)
)
.
setExtractorsFactory
(
MatroskaExtractor
.
FACTORY
)
new
DefaultDataSourceFactory
(
context
,
"ExoPlayerExtOpusTest"
)
,
MatroskaExtractor
.
FACTORY
)
.
createMediaSource
(
uri
);
player
.
prepare
(
mediaSource
);
player
.
setPlayWhenReady
(
true
);
...
...
extensions/vp9/src/androidTest/java/com/google/android/exoplayer2/ext/vp9/VpxPlaybackTest.java
View file @
7acc0ee7
...
...
@@ -120,8 +120,8 @@ public class VpxPlaybackTest {
player
.
addListener
(
this
);
MediaSource
mediaSource
=
new
ProgressiveMediaSource
.
Factory
(
new
DefaultDataSourceFactory
(
context
,
"ExoPlayerExtVp9Test"
)
)
.
setExtractorsFactory
(
MatroskaExtractor
.
FACTORY
)
new
DefaultDataSourceFactory
(
context
,
"ExoPlayerExtVp9Test"
)
,
MatroskaExtractor
.
FACTORY
)
.
createMediaSource
(
uri
);
player
.
createMessage
(
videoRenderer
)
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java
View file @
7acc0ee7
...
...
@@ -49,7 +49,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource
private
final
DataSource
.
Factory
dataSourceFactory
;
@Nullable
private
ExtractorsFactory
extractorsFactory
;
private
ExtractorsFactory
extractorsFactory
;
@Nullable
private
String
customCacheKey
;
@Nullable
private
Object
tag
;
private
LoadErrorHandlingPolicy
loadErrorHandlingPolicy
;
...
...
@@ -57,12 +57,24 @@ public final class ProgressiveMediaSource extends BaseMediaSource
private
boolean
isCreateCalled
;
/**
* Creates a new factory for {@link ProgressiveMediaSource}s.
* Creates a new factory for {@link ProgressiveMediaSource}s, using the extractors provided by
* {@link DefaultExtractorsFactory}.
*
* @param dataSourceFactory A factory for {@link DataSource}s to read the media.
*/
public
Factory
(
DataSource
.
Factory
dataSourceFactory
)
{
this
(
dataSourceFactory
,
new
DefaultExtractorsFactory
());
}
/**
* Creates a new factory for {@link ProgressiveMediaSource}s.
*
* @param dataSourceFactory A factory for {@link DataSource}s to read the media.
* @param extractorsFactory A factory for extractors used to extract media from its container.
*/
public
Factory
(
DataSource
.
Factory
dataSourceFactory
,
ExtractorsFactory
extractorsFactory
)
{
this
.
dataSourceFactory
=
dataSourceFactory
;
this
.
extractorsFactory
=
extractorsFactory
;
loadErrorHandlingPolicy
=
new
DefaultLoadErrorHandlingPolicy
();
continueLoadingCheckIntervalBytes
=
DEFAULT_LOADING_CHECK_INTERVAL_BYTES
;
}
...
...
@@ -76,7 +88,11 @@ public final class ProgressiveMediaSource extends BaseMediaSource
* formats.
* @return This factory, for convenience.
* @throws IllegalStateException If one of the {@code create} methods has already been called.
* @deprecated Pass the {@link ExtractorsFactory} via {@link #Factory(DataSource.Factory,
* ExtractorsFactory)}. This is necessary so that proguard can treat the default extractors
* factory as unused.
*/
@Deprecated
public
Factory
setExtractorsFactory
(
ExtractorsFactory
extractorsFactory
)
{
Assertions
.
checkState
(!
isCreateCalled
);
this
.
extractorsFactory
=
extractorsFactory
;
...
...
@@ -153,9 +169,6 @@ public final class ProgressiveMediaSource extends BaseMediaSource
@Override
public
ProgressiveMediaSource
createMediaSource
(
Uri
uri
)
{
isCreateCalled
=
true
;
if
(
extractorsFactory
==
null
)
{
extractorsFactory
=
new
DefaultExtractorsFactory
();
}
return
new
ProgressiveMediaSource
(
uri
,
dataSourceFactory
,
...
...
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