aboutsummaryrefslogtreecommitdiff
path: root/src/com/android/tv/tuner/exoplayer/buffer/SampleChunk.java
diff options
context:
space:
mode:
authorNick Chalko <nchalko@google.com>2017-10-03 10:16:37 -0700
committerNick Chalko <nchalko@google.com>2017-10-04 13:48:13 +0000
commit6ebde20b03db4c0d57f67acaac11832b610b966b (patch)
treed31e2adc1f9cce4f27ca07d30bee921032e33a3c /src/com/android/tv/tuner/exoplayer/buffer/SampleChunk.java
parentee027a576ddebaf1ae739219be01b0240b15f80c (diff)
downloadTV-6ebde20b03db4c0d57f67acaac11832b610b966b.tar.gz
Sync to match Live Channels 1.15(ncis)oreo-mr1-dev
aka ub-tv-dev at a73a150bb7d0d1ce867ef980c6ac8411899d40ad Bug: 64021596 Change-Id: I7c544fd15e2c58784f8babc31877ad0dfeebb4c0 (cherry picked from commit 633eb826b8c97731dfc5ef12c7bf78a63734275d)
Diffstat (limited to 'src/com/android/tv/tuner/exoplayer/buffer/SampleChunk.java')
-rw-r--r--src/com/android/tv/tuner/exoplayer/buffer/SampleChunk.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/com/android/tv/tuner/exoplayer/buffer/SampleChunk.java b/src/com/android/tv/tuner/exoplayer/buffer/SampleChunk.java
index 552caaef..04b5a071 100644
--- a/src/com/android/tv/tuner/exoplayer/buffer/SampleChunk.java
+++ b/src/com/android/tv/tuner/exoplayer/buffer/SampleChunk.java
@@ -78,7 +78,6 @@ public class SampleChunk {
/**
* A class for SampleChunk creation.
*/
- @VisibleForTesting
public static class SampleChunkCreator {
/**
@@ -151,18 +150,23 @@ public class SampleChunk {
mCurrentOffset = 0;
}
+ private void reset(SampleChunk chunk, long offset) {
+ mChunk = chunk;
+ mCurrentOffset = offset;
+ }
+
/**
* Prepares for read I/O operation from a new SampleChunk.
*
* @param chunk the new SampleChunk to read from
* @throws IOException
*/
- void openRead(SampleChunk chunk) throws IOException {
+ void openRead(SampleChunk chunk, long offset) throws IOException {
if (mChunk != null) {
mChunk.closeRead();
}
chunk.openRead();
- reset(chunk);
+ reset(chunk, offset);
}
/**
@@ -241,6 +245,20 @@ public class SampleChunk {
}
/**
+ * Returns the current SampleChunk for subsequent I/O operation.
+ */
+ SampleChunk getChunk() {
+ return mChunk;
+ }
+
+ /**
+ * Returns the current offset of the current SampleChunk for subsequent I/O operation.
+ */
+ long getOffset() {
+ return mCurrentOffset;
+ }
+
+ /**
* Releases SampleChunk. the SampleChunk will not be used anymore.
*
* @param chunk to release