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
a4c10058
authored
Oct 18, 2021
by
olly
Committed by
Oliver Woodman
Oct 18, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Move CachedRegionTracker to upstream root
PiperOrigin-RevId: 403914807
parent
18cf01cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
RELEASENOTES.md
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CachedRegionTracker.java → library/core/src/main/java/com/google/android/exoplayer2/upstream/CachedRegionTracker.java
library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/CachedRegionTrackerTest.java → library/core/src/test/java/com/google/android/exoplayer2/upstream/CachedRegionTrackerTest.java
RELEASENOTES.md
View file @
a4c10058
...
...
@@ -14,6 +14,8 @@
`com.google.android.exoplayer2.DeviceInfo`
.
*
Move
`com.google.android.exoplayer2.drm.DecryptionException`
to
`com.google.android.exoplayer2.decoder.CryptoException`
.
*
Move
`com.google.android.exoplayer2.upstream.cache.CachedRegionTracker`
to
`com.google.android.exoplayer2.upstream.CachedRegionTracker`
.
*
Make
`ExoPlayer.Builder`
return a
`SimpleExoPlayer`
instance.
*
Deprecate
`SimpleExoPlayer.Builder`
. Use
`ExoPlayer.Builder`
instead.
*
Remove
`ExoPlayerLibraryInfo.GL_ASSERTIONS_ENABLED`
. Use
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/
cache/
CachedRegionTracker.java
→
library/core/src/main/java/com/google/android/exoplayer2/upstream/CachedRegionTracker.java
View file @
a4c10058
...
...
@@ -13,10 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
upstream
.
cache
;
package
com
.
google
.
android
.
exoplayer2
.
upstream
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.extractor.ChunkIndex
;
import
com.google.android.exoplayer2.upstream.cache.Cache
;
import
com.google.android.exoplayer2.upstream.cache.CacheSpan
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.Util
;
import
java.util.Arrays
;
...
...
library/core/src/test/java/com/google/android/exoplayer2/upstream/
cache/
CachedRegionTrackerTest.java
→
library/core/src/test/java/com/google/android/exoplayer2/upstream/CachedRegionTrackerTest.java
View file @
a4c10058
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
upstream
.
cache
;
package
com
.
google
.
android
.
exoplayer2
.
upstream
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
...
...
@@ -23,7 +23,8 @@ import static org.mockito.Mockito.when;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.extractor.ChunkIndex
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.android.exoplayer2.upstream.cache.Cache
;
import
com.google.android.exoplayer2.upstream.cache.CacheSpan
;
import
com.google.android.exoplayer2.util.Util
;
import
java.io.File
;
import
java.io.FileOutputStream
;
...
...
@@ -56,7 +57,6 @@ public final class CachedRegionTrackerTest {
@Mock
private
Cache
cache
;
private
CachedRegionTracker
tracker
;
private
CachedContentIndex
index
;
private
File
cacheDir
;
@Before
...
...
@@ -66,7 +66,6 @@ public final class CachedRegionTrackerTest {
tracker
=
new
CachedRegionTracker
(
cache
,
CACHE_KEY
,
CHUNK_INDEX
);
cacheDir
=
Util
.
createTempDirectory
(
ApplicationProvider
.
getApplicationContext
(),
"ExoPlayerTest"
);
index
=
new
CachedContentIndex
(
TestUtil
.
getInMemoryDatabaseProvider
());
}
@After
...
...
@@ -128,14 +127,13 @@ public final class CachedRegionTrackerTest {
}
private
CacheSpan
newCacheSpan
(
int
position
,
int
length
)
throws
IOException
{
int
id
=
index
.
assignIdForKey
(
CACHE_KEY
);
File
cacheFile
=
createCacheSpanFile
(
cacheDir
,
id
,
position
,
length
,
0
);
return
SimpleCacheSpan
.
createCacheEntry
(
cacheFile
,
length
,
index
);
File
cacheFile
=
createCacheSpanFile
(
cacheDir
,
position
,
length
);
return
new
CacheSpan
(
CACHE_KEY
,
position
,
length
,
/* lastTouchTimestamp= */
0
,
cacheFile
);
}
public
static
File
createCacheSpanFile
(
File
cacheDir
,
int
id
,
long
offset
,
int
length
,
long
lastTouchTimestamp
)
throws
IOException
{
File
cacheFile
=
SimpleCacheSpan
.
getCacheFile
(
cacheDir
,
id
,
offset
,
lastTouchTimestamp
);
public
static
File
createCacheSpanFile
(
File
cacheDir
,
long
position
,
int
length
)
throws
IOException
{
File
cacheFile
=
new
File
(
cacheDir
,
"test."
+
position
);
createTestFile
(
cacheFile
,
length
);
return
cacheFile
;
}
...
...
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