Java Code Examples for com.google.android.exoplayer2.decoder.DecoderInputBuffer#isDecodeOnly()

The following examples show how to use com.google.android.exoplayer2.decoder.DecoderInputBuffer#isDecodeOnly() . 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: SimpleDecoderAudioRenderer.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
private void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
}
 
Example 2
Source File: MediaCodecAudioRenderer.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
@Override
protected void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
  lastInputTimeUs = Math.max(buffer.timeUs, lastInputTimeUs);
}
 
Example 3
Source File: SimpleDecoderAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
}
 
Example 4
Source File: MediaCodecAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
}
 
Example 5
Source File: SimpleDecoderAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
}
 
Example 6
Source File: MediaCodecAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
}
 
Example 7
Source File: SimpleDecoderAudioRenderer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
private void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
}
 
Example 8
Source File: MediaCodecAudioRenderer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
  lastInputTimeUs = Math.max(buffer.timeUs, lastInputTimeUs);
}
 
Example 9
Source File: SimpleDecoderAudioRenderer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
}
 
Example 10
Source File: MediaCodecAudioRenderer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void onQueueInputBuffer(DecoderInputBuffer buffer) {
  if (allowFirstBufferPositionDiscontinuity && !buffer.isDecodeOnly()) {
    // TODO: Remove this hack once we have a proper fix for [Internal: b/71876314].
    // Allow the position to jump if the first presentable input buffer has a timestamp that
    // differs significantly from what was expected.
    if (Math.abs(buffer.timeUs - currentPositionUs) > 500000) {
      currentPositionUs = buffer.timeUs;
    }
    allowFirstBufferPositionDiscontinuity = false;
  }
  lastInputTimeUs = Math.max(buffer.timeUs, lastInputTimeUs);
}