summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-04-25 15:57:43 -0700
committerAndreas Huber <andih@google.com>2012-04-26 10:43:31 -0700
commitf2855b3df5994e165b29025c4c49d8e7d634c034 (patch)
treef9350506e0775e657e79319c744072087831d7a8 /media/java
parent9b593a67f1e93896af4ef1050e485fb84bd5dd4f (diff)
downloadframeworks_base-f2855b3df5994e165b29025c4c49d8e7d634c034.zip
frameworks_base-f2855b3df5994e165b29025c4c49d8e7d634c034.tar.gz
frameworks_base-f2855b3df5994e165b29025c4c49d8e7d634c034.tar.bz2
The MediaExtractor can now unselect tracks and has more control over seeking.
Change-Id: I12c28bf31fe9fb4057352999fa38213ae289a417 related-to-bug: 6276111
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/MediaExtractor.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/media/java/android/media/MediaExtractor.java b/media/java/android/media/MediaExtractor.java
index 9fdb81f..5fe58a8 100644
--- a/media/java/android/media/MediaExtractor.java
+++ b/media/java/android/media/MediaExtractor.java
@@ -191,17 +191,33 @@ final public class MediaExtractor {
/** Subsequent calls to {@link #readSampleData}, {@link #getSampleTrackIndex} and
* {@link #getSampleTime} only retrieve information for the subset of tracks
- * selected by the call below.
- * Selecting the same track multiple times has no effect, the track
+ * selected.
+ * Selecting the same track multiple times has no effect, the track is
* only selected once.
- * Media data will be returned in the order of their timestamps.
*/
public native void selectTrack(int index);
- /** All selected tracks seek near the requested time. The next sample
- * returned for each selected track will be a sync sample.
+ /** Subsequent calls to {@link #readSampleData}, {@link #getSampleTrackIndex} and
+ * {@link #getSampleTime} only retrieve information for the subset of tracks
+ * selected.
*/
- public native void seekTo(long timeUs);
+ public native void unselectTrack(int index);
+
+ /** If possible, seek to a sync sample at or before the specified time */
+ public static final int SEEK_TO_PREVIOUS_SYNC = 0;
+ /** If possible, seek to a sync sample at or after the specified time */
+ public static final int SEEK_TO_NEXT_SYNC = 1;
+ /** If possible, seek to the sync sample closest to the specified time */
+ public static final int SEEK_TO_CLOSEST_SYNC = 2;
+ /** If possible, seek to a sample closest to the specified time, which may
+ * NOT be a sync sample!
+ */
+ public static final int SEEK_TO_CLOSEST = 3;
+
+ /** All selected tracks seek near the requested time according to the
+ * specified mode.
+ */
+ public native void seekTo(long timeUs, int mode);
/** Advance to the next sample. Returns false if no more sample data
* is available (end of stream).