mirror of
https://github.com/samsonjs/media.git
synced 2026-03-31 10:25:48 +00:00
Allow overriding of codec buffer dequeue block time.
This commit is contained in:
parent
1a9bf018a4
commit
f637fde962
1 changed files with 10 additions and 1 deletions
|
|
@ -793,6 +793,15 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
|
|||
return SystemClock.elapsedRealtime() < codecHotswapTimeMs + MAX_CODEC_HOTSWAP_TIME_MS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum time to block whilst waiting for a decoded output buffer.
|
||||
*
|
||||
* @return The maximum time to block, in microseconds.
|
||||
*/
|
||||
protected long getDequeueOutputBufferTimeoutUs() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if it may be possible to drain more output data. False otherwise.
|
||||
* @throws ExoPlaybackException If an error occurs draining the output buffer.
|
||||
|
|
@ -805,7 +814,7 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
|
|||
}
|
||||
|
||||
if (outputIndex < 0) {
|
||||
outputIndex = codec.dequeueOutputBuffer(outputBufferInfo, 0);
|
||||
outputIndex = codec.dequeueOutputBuffer(outputBufferInfo, getDequeueOutputBufferTimeoutUs());
|
||||
}
|
||||
|
||||
if (outputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue