docs/doc/reference/com/google/android/exoplayer2/extractor/BinarySearchSeeker.html
Package com.google.android.exoplayer2.extractor
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classBinarySearchSeekerextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
A seeker that supports seeking within a stream by searching for the target frame using binary search.
This seeker operates on a stream that contains multiple frames (or samples). Each frame is associated with some kind of timestamps, such as stream time, or frame indices. Given a target seek time, the seeker will find the corresponding target timestamp, and perform a search operation within the stream to identify the target frame and return the byte position in the stream of the target frame.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | BinarySearchSeeker.BinarySearchSeekMap |
Deprecated.
A SeekMap implementation that returns the estimated byte location from BinarySearchSeeker.SeekOperationParams.calculateNextSearchBytePosition(long, long, long, long, long, long) for each BinarySearchSeeker.BinarySearchSeekMap.getSeekPoints(long) query.
|
| static class | BinarySearchSeeker.DefaultSeekTimestampConverter |
Deprecated.
A BinarySearchSeeker.SeekTimestampConverter implementation that returns the seek time itself as the timestamp for a seek time position.
|
| protected static class | BinarySearchSeeker.SeekOperationParams |
Deprecated.
Contains parameters for a pending seek operation by BinarySearchSeeker.
|
| protected static interface | BinarySearchSeeker.SeekTimestampConverter |
Deprecated.
A converter that converts seek time in stream time into target timestamp for the BinarySearchSeeker.
|
| static class | BinarySearchSeeker.TimestampSearchResult |
Deprecated.
Represents possible search results for BinarySearchSeeker.TimestampSeeker.searchForTimestamp(ExtractorInput, long).
|
| protected static interface | BinarySearchSeeker.TimestampSeeker |
Deprecated.
A seeker that looks for a given timestamp from an input. |
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| protected BinarySearchSeeker.BinarySearchSeekMap | seekMap |
Deprecated.
|
| protected BinarySearchSeeker.SeekOperationParams | seekOperationParams |
Deprecated.
|
| protected BinarySearchSeeker.TimestampSeeker | timestampSeeker |
Deprecated.
|
Constructors | Modifier | Constructor | Description |
| --- | --- | --- |
| protected | BinarySearchSeeker(BinarySearchSeeker.SeekTimestampConverter seekTimestampConverter, BinarySearchSeeker.TimestampSeeker timestampSeeker, long durationUs, long floorTimePosition, long ceilingTimePosition, long floorBytePosition, long ceilingBytePosition, long approxBytesPerFrame, int minimumSearchRange) |
Deprecated.
Constructs an instance. |
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| protected BinarySearchSeeker.SeekOperationParams | createSeekParamsForTargetTimeUs(long timeUs) |
Deprecated.
|
| SeekMap | getSeekMap() |
Deprecated.
Returns the seek map for the stream.
|
| int | handlePendingSeek(ExtractorInput input, PositionHolder seekPositionHolder) |
Deprecated.
Continues to handle the pending seek operation.
|
| boolean | isSeeking() |
Deprecated.
Returns whether the last operation set by setSeekTargetUs(long) is still pending.
|
| protected void | markSeekOperationFinished(boolean foundTargetFrame, long resultPosition) |
Deprecated.
|
| protected void | onSeekOperationFinished(boolean foundTargetFrame, long resultPosition) |
Deprecated.
|
| protected int | seekToPosition(ExtractorInput input, long position, PositionHolder seekPositionHolder) |
Deprecated.
|
| void | setSeekTargetUs(long timeUs) |
Deprecated.
Sets the target time in microseconds within the stream to seek to.
|
| protected boolean | skipInputUntilPosition(ExtractorInput input, long position) |
Deprecated.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
protected final[BinarySearchSeeker.BinarySearchSeekMap](BinarySearchSeeker.BinarySearchSeekMap.html "class in com.google.android.exoplayer2.extractor")seekMap
Deprecated.
-
protected final[BinarySearchSeeker.TimestampSeeker](BinarySearchSeeker.TimestampSeeker.html "interface in com.google.android.exoplayer2.extractor")timestampSeeker
Deprecated.
-
@Nullable
protected[BinarySearchSeeker.SeekOperationParams](BinarySearchSeeker.SeekOperationParams.html "class in com.google.android.exoplayer2.extractor")seekOperationParams
Deprecated.
-
protected BinarySearchSeeker([BinarySearchSeeker.SeekTimestampConverter](BinarySearchSeeker.SeekTimestampConverter.html "interface in com.google.android.exoplayer2.extractor")seekTimestampConverter,[BinarySearchSeeker.TimestampSeeker](BinarySearchSeeker.TimestampSeeker.html "interface in com.google.android.exoplayer2.extractor")timestampSeeker,
long durationUs,
long floorTimePosition,
long ceilingTimePosition,
long floorBytePosition,
long ceilingBytePosition,
long approxBytesPerFrame,
int minimumSearchRange)
Deprecated.
Constructs an instance.
Parameters:seekTimestampConverter - The BinarySearchSeeker.SeekTimestampConverter that converts seek time in stream time into target timestamp.timestampSeeker - A BinarySearchSeeker.TimestampSeeker that will be used to search for timestamps within the stream.durationUs - The duration of the stream in microseconds.floorTimePosition - The minimum timestamp value (inclusive) in the stream.ceilingTimePosition - The minimum timestamp value (exclusive) in the stream.floorBytePosition - The starting position of the frame with minimum timestamp value (inclusive) in the stream.ceilingBytePosition - The position after the frame with maximum timestamp value in the stream.approxBytesPerFrame - Approximated bytes per frame.minimumSearchRange - The minimum byte range that this binary seeker will operate on. If the remaining search range is smaller than this value, the search will stop, and the seeker will return the position at the floor of the range as the result.
-
public final[SeekMap](SeekMap.html "interface in com.google.android.exoplayer2.extractor")getSeekMap()
Deprecated.
Returns the seek map for the stream.
-
public final void setSeekTargetUs(long timeUs)
Deprecated.
Sets the target time in microseconds within the stream to seek to.
Parameters:timeUs - The target time in microseconds within the stream.
-
public final boolean isSeeking()
Deprecated.
Returns whether the last operation set by setSeekTargetUs(long) is still pending.
-
public int handlePendingSeek([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input,[PositionHolder](PositionHolder.html "class in com.google.android.exoplayer2.extractor")seekPositionHolder)
throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")
Deprecated.
Continues to handle the pending seek operation. Returns one of the RESULT_ values from Extractor.
Parameters:input - The ExtractorInput from which data should be read.seekPositionHolder - If Extractor.RESULT_SEEK is returned, this holder is updated to hold the position of the required seek.Returns:One of the RESULT_ values defined in Extractor.Throws:IOException - If an error occurred reading from the input.
-
protected[BinarySearchSeeker.SeekOperationParams](BinarySearchSeeker.SeekOperationParams.html "class in com.google.android.exoplayer2.extractor")createSeekParamsForTargetTimeUs(long timeUs)
Deprecated.
-
protected final void markSeekOperationFinished(boolean foundTargetFrame,
long resultPosition)
Deprecated.
-
protected void onSeekOperationFinished(boolean foundTargetFrame,
long resultPosition)
Deprecated.
-
protected final boolean skipInputUntilPosition([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input,
long position)
throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")
Deprecated.
Throws:IOException
-
protected final int seekToPosition([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input,
long position,[PositionHolder](PositionHolder.html "class in com.google.android.exoplayer2.extractor")seekPositionHolder)
Deprecated.