Throw for unsupported libvpx output formats

Currently we fail silently for high bit depth output when using ANativeWindow
output mode.

PiperOrigin-RevId: 263549384
This commit is contained in:
andrewlewis 2019-08-15 14:17:18 +01:00 committed by Andrew Lewis
parent ebb72e358f
commit e267550d95

View File

@ -594,8 +594,14 @@ DECODER_FUNC(jint, vpxGetFrame, jlong jContext, jobject jOutputBuffer) {
memcpy(data + yLength, img->planes[VPX_PLANE_U], uvLength);
memcpy(data + yLength + uvLength, img->planes[VPX_PLANE_V], uvLength);
}
} else if (outputMode == kOutputModeSurfaceYuv &&
img->fmt != VPX_IMG_FMT_I42016) {
} else if (outputMode == kOutputModeSurfaceYuv) {
if (img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) {
LOGE(
"ERROR: High bit depth output format %d not supported in surface "
"YUV output mode",
img->fmt);
return -1;
}
int id = *(int*)img->fb_priv;
context->buffer_manager->add_ref(id);
JniFrameBuffer* jfb = context->buffer_manager->get_buffer(id);