libs: profile: h265: Fix return value of from_codec_data_h265.

profile_from_codec_data_h265() returns wrong GstVaapiProfile for h265.
The codec data of caps contain the profile IDC, but the mapping between
profile IDC and GstVaapiProfile is wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/358>
This commit is contained in:
He Junyan 2020-07-12 19:42:40 +08:00 committed by GStreamer Merge Bot
parent 35c3de234c
commit 7acc3c4db8

View file

@ -341,6 +341,9 @@ gst_vaapi_profile_from_codec_data_h265 (GstBuffer * buffer)
if (buf[1] & 0xc0) /* general_profile_space = 0 */
return 0;
/* We may not recognize the exactly correct profile, which needs more
info such as depth, chroma and constraint_flag. We just return the
first one that belongs to that profile IDC. */
switch (buf[1] & 0x1f) { /* HEVCProfileIndication */
case 1:
return GST_VAAPI_PROFILE_H265_MAIN;
@ -350,10 +353,8 @@ gst_vaapi_profile_from_codec_data_h265 (GstBuffer * buffer)
return GST_VAAPI_PROFILE_H265_MAIN_STILL_PICTURE;
case 4:
return GST_VAAPI_PROFILE_H265_MAIN_422_10;
case 5:
return GST_VAAPI_PROFILE_H265_MAIN_444;
case 6:
return GST_VAAPI_PROFILE_H265_MAIN_444_10;
case 9:
return GST_VAAPI_PROFILE_H265_SCREEN_EXTENDED_MAIN;
}
return 0;
}