Commit 075374cd authored by Nicolas Dufresne's avatar Nicolas Dufresne Committed by Gwenole Beauchesne

Change caps to use new video/x-surface generic type.

Signed-off-by: default avatarGwenole Beauchesne <gwenole.beauchesne@intel.com>
parent 99c5d18f
......@@ -134,6 +134,7 @@ libgstvaapi_@GST_MAJORMINOR@includedir = \
$(libgstvaapi_includedir)
libgstvaapi_@GST_MAJORMINOR@_la_CFLAGS = \
-DGST_USE_UNSTABLE_API \
-I$(top_srcdir)/gst-libs \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
......@@ -165,6 +166,7 @@ libgstvaapi_x11_@GST_MAJORMINOR@includedir = \
$(libgstvaapi_includedir)
libgstvaapi_x11_@GST_MAJORMINOR@_la_CFLAGS = \
-DGST_USE_UNSTABLE_API \
-I$(top_srcdir)/gst-libs \
$(GLIB_CFLAGS) \
$(GST_BASE_CFLAGS) \
......@@ -196,6 +198,7 @@ libgstvaapi_glx_@GST_MAJORMINOR@includedir = \
$(libgstvaapi_includedir)
libgstvaapi_glx_@GST_MAJORMINOR@_la_CFLAGS = \
-DGST_USE_UNSTABLE_API \
-I$(top_srcdir)/gst-libs \
$(GLIB_CFLAGS) \
$(GST_BASE_CFLAGS) \
......
......@@ -143,7 +143,8 @@ gst_vaapi_context_create_surfaces(GstVaapiContext *context)
if (!priv->surfaces_pool) {
caps = gst_caps_new_simple(
"video/x-vaapi-surface",
GST_VAAPI_SURFACE_CAPS_NAME,
"type", G_TYPE_STRING, "vaapi",
"width", G_TYPE_INT, priv->width,
"height", G_TYPE_INT, priv->height,
NULL
......
......@@ -27,6 +27,7 @@
#include <gst/vaapi/gstvaapidisplay.h>
#include <gst/vaapi/gstvaapiimage.h>
#include <gst/vaapi/gstvaapisubpicture.h>
#include <gst/video/gstsurfacebuffer.h>
G_BEGIN_DECLS
......@@ -39,18 +40,19 @@ typedef enum _GstVaapiSurfaceRenderFlags GstVaapiSurfaceRenderFlags;
*
* Generic caps type for VA surfaces.
*/
#define GST_VAAPI_SURFACE_CAPS_NAME \
"video/x-vaapi-surface"
#define GST_VAAPI_SURFACE_CAPS_NAME GST_VIDEO_CAPS_SURFACE
/**
* GST_VAAPI_SURFACE_CAPS:
*
* Generic caps for VA surfaces.
*/
#define GST_VAAPI_SURFACE_CAPS \
GST_VAAPI_SURFACE_CAPS_NAME ", " \
"width = (int) [ 1, MAX ]," \
"height = (int) [ 1, MAX ]," \
#define GST_VAAPI_SURFACE_CAPS \
GST_VAAPI_SURFACE_CAPS_NAME ", " \
"type = vaapi, " \
"opengl = (boolean) { true, false }, " \
"width = (int) [ 1, MAX ], " \
"height = (int) [ 1, MAX ], " \
"framerate = (fraction) [ 0, MAX ]"
/**
......
......@@ -462,7 +462,7 @@ gst_vaapiconvert_transform_caps(
out_caps = gst_caps_from_string(gst_vaapiconvert_vaapi_caps_str);
}
else {
if (!gst_structure_has_name(structure, "video/x-vaapi-surface"))
if (!gst_structure_has_name(structure, GST_VAAPI_SURFACE_CAPS_NAME))
return NULL;
out_caps = gst_caps_from_string(gst_vaapiconvert_yuv_caps_str);
if (convert->display) {
......@@ -667,7 +667,7 @@ gst_vaapiconvert_get_unit_size(
GstVideoFormat format;
gint width, height;
if (gst_structure_has_name(structure, "video/x-vaapi-surface"))
if (gst_structure_has_name(structure, GST_VAAPI_SURFACE_CAPS_NAME))
*size = 0;
else {
if (!gst_video_format_parse_caps(caps, &format, &width, &height))
......
......@@ -499,7 +499,7 @@ gst_vaapisink_buffer_alloc(
goto error_ensure_display;
structure = gst_caps_get_structure(caps, 0);
if (!gst_structure_has_name(structure, "video/x-vaapi-surface"))
if (!gst_structure_has_name(structure, GST_VAAPI_SURFACE_CAPS_NAME))
goto error_invalid_caps;
buffer = gst_vaapi_video_buffer_new(sink->display);
......
......@@ -11,7 +11,7 @@ noinst_PROGRAMS += \
$(NULL)
endif
TEST_CFLAGS = $(LIBVA_CFLAGS) -I$(top_srcdir)/gst-libs $(GST_CFLAGS)
TEST_CFLAGS = $(LIBVA_CFLAGS) -I$(top_srcdir)/gst-libs $(GST_CFLAGS) -DGST_USE_UNSTABLE_API
TEST_X11_CFLAGS = -DUSE_X11 $(X11_CFLAGS)
TEST_GLX_CFLAGS = -DUSE_GLX $(GLX_CFLAGS)
TEST_MIX_CFLAGS = $(TEST_X11_CFLAGS)
......
......@@ -66,7 +66,8 @@ main(int argc, char *argv[])
g_object_unref(surface);
caps = gst_caps_new_simple(
"video/x-vaapi-surface",
GST_VAAPI_SURFACE_CAPS_NAME,
"type", G_TYPE_STRING, "vaapi",
"width", G_TYPE_INT, width,
"height", G_TYPE_INT, height,
NULL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment