summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2001-01-01 04:59:28 +0200
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>2015-12-08 15:16:00 +0200
commit9ccdbce4bdf9cbd25db202ca81a1e5d89c180aee (patch)
treed84c5be0c0ac73b077300c41f059b47c9a3feac1
parent009c2c72c9f14d77fbadbcf9999f7e6d3b4d91cf (diff)
downloadgst-vaapi-9ccdbce4bdf9cbd25db202ca81a1e5d89c180aee.tar.gz
gstvaapisurfacepool: Add new API to create surface pool based on chroma type
This new API gst_vaapi_surface_pool_new_with_chroma_type() is for creating a new GstVaapiVideoPool of GstVaapiSurfaces with the specified chroam type and dimensions. The underlying format of the surfaces is implementation (driver) defined.
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurfacepool.c36
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurfacepool.h4
2 files changed, 40 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.c b/gst-libs/gst/vaapi/gstvaapisurfacepool.c
index 02c06060..65bc65c6 100644
--- a/gst-libs/gst/vaapi/gstvaapisurfacepool.c
+++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.c
@@ -164,3 +164,39 @@ error:
gst_vaapi_mini_object_unref (GST_VAAPI_MINI_OBJECT (pool));
return NULL;
}
+
+/**
+ * gst_vaapi_surface_pool_new_with_chroma_type:
+ * @display: a #GstVaapiDisplay
+ * @chroma_type: a #GstVaapiChromatype
+ * @width: the desired width, in pixels
+ * @height: the desired height, in pixels
+ *
+ * Creates a new #GstVaapiVideoPool of #GstVaapiSurface with the specified
+ * chroam type and dimensions. The underlying format of the surfaces is
+ * implementation (driver) defined.
+ *
+ * Return value: the newly allocated #GstVaapiVideoPool
+ */
+GstVaapiVideoPool *
+gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display,
+ GstVaapiChromaType chroma_type, guint width, guint height)
+{
+ GstVaapiVideoPool *pool;
+ GstVideoInfo vi;
+
+ g_return_val_if_fail (display != NULL, NULL);
+ g_return_val_if_fail (chroma_type > 0, NULL);
+ g_return_val_if_fail (width > 0, NULL);
+ g_return_val_if_fail (height > 0, NULL);
+
+ gst_video_info_set_format (&vi, GST_VIDEO_FORMAT_ENCODED, width, height);
+
+ pool = gst_vaapi_surface_pool_new_full (display, &vi, 0);
+ if (!pool)
+ return NULL;
+
+ GST_VAAPI_SURFACE_POOL (pool)->chroma_type = chroma_type;
+
+ return pool;
+}
diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.h b/gst-libs/gst/vaapi/gstvaapisurfacepool.h
index e0529a22..8c5a1efe 100644
--- a/gst-libs/gst/vaapi/gstvaapisurfacepool.h
+++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.h
@@ -44,6 +44,10 @@ GstVaapiVideoPool *
gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display,
const GstVideoInfo * vip, guint flags);
+GstVaapiVideoPool *
+gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display,
+ GstVaapiChromaType chroma_type, guint width, guint height);
+
G_END_DECLS
#endif /* GST_VAAPI_SURFACE_POOL_H */