Request the correct chroma format for decoding grayscale streams.
i.e. make lookups of the VA chroma format more generic, thus possibly
supporting more formats in the future.
This means that, if a VA driver doesn't support grayscale formats,
it is now going to fail. We cannot safely assume that maybe grayscale
was implemented on top of some YUV 4:2:0 with the chroma components
all set to 0x80.
attrib->type = VAConfigAttribRTFormat;
if (!context_get_attribute (context, attrib->type, &value))
goto cleanup;
- if (!(value & va_chroma_format))
+ if (!(value & va_chroma_format)) {
+ GST_ERROR ("unsupported chroma format (%s)",
+ string_of_va_chroma_format (va_chroma_format));
goto cleanup;
+ }
attrib->value = va_chroma_format;
attrib++;
/* XXX: fix surface size when cropping is implemented */
info.profile = priv->profile;
info.entrypoint = priv->entrypoint;
- info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
+ info.chroma_type = priv->chroma_type;
info.width = sps->width;
info.height = sps->height;
info.ref_frames = get_max_dec_frame_buffering(sps);
return "<unknown>";
}
+/* Return a string representation of a VA chroma format */
+const gchar *
+string_of_va_chroma_format (guint chroma_format)
+{
+ switch (chroma_format) {
+#define MAP(value) \
+ STRCASEP(VA_RT_FORMAT_, value)
+ MAP (YUV420);
+ MAP (YUV422);
+ MAP (YUV444);
+#if VA_CHECK_VERSION(0,34,0)
+ MAP (YUV400);
+ MAP (RGB16);
+ MAP (RGB32);
+ MAP (RGBP);
+#endif
+#undef MAP
+ default:
+ break;
+ }
+ return "<unknown>";
+}
+
const gchar *
string_of_VARateControl (guint rate_control)
{
const gchar *
string_of_VADisplayAttributeType (VADisplayAttribType attribute_type);
+/* Return a string representation of a VA chroma format */
+G_GNUC_INTERNAL
+const gchar *
+string_of_va_chroma_format (guint chroma_format);
+
G_GNUC_INTERNAL
const gchar *
string_of_VARateControl (guint rate_control);