mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Remove usages of deprecated CacheDataSourceFactory
PiperOrigin-RevId: 307684243
This commit is contained in:
parent
4abaaf138c
commit
6f2891e5c4
2 changed files with 5 additions and 8 deletions
|
|
@ -52,7 +52,7 @@ public final class CacheDataSourceFactory implements DataSource.Factory {
|
||||||
cache,
|
cache,
|
||||||
upstreamFactory,
|
upstreamFactory,
|
||||||
new FileDataSource.Factory(),
|
new FileDataSource.Factory(),
|
||||||
new CacheDataSinkFactory(cache, CacheDataSink.DEFAULT_FRAGMENT_SIZE),
|
new CacheDataSink.Factory().setCache(cache),
|
||||||
flags,
|
flags,
|
||||||
/* eventListener= */ null);
|
/* eventListener= */ null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,9 @@ import com.google.android.exoplayer2.source.dash.manifest.DashManifest;
|
||||||
import com.google.android.exoplayer2.source.dash.manifest.Representation;
|
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.DefaultHttpDataSourceFactory;
|
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
|
||||||
import com.google.android.exoplayer2.upstream.DummyDataSource;
|
|
||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
|
|
||||||
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;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
|
@ -56,8 +55,8 @@ public final class DashDownloadTest {
|
||||||
private DashTestRunner testRunner;
|
private DashTestRunner testRunner;
|
||||||
private File tempFolder;
|
private File tempFolder;
|
||||||
private SimpleCache cache;
|
private SimpleCache cache;
|
||||||
private DefaultHttpDataSourceFactory httpDataSourceFactory;
|
private DataSource.Factory httpDataSourceFactory;
|
||||||
private CacheDataSourceFactory offlineDataSourceFactory;
|
private DataSource.Factory offlineDataSourceFactory;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
|
@ -71,9 +70,7 @@ public final class DashDownloadTest {
|
||||||
tempFolder = Util.createTempDirectory(testRule.getActivity(), "ExoPlayerTest");
|
tempFolder = Util.createTempDirectory(testRule.getActivity(), "ExoPlayerTest");
|
||||||
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
|
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
|
||||||
httpDataSourceFactory = new DefaultHttpDataSourceFactory("ExoPlayer", null);
|
httpDataSourceFactory = new DefaultHttpDataSourceFactory("ExoPlayer", null);
|
||||||
offlineDataSourceFactory =
|
offlineDataSourceFactory = new CacheDataSource.Factory().setCache(cache);
|
||||||
new CacheDataSourceFactory(
|
|
||||||
cache, DummyDataSource.FACTORY, CacheDataSource.FLAG_BLOCK_ON_CACHE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue