if (!context->surfaces_pool) {
context->surfaces_pool =
- gst_vaapi_surface_pool_new (GST_VAAPI_OBJECT_DISPLAY (context),
- GST_VIDEO_FORMAT_ENCODED, cip->width, cip->height);
+ gst_vaapi_surface_pool_new_with_chroma_type (GST_VAAPI_OBJECT_DISPLAY (context),
+ cip->chroma_type, cip->width, cip->height);
+
if (!context->surfaces_pool)
return FALSE;
}
priv->profile = profile;
}
- chroma_type = gst_vaapi_utils_h265_get_chroma_type (sps->chroma_format_idc);
+ chroma_type = gst_vaapi_utils_h265_get_chroma_type (sps->chroma_format_idc, sps->bit_depth_luma_minus8 + 8);
if (!chroma_type) {
GST_ERROR ("unsupported chroma_format_idc %u", sps->chroma_format_idc);
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT;
/** Returns GstVaapiChromaType from H.265 chroma_format_idc value */
GstVaapiChromaType
-gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc)
+gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc, guint luma_bit_depth)
{
- GstVaapiChromaType chroma_type;
+ GstVaapiChromaType chroma_type = (GstVaapiChromaType) 0;
switch (chroma_format_idc) {
case 0:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV400;
break;
case 1:
- chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
+ if (luma_bit_depth == 8)
+ chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
+ else if (luma_bit_depth > 8)
+ chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420_10BPP;
break;
case 2:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV422;
chroma_format_idc = 0;
break;
case GST_VAAPI_CHROMA_TYPE_YUV420:
+ case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP:
chroma_format_idc = 1;
break;
case GST_VAAPI_CHROMA_TYPE_YUV422:
/* Returns GstVaapiChromaType from H.265 chroma_format_idc value */
G_GNUC_INTERNAL
GstVaapiChromaType
-gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc);
+gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc, guint luma_bit_depth);
/* Returns H.265 chroma_format_idc value from GstVaapiChromaType */
G_GNUC_INTERNAL