diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2020-01-24 22:08:50 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2020-02-23 13:12:15 +0100 |
commit | 8c08ef31a5ce6c69ae0502b174ec591c0d0d8d2a (patch) | |
tree | 5e88f7002354757384551501efbc55b6ddf26877 /gst-libs | |
parent | 3ff51a6e5232ce529777ce5856c2afc12526a9c2 (diff) |
libs: surface: surfacepool: Add allocation flags in constructors.
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapicontext.c | 4 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurface.c | 6 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurface.h | 3 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurface_egl.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurfacepool.c | 13 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurfacepool.h | 5 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiwindow.c | 2 |
7 files changed, 22 insertions, 13 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapicontext.c b/gst-libs/gst/vaapi/gstvaapicontext.c index 315f9324..e4839d3e 100644 --- a/gst-libs/gst/vaapi/gstvaapicontext.c +++ b/gst-libs/gst/vaapi/gstvaapicontext.c @@ -171,7 +171,7 @@ context_ensure_surfaces (GstVaapiContext * context) for (i = context->surfaces->len; i < num_surfaces; i++) { if (format != GST_VIDEO_FORMAT_UNKNOWN) { surface = gst_vaapi_surface_new_with_format (display, format, cip->width, - cip->height); + cip->height, 0); } else { surface = gst_vaapi_surface_new (display, cip->chroma_type, cip->width, cip->height); @@ -204,7 +204,7 @@ context_create_surfaces (GstVaapiContext * context) if (!context->surfaces_pool) { context->surfaces_pool = gst_vaapi_surface_pool_new_with_chroma_type (display, cip->chroma_type, - cip->width, cip->height); + cip->width, cip->height, 0); if (!context->surfaces_pool) return FALSE; diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 6aa3301a..24da248d 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -426,6 +426,7 @@ error: * @format: the surface format * @width: the requested surface width * @height: the requested surface height + * @surface_allocation_flags: (optional) allocation flags * * Creates a new #GstVaapiSurface with the specified pixel format and * dimensions. @@ -436,12 +437,13 @@ error: */ GstVaapiSurface * gst_vaapi_surface_new_with_format (GstVaapiDisplay * display, - GstVideoFormat format, guint width, guint height) + GstVideoFormat format, guint width, guint height, + guint surface_allocation_flags) { GstVideoInfo vi; gst_video_info_set_format (&vi, format, width, height); - return gst_vaapi_surface_new_full (display, &vi, 0); + return gst_vaapi_surface_new_full (display, &vi, surface_allocation_flags); } /** diff --git a/gst-libs/gst/vaapi/gstvaapisurface.h b/gst-libs/gst/vaapi/gstvaapisurface.h index adc9aa89..be70ce9f 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.h +++ b/gst-libs/gst/vaapi/gstvaapisurface.h @@ -216,7 +216,8 @@ gst_vaapi_surface_new_full (GstVaapiDisplay * display, GstVaapiSurface * gst_vaapi_surface_new_with_format (GstVaapiDisplay * display, - GstVideoFormat format, guint width, guint height); + GstVideoFormat format, guint width, guint height, + guint surface_allocation_flags); GstVaapiSurface * gst_vaapi_surface_new_from_buffer_proxy (GstVaapiDisplay * display, diff --git a/gst-libs/gst/vaapi/gstvaapisurface_egl.c b/gst-libs/gst/vaapi/gstvaapisurface_egl.c index 02997434..f5aaa746 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface_egl.c +++ b/gst-libs/gst/vaapi/gstvaapisurface_egl.c @@ -147,7 +147,7 @@ create_surface_from_egl_image (GstVaapiDisplayEGL * display, GST_VAAPI_CHROMA_TYPE_YUV420, width, height); } else { out_surface = gst_vaapi_surface_new_with_format (base_display, - GST_VIDEO_INFO_FORMAT (vip), width, height); + GST_VIDEO_INFO_FORMAT (vip), width, height, 0); } if (!out_surface) goto error_create_surface; diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.c b/gst-libs/gst/vaapi/gstvaapisurfacepool.c index c11d7796..5ad85f0e 100644 --- a/gst-libs/gst/vaapi/gstvaapisurfacepool.c +++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.c @@ -108,6 +108,7 @@ gst_vaapi_surface_pool_class (void) * @format: a #GstVideoFormat * @width: the desired width, in pixels * @height: the desired height, in pixels + * @surface_allocation_flags: (optional) allocation flags * * Creates a new #GstVaapiVideoPool of #GstVaapiSurface with the specified * format and dimensions. If @format is GST_VIDEO_FORMAT_ENCODED, then @@ -118,7 +119,7 @@ gst_vaapi_surface_pool_class (void) */ GstVaapiVideoPool * gst_vaapi_surface_pool_new (GstVaapiDisplay * display, GstVideoFormat format, - guint width, guint height) + guint width, guint height, guint surface_allocation_flags) { GstVideoInfo vi; @@ -127,7 +128,8 @@ gst_vaapi_surface_pool_new (GstVaapiDisplay * display, GstVideoFormat format, g_return_val_if_fail (height > 0, NULL); gst_video_info_set_format (&vi, format, width, height); - return gst_vaapi_surface_pool_new_full (display, &vi, 0); + return gst_vaapi_surface_pool_new_full (display, &vi, + surface_allocation_flags); } /** @@ -176,6 +178,7 @@ error: * @chroma_type: a #GstVaapiChromatype * @width: the desired width, in pixels * @height: the desired height, in pixels + * @surface_allocation_flags: (optional) allocation flags * * Creates a new #GstVaapiVideoPool of #GstVaapiSurface with the specified * chroma type and dimensions. The underlying format of the surfaces is @@ -185,7 +188,8 @@ error: */ GstVaapiVideoPool * gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display, - GstVaapiChromaType chroma_type, guint width, guint height) + GstVaapiChromaType chroma_type, guint width, guint height, + guint surface_allocation_flags) { GstVaapiVideoPool *pool; GstVideoInfo vi; @@ -197,7 +201,8 @@ gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display, gst_video_info_set_format (&vi, GST_VIDEO_FORMAT_ENCODED, width, height); - pool = gst_vaapi_surface_pool_new_full (display, &vi, 0); + pool = + gst_vaapi_surface_pool_new_full (display, &vi, surface_allocation_flags); if (!pool) return NULL; diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.h b/gst-libs/gst/vaapi/gstvaapisurfacepool.h index 9729a503..1fa7fe1b 100644 --- a/gst-libs/gst/vaapi/gstvaapisurfacepool.h +++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.h @@ -38,7 +38,7 @@ typedef struct _GstVaapiSurfacePool GstVaapiSurfacePool; GstVaapiVideoPool * gst_vaapi_surface_pool_new (GstVaapiDisplay * display, GstVideoFormat format, - guint width, guint height); + guint width, guint height, guint surface_allocation_flags); GstVaapiVideoPool * gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display, @@ -46,7 +46,8 @@ gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display, GstVaapiVideoPool * gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display, - GstVaapiChromaType chroma_type, guint width, guint height); + GstVaapiChromaType chroma_type, guint width, guint height, + guint surface_allocation_flags); G_END_DECLS diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.c b/gst-libs/gst/vaapi/gstvaapiwindow.c index 75b9e0e6..1af80377 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow.c @@ -109,7 +109,7 @@ ensure_filter_surface_pool (GstVaapiWindow * window) /* Ensure VA surface pool is created */ /* XXX: optimize the surface format to use. e.g. YUY2 */ window->surface_pool = gst_vaapi_surface_pool_new (display, - GST_VIDEO_FORMAT_NV12, window->width, window->height); + GST_VIDEO_FORMAT_NV12, window->width, window->height, 0); if (!window->surface_pool) { GST_WARNING ("failed to create surface pool for conversion"); return FALSE; |