summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2019-10-31 00:59:34 +0800
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-11-27 01:44:49 +0100
commitf16c93a187f6bb682a86a2540ee9158c3ad9d398 (patch)
treecba6ef1c6105178c5db83b17a54d95fc0079589a
parenta8be3698406a97a98ce87216275892a110317689 (diff)
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
-rw-r--r--gst-libs/gst/vaapi/video-format.c3
-rw-r--r--gst-libs/gst/vaapi/video-format.h5
-rw-r--r--gst/vaapi/gstvaapipluginutil.h14
3 files changed, 15 insertions, 7 deletions
diff --git a/gst-libs/gst/vaapi/video-format.c b/gst-libs/gst/vaapi/video-format.c
index eac6ac5c..023a8966 100644
--- a/gst-libs/gst/vaapi/video-format.c
+++ b/gst-libs/gst/vaapi/video-format.c
@@ -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.
diff --git a/gst-libs/gst/vaapi/video-format.h b/gst-libs/gst/vaapi/video-format.h
index cef8c504..466e115a 100644
--- a/gst-libs/gst/vaapi/video-format.h
+++ b/gst-libs/gst/vaapi/video-format.h
@@ -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);
diff --git a/gst/vaapi/gstvaapipluginutil.h b/gst/vaapi/gstvaapipluginutil.h
index 293b4092..bba668b7 100644
--- a/gst/vaapi/gstvaapipluginutil.h
+++ b/gst/vaapi/gstvaapipluginutil.h
@@ -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