Commit f637fde9 by Oliver Woodman

Allow overriding of codec buffer dequeue block time.

parent 1a9bf018
...@@ -794,6 +794,15 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer { ...@@ -794,6 +794,15 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
} }
/** /**
* 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. * @return True if it may be possible to drain more output data. False otherwise.
* @throws ExoPlaybackException If an error occurs draining the output buffer. * @throws ExoPlaybackException If an error occurs draining the output buffer.
*/ */
...@@ -805,7 +814,7 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer { ...@@ -805,7 +814,7 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
} }
if (outputIndex < 0) { if (outputIndex < 0) {
outputIndex = codec.dequeueOutputBuffer(outputBufferInfo, 0); outputIndex = codec.dequeueOutputBuffer(outputBufferInfo, getDequeueOutputBufferTimeoutUs());
} }
if (outputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { if (outputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment