mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove row VP9 multi-threading option
PiperOrigin-RevId: 283319944
This commit is contained in:
parent
8e44e3b795
commit
78e72abbc4
@ -68,7 +68,6 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
*/
|
*/
|
||||||
private static final int DEFAULT_INPUT_BUFFER_SIZE = 768 * 1024;
|
private static final int DEFAULT_INPUT_BUFFER_SIZE = 768 * 1024;
|
||||||
|
|
||||||
private final boolean enableRowMultiThreadMode;
|
|
||||||
private final int threads;
|
private final int threads;
|
||||||
|
|
||||||
@Nullable private VpxDecoder decoder;
|
@Nullable private VpxDecoder decoder;
|
||||||
@ -121,8 +120,8 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
* permitted to play clear regions of encrypted media files before {@code drmSessionManager}
|
* permitted to play clear regions of encrypted media files before {@code drmSessionManager}
|
||||||
* has obtained the keys necessary to decrypt encrypted regions of the media.
|
* has obtained the keys necessary to decrypt encrypted regions of the media.
|
||||||
* @deprecated Use {@link #LibvpxVideoRenderer(long, Handler, VideoRendererEventListener, int,
|
* @deprecated Use {@link #LibvpxVideoRenderer(long, Handler, VideoRendererEventListener, int,
|
||||||
* boolean, int, int, int)}} instead, and pass DRM-related parameters to the {@link
|
* int, int, int)}} instead, and pass DRM-related parameters to the {@link MediaSource}
|
||||||
* MediaSource} factories.
|
* factories.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@ -140,7 +139,6 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
maxDroppedFramesToNotify,
|
maxDroppedFramesToNotify,
|
||||||
drmSessionManager,
|
drmSessionManager,
|
||||||
playClearSamplesWithoutKeys,
|
playClearSamplesWithoutKeys,
|
||||||
/* enableRowMultiThreadMode= */ false,
|
|
||||||
getRuntime().availableProcessors(),
|
getRuntime().availableProcessors(),
|
||||||
/* numInputBuffers= */ 4,
|
/* numInputBuffers= */ 4,
|
||||||
/* numOutputBuffers= */ 4);
|
/* numOutputBuffers= */ 4);
|
||||||
@ -154,7 +152,6 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
* @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 enableRowMultiThreadMode Whether row multi threading decoding is enabled.
|
|
||||||
* @param threads Number of threads libvpx will use to decode.
|
* @param threads Number of threads libvpx will use to decode.
|
||||||
* @param numInputBuffers Number of input buffers.
|
* @param numInputBuffers Number of input buffers.
|
||||||
* @param numOutputBuffers Number of output buffers.
|
* @param numOutputBuffers Number of output buffers.
|
||||||
@ -165,7 +162,6 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
@Nullable Handler eventHandler,
|
@Nullable Handler eventHandler,
|
||||||
@Nullable VideoRendererEventListener eventListener,
|
@Nullable VideoRendererEventListener eventListener,
|
||||||
int maxDroppedFramesToNotify,
|
int maxDroppedFramesToNotify,
|
||||||
boolean enableRowMultiThreadMode,
|
|
||||||
int threads,
|
int threads,
|
||||||
int numInputBuffers,
|
int numInputBuffers,
|
||||||
int numOutputBuffers) {
|
int numOutputBuffers) {
|
||||||
@ -176,7 +172,6 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
maxDroppedFramesToNotify,
|
maxDroppedFramesToNotify,
|
||||||
/* drmSessionManager= */ null,
|
/* drmSessionManager= */ null,
|
||||||
/* playClearSamplesWithoutKeys= */ false,
|
/* playClearSamplesWithoutKeys= */ false,
|
||||||
enableRowMultiThreadMode,
|
|
||||||
threads,
|
threads,
|
||||||
numInputBuffers,
|
numInputBuffers,
|
||||||
numOutputBuffers);
|
numOutputBuffers);
|
||||||
@ -197,13 +192,12 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
* begin in parallel with key acquisition. This parameter specifies whether the renderer is
|
* begin in parallel with key acquisition. This parameter specifies whether the renderer is
|
||||||
* permitted to play clear regions of encrypted media files before {@code drmSessionManager}
|
* permitted to play clear regions of encrypted media files before {@code drmSessionManager}
|
||||||
* has obtained the keys necessary to decrypt encrypted regions of the media.
|
* has obtained the keys necessary to decrypt encrypted regions of the media.
|
||||||
* @param enableRowMultiThreadMode Whether row multi threading decoding is enabled.
|
|
||||||
* @param threads Number of threads libvpx will use to decode.
|
* @param threads Number of threads libvpx will use to decode.
|
||||||
* @param numInputBuffers Number of input buffers.
|
* @param numInputBuffers Number of input buffers.
|
||||||
* @param numOutputBuffers Number of output buffers.
|
* @param numOutputBuffers Number of output buffers.
|
||||||
* @deprecated Use {@link #LibvpxVideoRenderer(long, Handler, VideoRendererEventListener, int,
|
* @deprecated Use {@link #LibvpxVideoRenderer(long, Handler, VideoRendererEventListener, int,
|
||||||
* boolean, int, int, int)}} instead, and pass DRM-related parameters to the {@link
|
* int, int, int)}} instead, and pass DRM-related parameters to the {@link MediaSource}
|
||||||
* MediaSource} factories.
|
* factories.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public LibvpxVideoRenderer(
|
public LibvpxVideoRenderer(
|
||||||
@ -213,7 +207,6 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
int maxDroppedFramesToNotify,
|
int maxDroppedFramesToNotify,
|
||||||
@Nullable DrmSessionManager<ExoMediaCrypto> drmSessionManager,
|
@Nullable DrmSessionManager<ExoMediaCrypto> drmSessionManager,
|
||||||
boolean playClearSamplesWithoutKeys,
|
boolean playClearSamplesWithoutKeys,
|
||||||
boolean enableRowMultiThreadMode,
|
|
||||||
int threads,
|
int threads,
|
||||||
int numInputBuffers,
|
int numInputBuffers,
|
||||||
int numOutputBuffers) {
|
int numOutputBuffers) {
|
||||||
@ -224,7 +217,6 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
maxDroppedFramesToNotify,
|
maxDroppedFramesToNotify,
|
||||||
drmSessionManager,
|
drmSessionManager,
|
||||||
playClearSamplesWithoutKeys);
|
playClearSamplesWithoutKeys);
|
||||||
this.enableRowMultiThreadMode = enableRowMultiThreadMode;
|
|
||||||
this.threads = threads;
|
this.threads = threads;
|
||||||
this.numInputBuffers = numInputBuffers;
|
this.numInputBuffers = numInputBuffers;
|
||||||
this.numOutputBuffers = numOutputBuffers;
|
this.numOutputBuffers = numOutputBuffers;
|
||||||
@ -259,12 +251,7 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
format.maxInputSize != Format.NO_VALUE ? format.maxInputSize : DEFAULT_INPUT_BUFFER_SIZE;
|
format.maxInputSize != Format.NO_VALUE ? format.maxInputSize : DEFAULT_INPUT_BUFFER_SIZE;
|
||||||
VpxDecoder decoder =
|
VpxDecoder decoder =
|
||||||
new VpxDecoder(
|
new VpxDecoder(
|
||||||
numInputBuffers,
|
numInputBuffers, numOutputBuffers, initialInputBufferSize, mediaCrypto, threads);
|
||||||
numOutputBuffers,
|
|
||||||
initialInputBufferSize,
|
|
||||||
mediaCrypto,
|
|
||||||
enableRowMultiThreadMode,
|
|
||||||
threads);
|
|
||||||
this.decoder = decoder;
|
this.decoder = decoder;
|
||||||
TraceUtil.endSection();
|
TraceUtil.endSection();
|
||||||
return decoder;
|
return decoder;
|
||||||
|
@ -53,7 +53,6 @@ import java.nio.ByteBuffer;
|
|||||||
* @param initialInputBufferSize The initial size of each input buffer.
|
* @param initialInputBufferSize The initial size of each input buffer.
|
||||||
* @param exoMediaCrypto The {@link ExoMediaCrypto} object required for decoding encrypted
|
* @param exoMediaCrypto The {@link ExoMediaCrypto} object required for decoding encrypted
|
||||||
* content. Maybe null and can be ignored if decoder does not handle encrypted content.
|
* content. Maybe null and can be ignored if decoder does not handle encrypted content.
|
||||||
* @param enableRowMultiThreadMode Whether row multi threading decoding is enabled.
|
|
||||||
* @param threads Number of threads libvpx will use to decode.
|
* @param threads Number of threads libvpx will use to decode.
|
||||||
* @throws VpxDecoderException Thrown if an exception occurs when initializing the decoder.
|
* @throws VpxDecoderException Thrown if an exception occurs when initializing the decoder.
|
||||||
*/
|
*/
|
||||||
@ -62,7 +61,6 @@ import java.nio.ByteBuffer;
|
|||||||
int numOutputBuffers,
|
int numOutputBuffers,
|
||||||
int initialInputBufferSize,
|
int initialInputBufferSize,
|
||||||
@Nullable ExoMediaCrypto exoMediaCrypto,
|
@Nullable ExoMediaCrypto exoMediaCrypto,
|
||||||
boolean enableRowMultiThreadMode,
|
|
||||||
int threads)
|
int threads)
|
||||||
throws VpxDecoderException {
|
throws VpxDecoderException {
|
||||||
super(
|
super(
|
||||||
@ -75,7 +73,8 @@ import java.nio.ByteBuffer;
|
|||||||
if (exoMediaCrypto != null && !VpxLibrary.vpxIsSecureDecodeSupported()) {
|
if (exoMediaCrypto != null && !VpxLibrary.vpxIsSecureDecodeSupported()) {
|
||||||
throw new VpxDecoderException("Vpx decoder does not support secure decode.");
|
throw new VpxDecoderException("Vpx decoder does not support secure decode.");
|
||||||
}
|
}
|
||||||
vpxDecContext = vpxInit(/* disableLoopFilter= */ false, enableRowMultiThreadMode, threads);
|
vpxDecContext =
|
||||||
|
vpxInit(/* disableLoopFilter= */ false, /* enableRowMultiThreadMode= */ false, threads);
|
||||||
if (vpxDecContext == 0) {
|
if (vpxDecContext == 0) {
|
||||||
throw new VpxDecoderException("Failed to initialize decoder");
|
throw new VpxDecoderException("Failed to initialize decoder");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user