Java Code Examples for com.google.android.exoplayer2.source.SampleQueue#ADVANCE_FAILED
The following examples show how to use
com.google.android.exoplayer2.source.SampleQueue#ADVANCE_FAILED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChunkSampleStream.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
@Override public int skipData(long positionUs) { if (isPendingReset()) { return 0; } int skipCount; if (loadingFinished && positionUs > primarySampleQueue.getLargestQueuedTimestampUs()) { skipCount = primarySampleQueue.advanceToEnd(); } else { skipCount = primarySampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } if (skipCount > 0) { maybeNotifyPrimaryTrackFormatChanged(primarySampleQueue.getReadIndex(), skipCount); } return skipCount; }
Example 2
Source File: ChunkSampleStream.java From Telegram with GNU General Public License v2.0 | 6 votes |
@Override public int skipData(long positionUs) { if (isPendingReset()) { return 0; } maybeNotifyDownstreamFormat(); int skipCount; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { skipCount = sampleQueue.advanceToEnd(); } else { skipCount = sampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } return skipCount; }
Example 3
Source File: ChunkSampleStream.java From Telegram with GNU General Public License v2.0 | 6 votes |
@Override public int skipData(long positionUs) { if (isPendingReset()) { return 0; } int skipCount; if (loadingFinished && positionUs > primarySampleQueue.getLargestQueuedTimestampUs()) { skipCount = primarySampleQueue.advanceToEnd(); } else { skipCount = primarySampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } maybeNotifyPrimaryTrackFormatChanged(); return skipCount; }
Example 4
Source File: HlsSampleStreamWrapper.java From Telegram with GNU General Public License v2.0 | 6 votes |
/** * Attempts to seek to the specified position within the sample queues. * * @param positionUs The seek position in microseconds. * @return Whether the in-buffer seek was successful. */ private boolean seekInsideBufferUs(long positionUs) { int sampleQueueCount = sampleQueues.length; for (int i = 0; i < sampleQueueCount; i++) { SampleQueue sampleQueue = sampleQueues[i]; sampleQueue.rewind(); boolean seekInsideQueue = sampleQueue.advanceTo(positionUs, true, false) != SampleQueue.ADVANCE_FAILED; // If we have AV tracks then an in-queue seek is successful if the seek into every AV queue // is successful. We ignore whether seeks within non-AV queues are successful in this case, as // they may be sparse or poorly interleaved. If we only have non-AV tracks then a seek is // successful only if the seek into every queue succeeds. if (!seekInsideQueue && (sampleQueueIsAudioVideoFlags[i] || !haveAudioVideoSampleQueues)) { return false; } } return true; }
Example 5
Source File: ChunkSampleStream.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
@Override public int skipData(long positionUs) { if (isPendingReset()) { return 0; } maybeNotifyDownstreamFormat(); int skipCount; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { skipCount = sampleQueue.advanceToEnd(); } else { skipCount = sampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } return skipCount; }
Example 6
Source File: ChunkSampleStream.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
@Override public int skipData(long positionUs) { if (isPendingReset()) { return 0; } int skipCount; if (loadingFinished && positionUs > primarySampleQueue.getLargestQueuedTimestampUs()) { skipCount = primarySampleQueue.advanceToEnd(); } else { skipCount = primarySampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } maybeNotifyPrimaryTrackFormatChanged(); return skipCount; }
Example 7
Source File: HlsSampleStreamWrapper.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
/** * Attempts to seek to the specified position within the sample queues. * * @param positionUs The seek position in microseconds. * @return Whether the in-buffer seek was successful. */ private boolean seekInsideBufferUs(long positionUs) { int sampleQueueCount = sampleQueues.length; for (int i = 0; i < sampleQueueCount; i++) { SampleQueue sampleQueue = sampleQueues[i]; sampleQueue.rewind(); boolean seekInsideQueue = sampleQueue.advanceTo(positionUs, true, false) != SampleQueue.ADVANCE_FAILED; // If we have AV tracks then an in-queue seek is successful if the seek into every AV queue // is successful. We ignore whether seeks within non-AV queues are successful in this case, as // they may be sparse or poorly interleaved. If we only have non-AV tracks then a seek is // successful only if the seek into every queue succeeds. if (!seekInsideQueue && (sampleQueueIsAudioVideoFlags[i] || !haveAudioVideoSampleQueues)) { return false; } } return true; }
Example 8
Source File: ChunkSampleStream.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
@Override public int skipData(long positionUs) { int skipCount; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { skipCount = sampleQueue.advanceToEnd(); } else { skipCount = sampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } if (skipCount > 0) { maybeNotifyTrackFormatChanged(); } return skipCount; }
Example 9
Source File: HlsSampleStreamWrapper.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
/** * Attempts to seek to the specified position within the sample queues. * * @param positionUs The seek position in microseconds. * @return Whether the in-buffer seek was successful. */ private boolean seekInsideBufferUs(long positionUs) { int sampleQueueCount = sampleQueues.length; for (int i = 0; i < sampleQueueCount; i++) { SampleQueue sampleQueue = sampleQueues[i]; sampleQueue.rewind(); boolean seekInsideQueue = sampleQueue.advanceTo(positionUs, true, false) != SampleQueue.ADVANCE_FAILED; // If we have AV tracks then an in-queue seek is successful if the seek into every AV queue // is successful. We ignore whether seeks within non-AV queues are successful in this case, as // they may be sparse or poorly interleaved. If we only have non-AV tracks then a seek is // successful only if the seek into every queue succeeds. if (!seekInsideQueue && (sampleQueueIsAudioVideoFlags[i] || !haveAudioVideoSampleQueues)) { return false; } } return true; }
Example 10
Source File: ChunkSampleStream.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
@Override public int skipData(long positionUs) { int skipCount; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { skipCount = sampleQueue.advanceToEnd(); } else { skipCount = sampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } if (skipCount > 0) { maybeNotifyTrackFormatChanged(); } return skipCount; }
Example 11
Source File: ChunkSampleStream.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
@Override public int skipData(long positionUs) { if (isPendingReset()) { return 0; } int skipCount; if (loadingFinished && positionUs > primarySampleQueue.getLargestQueuedTimestampUs()) { skipCount = primarySampleQueue.advanceToEnd(); } else { skipCount = primarySampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } if (skipCount > 0) { maybeNotifyPrimaryTrackFormatChanged(primarySampleQueue.getReadIndex(), skipCount); } return skipCount; }
Example 12
Source File: HlsSampleStreamWrapper.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
/** * Attempts to seek to the specified position within the sample queues. * * @param positionUs The seek position in microseconds. * @return Whether the in-buffer seek was successful. */ private boolean seekInsideBufferUs(long positionUs) { int sampleQueueCount = sampleQueues.length; for (int i = 0; i < sampleQueueCount; i++) { SampleQueue sampleQueue = sampleQueues[i]; sampleQueue.rewind(); boolean seekInsideQueue = sampleQueue.advanceTo(positionUs, true, false) != SampleQueue.ADVANCE_FAILED; // If we have AV tracks then an in-queue seek is successful if the seek into every AV queue // is successful. We ignore whether seeks within non-AV queues are successful in this case, as // they may be sparse or poorly interleaved. If we only have non-AV tracks then a seek is // successful only if the seek into every queue succeeds. if (!seekInsideQueue && (sampleQueueIsAudioVideoFlags[i] || !haveAudioVideoSampleQueues)) { return false; } } return true; }
Example 13
Source File: ChunkSampleStream.java From MediaSDK with Apache License 2.0 | 6 votes |
@Override public int skipData(long positionUs) { if (isPendingReset()) { return 0; } maybeNotifyDownstreamFormat(); int skipCount; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { skipCount = sampleQueue.advanceToEnd(); } else { skipCount = sampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } return skipCount; }
Example 14
Source File: ChunkSampleStream.java From MediaSDK with Apache License 2.0 | 6 votes |
@Override public int skipData(long positionUs) { if (isPendingReset()) { return 0; } int skipCount; if (loadingFinished && positionUs > primarySampleQueue.getLargestQueuedTimestampUs()) { skipCount = primarySampleQueue.advanceToEnd(); } else { skipCount = primarySampleQueue.advanceTo(positionUs, true, true); if (skipCount == SampleQueue.ADVANCE_FAILED) { skipCount = 0; } } maybeNotifyPrimaryTrackFormatChanged(); return skipCount; }
Example 15
Source File: HlsSampleStreamWrapper.java From MediaSDK with Apache License 2.0 | 6 votes |
/** * Attempts to seek to the specified position within the sample queues. * * @param positionUs The seek position in microseconds. * @return Whether the in-buffer seek was successful. */ private boolean seekInsideBufferUs(long positionUs) { int sampleQueueCount = sampleQueues.length; for (int i = 0; i < sampleQueueCount; i++) { SampleQueue sampleQueue = sampleQueues[i]; sampleQueue.rewind(); boolean seekInsideQueue = sampleQueue.advanceTo(positionUs, true, false) != SampleQueue.ADVANCE_FAILED; // If we have AV tracks then an in-queue seek is successful if the seek into every AV queue // is successful. We ignore whether seeks within non-AV queues are successful in this case, as // they may be sparse or poorly interleaved. If we only have non-AV tracks then a seek is // successful only if the seek into every queue succeeds. if (!seekInsideQueue && (sampleQueueIsAudioVideoFlags[i] || !haveAudioVideoSampleQueues)) { return false; } } return true; }
Example 16
Source File: HlsSampleStreamWrapper.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public int skipData(int sampleQueueIndex, long positionUs) { if (isPendingReset()) { return 0; } SampleQueue sampleQueue = sampleQueues[sampleQueueIndex]; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { return sampleQueue.advanceToEnd(); } else { int skipCount = sampleQueue.advanceTo(positionUs, true, true); return skipCount == SampleQueue.ADVANCE_FAILED ? 0 : skipCount; } }
Example 17
Source File: HlsSampleStreamWrapper.java From MediaSDK with Apache License 2.0 | 5 votes |
public int skipData(int sampleQueueIndex, long positionUs) { if (isPendingReset()) { return 0; } SampleQueue sampleQueue = sampleQueues[sampleQueueIndex]; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { return sampleQueue.advanceToEnd(); } else { int skipCount = sampleQueue.advanceTo(positionUs, true, true); return skipCount == SampleQueue.ADVANCE_FAILED ? 0 : skipCount; } }
Example 18
Source File: HlsSampleStreamWrapper.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public int skipData(int sampleQueueIndex, long positionUs) { if (isPendingReset()) { return 0; } SampleQueue sampleQueue = sampleQueues[sampleQueueIndex]; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { return sampleQueue.advanceToEnd(); } else { int skipCount = sampleQueue.advanceTo(positionUs, true, true); return skipCount == SampleQueue.ADVANCE_FAILED ? 0 : skipCount; } }
Example 19
Source File: HlsSampleStreamWrapper.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public int skipData(int sampleQueueIndex, long positionUs) { if (isPendingReset()) { return 0; } SampleQueue sampleQueue = sampleQueues[sampleQueueIndex]; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { return sampleQueue.advanceToEnd(); } else { int skipCount = sampleQueue.advanceTo(positionUs, true, true); return skipCount == SampleQueue.ADVANCE_FAILED ? 0 : skipCount; } }
Example 20
Source File: HlsSampleStreamWrapper.java From Telegram with GNU General Public License v2.0 | 5 votes |
public int skipData(int sampleQueueIndex, long positionUs) { if (isPendingReset()) { return 0; } SampleQueue sampleQueue = sampleQueues[sampleQueueIndex]; if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) { return sampleQueue.advanceToEnd(); } else { int skipCount = sampleQueue.advanceTo(positionUs, true, true); return skipCount == SampleQueue.ADVANCE_FAILED ? 0 : skipCount; } }