Commit 310f268a by olly Committed by bachinger

Set assumedVideoMinimumCodecOperatingRate for all playbacks

PiperOrigin-RevId: 405736227
parent 383bad80
...@@ -205,7 +205,8 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -205,7 +205,8 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
/* enableDecoderFallback= */ false, /* enableDecoderFallback= */ false,
eventHandler, eventHandler,
eventListener, eventListener,
maxDroppedFramesToNotify); maxDroppedFramesToNotify,
/* assumedMinimumCodecOperatingRate= */ 30);
} }
/** /**
...@@ -238,7 +239,46 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -238,7 +239,46 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
enableDecoderFallback, enableDecoderFallback,
eventHandler, eventHandler,
eventListener, eventListener,
maxDroppedFramesToNotify); maxDroppedFramesToNotify,
/* assumedMinimumCodecOperatingRate= */ 30);
}
/**
* @param context A context.
* @param codecAdapterFactory The {@link MediaCodecAdapter.Factory} used to create {@link
* MediaCodecAdapter} instances.
* @param mediaCodecSelector A decoder selector.
* @param allowedJoiningTimeMs The maximum duration in milliseconds for which this video renderer
* can attempt to seamlessly join an ongoing playback.
* @param enableDecoderFallback Whether to enable fallback to lower-priority decoders if decoder
* initialization fails. This may result in using a decoder that is slower/less efficient than
* the primary decoder.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
* invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
*/
public MediaCodecVideoRenderer(
Context context,
MediaCodecAdapter.Factory codecAdapterFactory,
MediaCodecSelector mediaCodecSelector,
long allowedJoiningTimeMs,
boolean enableDecoderFallback,
@Nullable Handler eventHandler,
@Nullable VideoRendererEventListener eventListener,
int maxDroppedFramesToNotify) {
this(
context,
codecAdapterFactory,
mediaCodecSelector,
allowedJoiningTimeMs,
enableDecoderFallback,
eventHandler,
eventListener,
maxDroppedFramesToNotify,
/* assumedMinimumCodecOperatingRate= */ 30);
} }
/** /**
...@@ -258,6 +298,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -258,6 +298,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
* @param eventListener A listener of events. May be null if delivery of events is not required. * @param eventListener A listener of events. May be null if delivery of events is not required.
* @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between * @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
* invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}. * invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
* @param assumedMinimumCodecOperatingRate A codec operating rate that all codecs instantiated by
* this renderer are assumed to meet implicitly (i.e. without the operating rate being set
* explicitly using {@link MediaFormat#KEY_OPERATING_RATE}).
*/ */
public MediaCodecVideoRenderer( public MediaCodecVideoRenderer(
Context context, Context context,
...@@ -267,13 +310,14 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -267,13 +310,14 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
boolean enableDecoderFallback, boolean enableDecoderFallback,
@Nullable Handler eventHandler, @Nullable Handler eventHandler,
@Nullable VideoRendererEventListener eventListener, @Nullable VideoRendererEventListener eventListener,
int maxDroppedFramesToNotify) { int maxDroppedFramesToNotify,
float assumedMinimumCodecOperatingRate) {
super( super(
C.TRACK_TYPE_VIDEO, C.TRACK_TYPE_VIDEO,
codecAdapterFactory, codecAdapterFactory,
mediaCodecSelector, mediaCodecSelector,
enableDecoderFallback, enableDecoderFallback,
/* assumedMinimumCodecOperatingRate= */ 30); assumedMinimumCodecOperatingRate);
this.allowedJoiningTimeMs = allowedJoiningTimeMs; this.allowedJoiningTimeMs = allowedJoiningTimeMs;
this.maxDroppedFramesToNotify = maxDroppedFramesToNotify; this.maxDroppedFramesToNotify = maxDroppedFramesToNotify;
this.context = context.getApplicationContext(); this.context = context.getApplicationContext();
......
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