lib: decoder: vp9: Set chroma_type by VP9 bit_depth

The decoder's surface chroma type should depend on the bit depth
of VP9's parser. For 10bits VP9 stream, we need to use P10LE kind
10 bits surface as the decoder result.

Fixes #155
This commit is contained in:
He Junyan 2019-04-15 19:58:14 +08:00 committed by Víctor Manuel Jáquez Leal
parent 838045b9e2
commit 9c1f3ad172

View file

@ -220,7 +220,16 @@ ensure_context (GstVaapiDecoderVp9 * decoder)
info.profile = priv->profile;
info.entrypoint = entrypoint;
info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
if (priv->parser->bit_depth == GST_VP9_BIT_DEPTH_8) {
info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
} else if (priv->parser->bit_depth == GST_VP9_BIT_DEPTH_10) {
info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420_10BPP;
} else {
GST_WARNING ("VP9 with depth %d, bigger than 10BPP not supported now",
priv->parser->bit_depth);
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT;
}
info.width = priv->width;
info.height = priv->height;
info.ref_frames = 8;