summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-22 10:42:35 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-28 12:00:12 +0100
commitdd3df4589d2414bce092806e7dbe669b15022f69 (patch)
tree07744b0e57ee69f296fb0514f3eea74191f4cffd
parent477888272867b112ef1b19f0ee925adae973f92e (diff)
libs: surface: surfacepool: rename variable for clearity
In order to be readable, the meaningless 'flags' is renamed to surface_allocation_flags, which is clearer.
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurface.c19
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurface.h2
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurfacepool.c11
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurfacepool.h2
4 files changed, 18 insertions, 16 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c
index 6a4cb6a0..fac1174e 100644
--- a/gst-libs/gst/vaapi/gstvaapisurface.c
+++ b/gst-libs/gst/vaapi/gstvaapisurface.c
@@ -131,7 +131,7 @@ error_unsupported_chroma_type:
static gboolean
gst_vaapi_surface_init_full (GstVaapiSurface * surface,
- const GstVideoInfo * vip, guint flags)
+ const GstVideoInfo * vip, guint surface_allocation_flags)
{
GstVaapiDisplay *const display = GST_VAAPI_SURFACE_DISPLAY (surface);
const GstVideoFormat format = GST_VIDEO_INFO_FORMAT (vip);
@@ -159,18 +159,18 @@ gst_vaapi_surface_init_full (GstVaapiSurface * surface,
extbuf.pixel_format = va_format->fourcc;
extbuf.width = GST_VIDEO_INFO_WIDTH (vip);
extbuf.height = GST_VIDEO_INFO_HEIGHT (vip);
- if (flags & GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE) {
+ if (surface_allocation_flags & GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE) {
extbuf.flags &= ~VA_SURFACE_EXTBUF_DESC_ENABLE_TILING;
extbuf_needed = TRUE;
}
extbuf.num_planes = GST_VIDEO_INFO_N_PLANES (vip);
- if (flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_STRIDES) {
+ if (surface_allocation_flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_STRIDES) {
for (i = 0; i < extbuf.num_planes; i++)
extbuf.pitches[i] = GST_VIDEO_INFO_PLANE_STRIDE (vip, i);
extbuf_needed = TRUE;
}
- if (flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_OFFSETS) {
+ if (surface_allocation_flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_OFFSETS) {
for (i = 0; i < extbuf.num_planes; i++)
extbuf.offsets[i] = GST_VIDEO_INFO_PLANE_OFFSET (vip, i);
extbuf_needed = TRUE;
@@ -385,7 +385,7 @@ error:
* gst_vaapi_surface_new_full:
* @display: a #GstVaapiDisplay
* @vip: the pointer to a #GstVideoInfo
- * @flags: (optional) allocation flags
+ * @surface_allocation_flags: (optional) allocation flags
*
* Creates a new #GstVaapiSurface with the specified video information
* and optional #GstVaapiSurfaceAllocFlags
@@ -395,20 +395,21 @@ error:
* supported or failed.
*/
GstVaapiSurface *
-gst_vaapi_surface_new_full (GstVaapiDisplay * display,
- const GstVideoInfo * vip, guint flags)
+gst_vaapi_surface_new_full (GstVaapiDisplay * display, const GstVideoInfo * vip,
+ guint surface_allocation_flags)
{
GstVaapiSurface *surface;
GST_DEBUG ("size %ux%u, format %s, flags 0x%08x", GST_VIDEO_INFO_WIDTH (vip),
GST_VIDEO_INFO_HEIGHT (vip),
- gst_vaapi_video_format_to_string (GST_VIDEO_INFO_FORMAT (vip)), flags);
+ gst_vaapi_video_format_to_string (GST_VIDEO_INFO_FORMAT (vip)),
+ surface_allocation_flags);
surface = gst_vaapi_surface_create (display);
if (!surface)
return NULL;
- if (!gst_vaapi_surface_init_full (surface, vip, flags))
+ if (!gst_vaapi_surface_init_full (surface, vip, surface_allocation_flags))
goto error;
return surface;
diff --git a/gst-libs/gst/vaapi/gstvaapisurface.h b/gst-libs/gst/vaapi/gstvaapisurface.h
index 13de604e..adc9aa89 100644
--- a/gst-libs/gst/vaapi/gstvaapisurface.h
+++ b/gst-libs/gst/vaapi/gstvaapisurface.h
@@ -212,7 +212,7 @@ gst_vaapi_surface_new (GstVaapiDisplay * display,
GstVaapiSurface *
gst_vaapi_surface_new_full (GstVaapiDisplay * display,
- const GstVideoInfo * vip, guint flags);
+ const GstVideoInfo * vip, guint surface_allocation_flags);
GstVaapiSurface *
gst_vaapi_surface_new_with_format (GstVaapiDisplay * display,
diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.c b/gst-libs/gst/vaapi/gstvaapisurfacepool.c
index 4152fbfd..c11d7796 100644
--- a/gst-libs/gst/vaapi/gstvaapisurfacepool.c
+++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.c
@@ -51,12 +51,12 @@ struct _GstVaapiSurfacePool
static gboolean
surface_pool_init (GstVaapiSurfacePool * pool, const GstVideoInfo * vip,
- guint flags)
+ guint surface_allocation_flags)
{
const GstVideoFormat format = GST_VIDEO_INFO_FORMAT (vip);
pool->video_info = *vip;
- pool->alloc_flags = flags;
+ pool->alloc_flags = surface_allocation_flags;
if (format == GST_VIDEO_FORMAT_UNKNOWN)
return FALSE;
@@ -134,7 +134,7 @@ gst_vaapi_surface_pool_new (GstVaapiDisplay * display, GstVideoFormat format,
* gst_vaapi_surface_pool_new_full:
* @display: a #GstVaapiDisplay
* @vip: a #GstVideoInfo
- * @flags: (optional) allocation flags
+ * @surface_allocation_flags: (optional) allocation flags
*
* Creates a new #GstVaapiVideoPool of #GstVaapiSurface with the
* specified format and dimensions in @vip.
@@ -143,7 +143,7 @@ gst_vaapi_surface_pool_new (GstVaapiDisplay * display, GstVideoFormat format,
*/
GstVaapiVideoPool *
gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display,
- const GstVideoInfo * vip, guint flags)
+ const GstVideoInfo * vip, guint surface_allocation_flags)
{
GstVaapiVideoPool *pool;
@@ -157,7 +157,8 @@ gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display,
gst_vaapi_video_pool_init (pool, display,
GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_SURFACE);
- if (!surface_pool_init (GST_VAAPI_SURFACE_POOL (pool), vip, flags))
+ if (!surface_pool_init (GST_VAAPI_SURFACE_POOL (pool), vip,
+ surface_allocation_flags))
goto error;
return pool;
diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.h b/gst-libs/gst/vaapi/gstvaapisurfacepool.h
index 8c5a1efe..9729a503 100644
--- a/gst-libs/gst/vaapi/gstvaapisurfacepool.h
+++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.h
@@ -42,7 +42,7 @@ gst_vaapi_surface_pool_new (GstVaapiDisplay * display, GstVideoFormat format,
GstVaapiVideoPool *
gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display,
- const GstVideoInfo * vip, guint flags);
+ const GstVideoInfo * vip, guint surface_allocation_flags);
GstVaapiVideoPool *
gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display,