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
b627d700
authored
Aug 10, 2021
by
olly
Committed by
Christos Tsilopoulos
Aug 10, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Migrate uses of deprecated DataSource factories
PiperOrigin-RevId: 389844289
parent
937bc008
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
14 deletions
library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManagerProvider.java
library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceFactory.java
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/offline/DashDownloader.java
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/offline/HlsDownloader.java
library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/offline/SsDownloader.java
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashDownloadTest.java
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashWidevineOfflineTest.java
library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManagerProvider.java
View file @
b627d700
...
@@ -23,7 +23,6 @@ import androidx.annotation.Nullable;
...
@@ -23,7 +23,6 @@ import androidx.annotation.Nullable;
import
androidx.annotation.RequiresApi
;
import
androidx.annotation.RequiresApi
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSource
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSource
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory
;
import
com.google.android.exoplayer2.upstream.HttpDataSource
;
import
com.google.android.exoplayer2.upstream.HttpDataSource
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.common.primitives.Ints
;
import
com.google.common.primitives.Ints
;
...
@@ -51,10 +50,10 @@ public final class DefaultDrmSessionManagerProvider implements DrmSessionManager
...
@@ -51,10 +50,10 @@ public final class DefaultDrmSessionManagerProvider implements DrmSessionManager
/**
/**
* Sets the {@link HttpDataSource.Factory} to be used for creating {@link HttpMediaDrmCallback
* Sets the {@link HttpDataSource.Factory} to be used for creating {@link HttpMediaDrmCallback
* HttpMediaDrmCallbacks} which executes key and provisioning requests over HTTP. If {@code null}
* HttpMediaDrmCallbacks} which executes key and provisioning requests over HTTP. If {@code null}
* is passed the {@link DefaultHttpDataSourceFactory} is used.
* is passed the {@link DefaultHttpDataSource
.
Factory} is used.
*
*
* @param drmHttpDataSourceFactory The HTTP data source factory or {@code null} to use {@link
* @param drmHttpDataSourceFactory The HTTP data source factory or {@code null} to use {@link
* DefaultHttpDataSourceFactory}.
* DefaultHttpDataSource
.
Factory}.
*/
*/
public
void
setDrmHttpDataSourceFactory
(
public
void
setDrmHttpDataSourceFactory
(
@Nullable
HttpDataSource
.
Factory
drmHttpDataSourceFactory
)
{
@Nullable
HttpDataSource
.
Factory
drmHttpDataSourceFactory
)
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceFactory.java
View file @
b627d700
...
@@ -25,7 +25,7 @@ import com.google.android.exoplayer2.drm.DrmSessionManager;
...
@@ -25,7 +25,7 @@ import com.google.android.exoplayer2.drm.DrmSessionManager;
import
com.google.android.exoplayer2.drm.DrmSessionManagerProvider
;
import
com.google.android.exoplayer2.drm.DrmSessionManagerProvider
;
import
com.google.android.exoplayer2.drm.HttpMediaDrmCallback
;
import
com.google.android.exoplayer2.drm.HttpMediaDrmCallback
;
import
com.google.android.exoplayer2.offline.StreamKey
;
import
com.google.android.exoplayer2.offline.StreamKey
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSource
Factory
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSource
;
import
com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy
;
import
com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy
;
import
com.google.android.exoplayer2.upstream.HttpDataSource
;
import
com.google.android.exoplayer2.upstream.HttpDataSource
;
import
com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy
;
import
com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy
;
...
@@ -83,7 +83,7 @@ public interface MediaSourceFactory {
...
@@ -83,7 +83,7 @@ public interface MediaSourceFactory {
* #setDrmSessionManager(DrmSessionManager) concrete DrmSessionManager} are provided.
* #setDrmSessionManager(DrmSessionManager) concrete DrmSessionManager} are provided.
*
*
* @param drmHttpDataSourceFactory The HTTP data source factory, or {@code null} to use {@link
* @param drmHttpDataSourceFactory The HTTP data source factory, or {@code null} to use {@link
* DefaultHttpDataSourceFactory}.
* DefaultHttpDataSource
.
Factory}.
* @return This factory, for convenience.
* @return This factory, for convenience.
* @deprecated Use {@link #setDrmSessionManagerProvider(DrmSessionManagerProvider)} and pass an
* @deprecated Use {@link #setDrmSessionManagerProvider(DrmSessionManagerProvider)} and pass an
* implementation that configures the returned {@link DrmSessionManager} with the desired
* implementation that configures the returned {@link DrmSessionManager} with the desired
...
...
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/offline/DashDownloader.java
View file @
b627d700
...
@@ -51,7 +51,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
...
@@ -51,7 +51,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
* CacheDataSource.Factory cacheDataSourceFactory =
* CacheDataSource.Factory cacheDataSourceFactory =
* new CacheDataSource.Factory()
* new CacheDataSource.Factory()
* .setCache(cache)
* .setCache(cache)
* .setUpstreamDataSourceFactory(new DefaultHttpDataSource
Factory(userAgent
));
* .setUpstreamDataSourceFactory(new DefaultHttpDataSource
.Factory(
));
* // Create a downloader for the first representation of the first adaptation set of the first
* // Create a downloader for the first representation of the first adaptation set of the first
* // period.
* // period.
* DashDownloader dashDownloader =
* DashDownloader dashDownloader =
...
...
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/offline/HlsDownloader.java
View file @
b627d700
...
@@ -44,7 +44,7 @@ import java.util.concurrent.Executor;
...
@@ -44,7 +44,7 @@ import java.util.concurrent.Executor;
* CacheDataSource.Factory cacheDataSourceFactory =
* CacheDataSource.Factory cacheDataSourceFactory =
* new CacheDataSource.Factory()
* new CacheDataSource.Factory()
* .setCache(cache)
* .setCache(cache)
* .setUpstreamDataSourceFactory(new DefaultHttpDataSource
Factory(userAgent
));
* .setUpstreamDataSourceFactory(new DefaultHttpDataSource
.Factory(
));
* // Create a downloader for the first variant in a master playlist.
* // Create a downloader for the first variant in a master playlist.
* HlsDownloader hlsDownloader =
* HlsDownloader hlsDownloader =
* new HlsDownloader(
* new HlsDownloader(
...
...
library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/offline/SsDownloader.java
View file @
b627d700
...
@@ -41,7 +41,7 @@ import java.util.concurrent.Executor;
...
@@ -41,7 +41,7 @@ import java.util.concurrent.Executor;
* CacheDataSource.Factory cacheDataSourceFactory =
* CacheDataSource.Factory cacheDataSourceFactory =
* new CacheDataSource.Factory()
* new CacheDataSource.Factory()
* .setCache(cache)
* .setCache(cache)
* .setUpstreamDataSourceFactory(new DefaultHttpDataSource
Factory(userAgent
));
* .setUpstreamDataSourceFactory(new DefaultHttpDataSource
.Factory(
));
* // Create a downloader for the first track of the first stream element.
* // Create a downloader for the first track of the first stream element.
* SsDownloader ssDownloader =
* SsDownloader ssDownloader =
* new SsDownloader(
* new SsDownloader(
...
...
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashDownloadTest.java
View file @
b627d700
...
@@ -30,7 +30,7 @@ import com.google.android.exoplayer2.source.dash.manifest.Representation;
...
@@ -30,7 +30,7 @@ import com.google.android.exoplayer2.source.dash.manifest.Representation;
import
com.google.android.exoplayer2.source.dash.offline.DashDownloader
;
import
com.google.android.exoplayer2.source.dash.offline.DashDownloader
;
import
com.google.android.exoplayer2.testutil.HostActivity
;
import
com.google.android.exoplayer2.testutil.HostActivity
;
import
com.google.android.exoplayer2.upstream.DataSource
;
import
com.google.android.exoplayer2.upstream.DataSource
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSource
Factory
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSource
;
import
com.google.android.exoplayer2.upstream.cache.CacheDataSource
;
import
com.google.android.exoplayer2.upstream.cache.CacheDataSource
;
import
com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor
;
import
com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor
;
import
com.google.android.exoplayer2.upstream.cache.SimpleCache
;
import
com.google.android.exoplayer2.upstream.cache.SimpleCache
;
...
@@ -73,7 +73,7 @@ public final class DashDownloadTest {
...
@@ -73,7 +73,7 @@ public final class DashDownloadTest {
cache
=
cache
=
new
SimpleCache
(
new
SimpleCache
(
tempFolder
,
new
NoOpCacheEvictor
(),
new
ExoDatabaseProvider
(
testRule
.
getActivity
()));
tempFolder
,
new
NoOpCacheEvictor
(),
new
ExoDatabaseProvider
(
testRule
.
getActivity
()));
httpDataSourceFactory
=
new
DefaultHttpDataSource
Factory
(
"ExoPlayer"
,
null
);
httpDataSourceFactory
=
new
DefaultHttpDataSource
.
Factory
(
);
offlineDataSourceFactory
=
new
CacheDataSource
.
Factory
().
setCache
(
cache
);
offlineDataSourceFactory
=
new
CacheDataSource
.
Factory
().
setCache
(
cache
);
}
}
...
...
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashWidevineOfflineTest.java
View file @
b627d700
...
@@ -35,7 +35,7 @@ import com.google.android.exoplayer2.source.dash.manifest.DashManifest;
...
@@ -35,7 +35,7 @@ import com.google.android.exoplayer2.source.dash.manifest.DashManifest;
import
com.google.android.exoplayer2.testutil.ActionSchedule
;
import
com.google.android.exoplayer2.testutil.ActionSchedule
;
import
com.google.android.exoplayer2.testutil.HostActivity
;
import
com.google.android.exoplayer2.testutil.HostActivity
;
import
com.google.android.exoplayer2.upstream.DataSource
;
import
com.google.android.exoplayer2.upstream.DataSource
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSource
Factory
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSource
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -51,10 +51,9 @@ import org.junit.runner.RunWith;
...
@@ -51,10 +51,9 @@ import org.junit.runner.RunWith;
public
final
class
DashWidevineOfflineTest
{
public
final
class
DashWidevineOfflineTest
{
private
static
final
String
TAG
=
"DashWidevineOfflineTest"
;
private
static
final
String
TAG
=
"DashWidevineOfflineTest"
;
private
static
final
String
USER_AGENT
=
"ExoPlayerPlaybackTests"
;
private
DashTestRunner
testRunner
;
private
DashTestRunner
testRunner
;
private
DefaultHttpDataSourceFactory
httpDataSourceFactory
;
private
DefaultHttpDataSource
.
Factory
httpDataSourceFactory
;
private
OfflineLicenseHelper
offlineLicenseHelper
;
private
OfflineLicenseHelper
offlineLicenseHelper
;
private
byte
[]
offlineLicenseKeySetId
;
private
byte
[]
offlineLicenseKeySetId
;
...
@@ -75,7 +74,7 @@ public final class DashWidevineOfflineTest {
...
@@ -75,7 +74,7 @@ public final class DashWidevineOfflineTest {
boolean
useL1Widevine
=
DashTestRunner
.
isL1WidevineAvailable
(
MimeTypes
.
VIDEO_H264
);
boolean
useL1Widevine
=
DashTestRunner
.
isL1WidevineAvailable
(
MimeTypes
.
VIDEO_H264
);
String
widevineLicenseUrl
=
DashTestData
.
getWidevineLicenseUrl
(
true
,
useL1Widevine
);
String
widevineLicenseUrl
=
DashTestData
.
getWidevineLicenseUrl
(
true
,
useL1Widevine
);
httpDataSourceFactory
=
new
DefaultHttpDataSource
Factory
(
USER_AGENT
);
httpDataSourceFactory
=
new
DefaultHttpDataSource
.
Factory
(
);
if
(
Util
.
SDK_INT
>=
18
)
{
if
(
Util
.
SDK_INT
>=
18
)
{
offlineLicenseHelper
=
offlineLicenseHelper
=
OfflineLicenseHelper
.
newWidevineInstance
(
OfflineLicenseHelper
.
newWidevineInstance
(
...
...
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