summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2019-04-15 19:58:14 +0800
committerTim-Philipp Müller <tim@centricular.com>2019-08-07 00:10:36 +0100
commit9adb9014ac3bbf71a8bac4602b860e4d6933c902 (patch)
tree2721ea56056b74b534d159307732de6bad9025e9
parent2f9f56dcca65f2e93a21da13559b633dbad5257c (diff)
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
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_vp9.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c b/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c
index 2466b7bb..f164c8c6 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c
@@ -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;