From: Wangfei Date: Tue, 25 Jun 2019 02:31:20 +0000 (+0800) Subject: vaapidecode: set initial decode format according surface chroma type X-Git-Tag: 1.19.3~503^2~504 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4bec306b6b5695f1a12bafdb79508011488e693;p=platform%2Fupstream%2Fgstreamer.git vaapidecode: set initial decode format according surface chroma type For surfaces with different chroma type, it is prefer to initialize a format which chroma type should be same with surface chroma type instead of using fixed NV12. --- diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 5e348f7..1bd79c1 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -413,9 +413,14 @@ is_surface_resolution_changed (GstVaapiDecode * decode, surface_format = gst_vaapi_surface_get_format (surface); /* if the VA context delivers a currently unrecognized format - * (ICM3, e.g.), we can assume NV12 "safely" */ + * (ICM3, e.g.), we can assume one according surface chroma + * type. If fail, then use NV12 "safely" */ if (surface_format == GST_VIDEO_FORMAT_UNKNOWN || surface_format == GST_VIDEO_FORMAT_ENCODED) + surface_format = + gst_vaapi_video_format_from_chroma (gst_vaapi_surface_get_chroma_type + (surface)); + if (surface_format == GST_VIDEO_FORMAT_UNKNOWN) surface_format = GST_VIDEO_FORMAT_NV12; }