libs: Sync the GstVaapiChromaType to VA header file.

Add more kinds of chrometype which will be used to describe
new video formats. Sync it with 1.4.0 version header file.
Alse delete useless GST_VAAPI_CHROMA_TYPE_YUV410 chrome type.

Signed-off-by: He Junyan <junyan.he@hotmail.com>
This commit is contained in:
He Junyan 2018-11-09 22:03:43 +08:00 committed by Víctor Manuel Jáquez Leal
parent de6883f6d0
commit 90d8350820
2 changed files with 61 additions and 7 deletions

View file

@ -61,12 +61,17 @@ G_BEGIN_DECLS
* @GST_VAAPI_CHROMA_TYPE_YUV422: YUV 4:2:2 chroma format
* @GST_VAAPI_CHROMA_TYPE_YUV444: YUV 4:4:4 chroma format
* @GST_VAAPI_CHROMA_TYPE_YUV411: YUV 4:1:1 chroma format
* @GST_VAAPI_CHROMA_TYPE_YUV410: YUV 4:1:0 chroma format
* @GST_VAAPI_CHROMA_TYPE_YUV400: YUV 4:0:0 chroma format (grayscale)
* @GST_VAAPI_CHROMA_TYPE_RGB32: 32-bit RGB chroma format
* @GST_VAAPI_CHROMA_TYPE_YUV420_10BPP: YUV 4:2:0 chroma format, 10 bits per channel
* @GST_VAAPI_CHROMA_TYPE_YUV422_10BPP: YUV 4:2:2 chroma format, 10 bits per channel
* @GST_VAAPI_CHROMA_TYPE_YUV444_10BPP: YUV 4:4:4 chroma format, 10 bits per channel
* @GST_VAAPI_CHROMA_TYPE_YUV420_12BPP: YUV 4:2:0 chroma format, 12 bits per channel
* @GST_VAAPI_CHROMA_TYPE_YUV422_12BPP: YUV 4:2:2 chroma format, 12 bits per channel
* @GST_VAAPI_CHROMA_TYPE_YUV444_12BPP: YUV 4:4:4 chroma format, 12 bits per channel
* @GST_VAAPI_CHROMA_TYPE_RGB16: 16-bit RGB chroma format
* @GST_VAAPI_CHROMA_TYPE_YUV420_10BPP: YUV 4:2:0 chroma format, more than 8 bits per channel
* @GST_VAAPI_CHROMA_TYPE_YUV422_10BPP: YUV 4:2:2 chroma format, more than 8 bits per channel
* @GST_VAAPI_CHROMA_TYPE_RGB32: 32-bit RGB chroma format
* @GST_VAAPI_CHROMA_TYPE_RGBP: Planar RGB, 8 bits per colour sample.
* @GST_VAAPI_CHROMA_TYPE_RGB32_10BPP: 32-bit RGB chroma format, 10 bits per colour sample
*
* The set of all chroma types for #GstVaapiSurface.
*/
@ -76,12 +81,17 @@ typedef enum
GST_VAAPI_CHROMA_TYPE_YUV422,
GST_VAAPI_CHROMA_TYPE_YUV444,
GST_VAAPI_CHROMA_TYPE_YUV411,
GST_VAAPI_CHROMA_TYPE_YUV410,
GST_VAAPI_CHROMA_TYPE_YUV400,
GST_VAAPI_CHROMA_TYPE_RGB32,
GST_VAAPI_CHROMA_TYPE_RGB16,
GST_VAAPI_CHROMA_TYPE_YUV420_10BPP,
GST_VAAPI_CHROMA_TYPE_YUV422_10BPP,
GST_VAAPI_CHROMA_TYPE_YUV444_10BPP,
GST_VAAPI_CHROMA_TYPE_YUV420_12BPP,
GST_VAAPI_CHROMA_TYPE_YUV422_12BPP,
GST_VAAPI_CHROMA_TYPE_YUV444_12BPP,
GST_VAAPI_CHROMA_TYPE_RGB16,
GST_VAAPI_CHROMA_TYPE_RGB32,
GST_VAAPI_CHROMA_TYPE_RGBP,
GST_VAAPI_CHROMA_TYPE_RGB32_10BPP,
} GstVaapiChromaType;
/**

View file

@ -331,6 +331,14 @@ string_of_va_chroma_format (guint chroma_format)
#if VA_CHECK_VERSION(0,38,1)
MAP (YUV420_10BPP);
#endif
#if VA_CHECK_VERSION(1,2,0)
MAP (YUV422_10);
MAP (YUV444_10);
MAP (YUV420_12);
MAP (YUV422_12);
MAP (YUV444_12);
MAP (RGB32_10);
#endif
#undef MAP
default:
break;
@ -401,6 +409,9 @@ to_GstVaapiChromaType (guint va_rt_format)
case VA_RT_FORMAT_RGB16:
chroma_type = GST_VAAPI_CHROMA_TYPE_RGB16;
break;
case VA_RT_FORMAT_RGBP:
chroma_type = GST_VAAPI_CHROMA_TYPE_RGBP;
break;
#endif
#if VA_CHECK_VERSION(0,38,1)
case VA_RT_FORMAT_YUV420_10BPP:
@ -411,6 +422,21 @@ to_GstVaapiChromaType (guint va_rt_format)
case VA_RT_FORMAT_YUV422_10:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV422_10BPP;
break;
case VA_RT_FORMAT_YUV444_10:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444_10BPP;
break;
case VA_RT_FORMAT_YUV420_12:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420_12BPP;
break;
case VA_RT_FORMAT_YUV422_12:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV422_12BPP;
break;
case VA_RT_FORMAT_YUV444_12:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444_12BPP;
break;
case VA_RT_FORMAT_RGB32_10:
chroma_type = GST_VAAPI_CHROMA_TYPE_RGB32_10BPP;
break;
#endif
default:
chroma_type = 0;
@ -454,6 +480,9 @@ from_GstVaapiChromaType (guint chroma_type)
case GST_VAAPI_CHROMA_TYPE_RGB16:
format = VA_RT_FORMAT_RGB16;
break;
case GST_VAAPI_CHROMA_TYPE_RGBP:
format = VA_RT_FORMAT_RGBP;
break;
#endif
#if VA_CHECK_VERSION(0,38,1)
case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP:
@ -464,6 +493,21 @@ from_GstVaapiChromaType (guint chroma_type)
case GST_VAAPI_CHROMA_TYPE_YUV422_10BPP:
format = VA_RT_FORMAT_YUV422_10;
break;
case GST_VAAPI_CHROMA_TYPE_YUV444_10BPP:
format = VA_RT_FORMAT_YUV444_10;
break;
case GST_VAAPI_CHROMA_TYPE_YUV420_12BPP:
format = VA_RT_FORMAT_YUV420_12;
break;
case GST_VAAPI_CHROMA_TYPE_YUV422_12BPP:
format = VA_RT_FORMAT_YUV422_12;
break;
case GST_VAAPI_CHROMA_TYPE_YUV444_12BPP:
format = VA_RT_FORMAT_YUV444_12;
break;
case GST_VAAPI_CHROMA_TYPE_RGB32_10BPP:
format = VA_RT_FORMAT_RGB32_10;
break;
#endif
default:
format = 0;