Commit 6d9a1ed6 by olly Committed by Andrew Lewis

Noop consistency fixes for extension decoders

PiperOrigin-RevId: 317609986
parent aec5ff8b
......@@ -84,15 +84,6 @@ import java.nio.ByteBuffer;
return "libgav1";
}
/**
* Sets the output mode for frames rendered by the decoder.
*
* @param outputMode The output mode.
*/
public void setOutputMode(@C.VideoOutputMode int outputMode) {
this.outputMode = outputMode;
}
@Override
protected VideoDecoderInputBuffer createInputBuffer() {
return new VideoDecoderInputBuffer(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_DIRECT);
......@@ -157,6 +148,15 @@ import java.nio.ByteBuffer;
}
/**
* Sets the output mode for frames rendered by the decoder.
*
* @param outputMode The output mode.
*/
public void setOutputMode(@C.VideoOutputMode int outputMode) {
this.outputMode = outputMode;
}
/**
* Renders output buffer to the given surface. Must only be called when in {@link
* C#VIDEO_OUTPUT_MODE_SURFACE_YUV} mode.
*
......
......@@ -87,15 +87,6 @@ import java.nio.ByteBuffer;
return "libvpx" + VpxLibrary.getVersion();
}
/**
* Sets the output mode for frames rendered by the decoder.
*
* @param outputMode The output mode.
*/
public void setOutputMode(@C.VideoOutputMode int outputMode) {
this.outputMode = outputMode;
}
@Override
protected VideoDecoderInputBuffer createInputBuffer() {
return new VideoDecoderInputBuffer(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_DIRECT);
......@@ -183,6 +174,15 @@ import java.nio.ByteBuffer;
vpxClose(vpxDecContext);
}
/**
* Sets the output mode for frames rendered by the decoder.
*
* @param outputMode The output mode.
*/
public void setOutputMode(@C.VideoOutputMode int outputMode) {
this.outputMode = outputMode;
}
/** Renders the outputBuffer to the surface. Used with OUTPUT_MODE_SURFACE_YUV only. */
public void renderToSurface(VideoDecoderOutputBuffer outputBuffer, Surface surface)
throws VpxDecoderException {
......
......@@ -65,9 +65,11 @@ static jfieldID dataField;
static jfieldID outputModeField;
static jfieldID decoderPrivateField;
// android.graphics.ImageFormat.YV12.
static const int kHalPixelFormatYV12 = 0x32315659;
// Android YUV format. See:
// https://developer.android.com/reference/android/graphics/ImageFormat.html#YV12.
static const int kImageFormatYV12 = 0x32315659;
static const int kDecoderPrivateBase = 0x100;
static int errorCode;
jint JNI_OnLoad(JavaVM* vm, void* reserved) {
......@@ -635,7 +637,7 @@ DECODER_FUNC(jint, vpxRenderFrame, jlong jContext, jobject jSurface,
}
if (context->width != srcBuffer->d_w || context->height != srcBuffer->d_h) {
ANativeWindow_setBuffersGeometry(context->native_window, srcBuffer->d_w,
srcBuffer->d_h, kHalPixelFormatYV12);
srcBuffer->d_h, kImageFormatYV12);
context->width = srcBuffer->d_w;
context->height = srcBuffer->d_h;
}
......
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