libs: video-format: add GST_VAAPI_FORMATS_ALL

GST_VAAPI_FORMATS_ALL collects all declared formats in video-format
as a caps template string, and make them available in caps with
memory:VASurface feature.

Fixes: #199
This commit is contained in:
He Junyan 2019-10-31 00:59:34 +08:00 committed by Víctor Manuel Jáquez Leal
parent a8be369840
commit f16c93a187
3 changed files with 15 additions and 7 deletions

View file

@ -58,6 +58,9 @@ typedef struct _GstVideoFormatMapMap
{ VA_FOURCC FOURCC, BYTE_ORDER, BPP, DEPTH, R, G, B, A }, }
/* Image formats, listed in HW order preference */
/* XXX: The new added video format must be added to
* GST_VAAPI_FORMATS_ALL in header file to make it available to all
* vaapi element's pad cap template. */
/* *INDENT-OFF* */
static const GstVideoFormatMap gst_vaapi_video_default_formats[] = {
/* LSB and MSB video formats definitions are unclear and ambiguous.

View file

@ -29,6 +29,11 @@
G_BEGIN_DECLS
#define GST_VAAPI_FORMATS_ALL "{ ENCODED, " \
"NV12, YV12, I420, YUY2, UYVY, Y444, GRAY8, P010_10LE, VUYA, Y210, Y410, " \
"ARGB, xRGB, RGBA, RGBx, ABGR, xBGR, BGRA, BGRx, RGB16, RGB, BGR10A2_LE " \
"}"
const gchar *
gst_vaapi_video_format_to_string (GstVideoFormat format);

View file

@ -103,16 +103,16 @@ gst_vaapi_caps_feature_contains (const GstCaps * caps,
# define GST_CAPS_INTERLACED_FALSE \
"interlace-mode = (string)progressive"
#define GST_VAAPI_MAKE_SURFACE_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV, Y410, Y444 }")
#define GST_VAAPI_MAKE_SURFACE_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, GST_VAAPI_FORMATS_ALL)
#define GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
#define GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, "{ RGBA, BGRA }")
#define GST_VAAPI_MAKE_DMABUF_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
#define GST_VAAPI_MAKE_DMABUF_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
GST_CAPS_FEATURE_MEMORY_DMABUF, "{ I420, YV12, RGBA }")
G_GNUC_INTERNAL