Skip to content

Commit

Permalink
TrickPlayRendererFactory async mode plumbing
Browse files Browse the repository at this point in the history
  • Loading branch information
mbolaris authored and stevemayhew committed Oct 25, 2022
1 parent f99969c commit ee6b732
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,30 @@ class TrickPlayRendererFactory extends DefaultRenderersFactory {
protected static final int MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY = 10;

private final TrickPlayControlInternal trickPlayController;
private boolean enableAsyncQueueing;
private boolean forceAsyncQueueingSynchronizationWorkaround;

TrickPlayRendererFactory(Context context, TrickPlayControlInternal controller) {
super(context);
trickPlayController = controller;
enableAsyncQueueing = false;
forceAsyncQueueingSynchronizationWorkaround = false;
setAllowedVideoJoiningTimeMs(0);
}

@Override
public DefaultRenderersFactory experimentalSetAsynchronousBufferQueueingEnabled(boolean enabled) {
enableAsyncQueueing = enabled;
return super.experimentalSetAsynchronousBufferQueueingEnabled(enabled);
}

@Override
public DefaultRenderersFactory experimentalSetForceAsyncQueueingSynchronizationWorkaround(
boolean enabled) {
forceAsyncQueueingSynchronizationWorkaround = enabled;
return super.experimentalSetForceAsyncQueueingSynchronizationWorkaround(enabled);
}

@Override
protected void buildVideoRenderers(
Context context,
Expand All @@ -57,6 +74,8 @@ protected void buildVideoRenderers(
enableDecoderFallback,
eventHandler,
eventListener, MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY);
videoRenderer.experimentalSetAsynchronousBufferQueueingEnabled(enableAsyncQueueing);
videoRenderer.experimentalSetForceAsyncQueueingSynchronizationWorkaround(forceAsyncQueueingSynchronizationWorkaround);
out.add(videoRenderer);
}

Expand Down

0 comments on commit ee6b732

Please sign in to comment.