Search in sources :

Example 6 with NoOpCacheEvictor

use of com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor in project ExoPlayer by google.

the class DashDownloaderTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    tempFolder = Util.createTempDirectory(ApplicationProvider.getApplicationContext(), "ExoPlayerTest");
    cache = new SimpleCache(tempFolder, new NoOpCacheEvictor(), TestUtil.getInMemoryDatabaseProvider());
    progressListener = new ProgressListener();
}
Also used : SimpleCache(com.google.android.exoplayer2.upstream.cache.SimpleCache) NoOpCacheEvictor(com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor) Before(org.junit.Before)

Example 7 with NoOpCacheEvictor

use of com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor in project ExoPlayer by google.

the class HlsDownloaderTest method setUp.

@Before
public void setUp() throws Exception {
    tempFolder = Util.createTempDirectory(ApplicationProvider.getApplicationContext(), "ExoPlayerTest");
    cache = new SimpleCache(tempFolder, new NoOpCacheEvictor(), TestUtil.getInMemoryDatabaseProvider());
    progressListener = new ProgressListener();
    fakeDataSet = new FakeDataSet().setData(MULTIVARIANT_PLAYLIST_URI, MULTIVARIANT_PLAYLIST_DATA).setData(MEDIA_PLAYLIST_1_URI, MEDIA_PLAYLIST_DATA).setRandomData(MEDIA_PLAYLIST_1_DIR + "fileSequence0.ts", 10).setRandomData(MEDIA_PLAYLIST_1_DIR + "fileSequence1.ts", 11).setRandomData(MEDIA_PLAYLIST_1_DIR + "fileSequence2.ts", 12).setData(MEDIA_PLAYLIST_2_URI, MEDIA_PLAYLIST_DATA).setRandomData(MEDIA_PLAYLIST_2_DIR + "fileSequence0.ts", 13).setRandomData(MEDIA_PLAYLIST_2_DIR + "fileSequence1.ts", 14).setRandomData(MEDIA_PLAYLIST_2_DIR + "fileSequence2.ts", 15);
}
Also used : SimpleCache(com.google.android.exoplayer2.upstream.cache.SimpleCache) NoOpCacheEvictor(com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor) FakeDataSet(com.google.android.exoplayer2.testutil.FakeDataSet) Before(org.junit.Before)

Example 8 with NoOpCacheEvictor

use of com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor in project ExoPlayer by google.

the class DownloadManagerDashTest method setUp.

@Before
public void setUp() throws Exception {
    ShadowLog.stream = System.out;
    testThread = new DummyMainThread();
    Context context = ApplicationProvider.getApplicationContext();
    tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
    File cacheFolder = new File(tempFolder, "cache");
    cacheFolder.mkdir();
    cache = new SimpleCache(cacheFolder, new NoOpCacheEvictor(), TestUtil.getInMemoryDatabaseProvider());
    MockitoAnnotations.initMocks(this);
    fakeDataSet = new FakeDataSet().setData(TEST_MPD_URI, TEST_MPD).setRandomData("audio_init_data", 10).setRandomData("audio_segment_1", 4).setRandomData("audio_segment_2", 5).setRandomData("audio_segment_3", 6).setRandomData("text_segment_1", 1).setRandomData("text_segment_2", 2).setRandomData("text_segment_3", 3);
    fakeStreamKey1 = new StreamKey(0, 0, 0);
    fakeStreamKey2 = new StreamKey(0, 1, 0);
    downloadIndex = new DefaultDownloadIndex(TestUtil.getInMemoryDatabaseProvider());
    createDownloadManager();
}
Also used : Context(android.content.Context) DefaultDownloadIndex(com.google.android.exoplayer2.offline.DefaultDownloadIndex) SimpleCache(com.google.android.exoplayer2.upstream.cache.SimpleCache) DummyMainThread(com.google.android.exoplayer2.testutil.DummyMainThread) NoOpCacheEvictor(com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor) FakeDataSet(com.google.android.exoplayer2.testutil.FakeDataSet) File(java.io.File) StreamKey(com.google.android.exoplayer2.offline.StreamKey) Before(org.junit.Before)

Example 9 with NoOpCacheEvictor

use of com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor in project ExoPlayer by google.

the class CacheDataSourceContractTest method createDataSource.

@Override
protected DataSource createDataSource() throws IOException {
    File tempFolder = Util.createTempDirectory(ApplicationProvider.getApplicationContext(), "ExoPlayerTest");
    SimpleCache cache = new SimpleCache(tempFolder, new NoOpCacheEvictor(), TestUtil.getInMemoryDatabaseProvider());
    upstreamDataSource = new FakeDataSource(fakeDataSet);
    return new CacheDataSource(cache, upstreamDataSource);
}
Also used : FakeDataSource(com.google.android.exoplayer2.testutil.FakeDataSource) File(java.io.File)

Example 10 with NoOpCacheEvictor

use of com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor in project ExoPlayer by google.

the class DashDownloadTest method setUp.

@Before
public void setUp() throws Exception {
    testRunner = new DashTestRunner(TAG, testRule.getActivity()).setManifestUrl(DashTestData.H264_MANIFEST).setFullPlaybackNoSeeking(true).setCanIncludeAdditionalVideoFormats(false).setAudioVideoFormats(DashTestData.AAC_AUDIO_REPRESENTATION_ID, DashTestData.H264_CDD_FIXED);
    tempFolder = Util.createTempDirectory(testRule.getActivity(), "ExoPlayerTest");
    cache = new SimpleCache(tempFolder, new NoOpCacheEvictor(), new StandaloneDatabaseProvider(testRule.getActivity()));
    httpDataSourceFactory = new DefaultHttpDataSource.Factory();
    offlineDataSourceFactory = new CacheDataSource.Factory().setCache(cache);
}
Also used : SimpleCache(com.google.android.exoplayer2.upstream.cache.SimpleCache) NoOpCacheEvictor(com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor) StandaloneDatabaseProvider(com.google.android.exoplayer2.database.StandaloneDatabaseProvider) DefaultHttpDataSource(com.google.android.exoplayer2.upstream.DefaultHttpDataSource) Before(org.junit.Before)

Aggregations

NoOpCacheEvictor (com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor)7 SimpleCache (com.google.android.exoplayer2.upstream.cache.SimpleCache)7 Before (org.junit.Before)7 FakeDataSource (com.google.android.exoplayer2.testutil.FakeDataSource)4 File (java.io.File)4 FakeDataSet (com.google.android.exoplayer2.testutil.FakeDataSet)3 DefaultDownloadIndex (com.google.android.exoplayer2.offline.DefaultDownloadIndex)2 StreamKey (com.google.android.exoplayer2.offline.StreamKey)2 DummyMainThread (com.google.android.exoplayer2.testutil.DummyMainThread)2 DataSource (com.google.android.exoplayer2.upstream.DataSource)2 Notification (android.app.Notification)1 Context (android.content.Context)1 Nullable (androidx.annotation.Nullable)1 DatabaseProvider (com.google.android.exoplayer2.database.DatabaseProvider)1 StandaloneDatabaseProvider (com.google.android.exoplayer2.database.StandaloneDatabaseProvider)1 DefaultDownloaderFactory (com.google.android.exoplayer2.offline.DefaultDownloaderFactory)1 Download (com.google.android.exoplayer2.offline.Download)1 DownloadManager (com.google.android.exoplayer2.offline.DownloadManager)1 DownloadService (com.google.android.exoplayer2.offline.DownloadService)1 TestDownloadManagerListener (com.google.android.exoplayer2.robolectric.TestDownloadManagerListener)1