diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-05-23 18:45:23 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-05-23 19:01:34 +0200 |
commit | 809c7e097b62166ab51caf666d1bf810a952e354 (patch) | |
tree | 6de6efda9290e0b249f6100cc7521f1dec3a562d | |
parent | 67eea920446b332a451e0d6dcb62c2374ac87634 (diff) |
libs: add query for GstVaapiVideoPool object types.
Add API to identify the underlying GstVaapiVideoPool object type.
-rw-r--r-- | docs/reference/libs/libs-sections.txt | 2 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiimagepool.c | 3 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurfacepool.c | 3 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapivideopool.c | 21 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapivideopool.h | 15 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapivideopool_priv.h | 4 |
6 files changed, 43 insertions, 5 deletions
diff --git a/docs/reference/libs/libs-sections.txt b/docs/reference/libs/libs-sections.txt index 423704c1..e25b0e64 100644 --- a/docs/reference/libs/libs-sections.txt +++ b/docs/reference/libs/libs-sections.txt @@ -5,7 +5,6 @@ GstVaapiSurfacePool gst_vaapi_surface_pool_new <SUBSECTION Standard> GST_VAAPI_SURFACE_POOL -gst_vaapi_surface_pool_get_type </SECTION> <SECTION> @@ -13,6 +12,7 @@ gst_vaapi_surface_pool_get_type <TITLE>GstVaapiVideoPool</TITLE> GstVaapiVideoPool gst_vaapi_video_pool_get_display +gst_vaapi_video_pool_get_object_type gst_vaapi_video_pool_get_object gst_vaapi_video_pool_put_object gst_vaapi_video_pool_add_object diff --git a/gst-libs/gst/vaapi/gstvaapiimagepool.c b/gst-libs/gst/vaapi/gstvaapiimagepool.c index 7f262e97..dd3868ac 100644 --- a/gst-libs/gst/vaapi/gstvaapiimagepool.c +++ b/gst-libs/gst/vaapi/gstvaapiimagepool.c @@ -105,7 +105,8 @@ gst_vaapi_image_pool_new(GstVaapiDisplay *display, GstCaps *caps) if (!pool) return NULL; - gst_vaapi_video_pool_init(pool, display); + gst_vaapi_video_pool_init(pool, display, + GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE); if (!gst_vaapi_image_pool_set_caps(pool, caps)) goto error; return pool; diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.c b/gst-libs/gst/vaapi/gstvaapisurfacepool.c index d39588d2..f429b9d2 100644 --- a/gst-libs/gst/vaapi/gstvaapisurfacepool.c +++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.c @@ -105,7 +105,8 @@ gst_vaapi_surface_pool_new(GstVaapiDisplay *display, GstCaps *caps) if (!pool) return NULL; - gst_vaapi_video_pool_init(pool, display); + gst_vaapi_video_pool_init(pool, display, + GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_SURFACE); if (!gst_vaapi_surface_pool_set_caps(pool, caps)) goto error; return pool; diff --git a/gst-libs/gst/vaapi/gstvaapivideopool.c b/gst-libs/gst/vaapi/gstvaapivideopool.c index 360c9ed3..23912e61 100644 --- a/gst-libs/gst/vaapi/gstvaapivideopool.c +++ b/gst-libs/gst/vaapi/gstvaapivideopool.c @@ -54,8 +54,10 @@ gst_vaapi_video_pool_alloc_object(GstVaapiVideoPool *pool) } void -gst_vaapi_video_pool_init(GstVaapiVideoPool *pool, GstVaapiDisplay *display) +gst_vaapi_video_pool_init(GstVaapiVideoPool *pool, GstVaapiDisplay *display, + GstVaapiVideoPoolObjectType object_type) { + pool->object_type = object_type; pool->display = gst_vaapi_display_ref(display); pool->used_objects = NULL; pool->used_count = 0; @@ -133,6 +135,23 @@ gst_vaapi_video_pool_get_display(GstVaapiVideoPool *pool) } /** + * gst_vaapi_video_pool_get_object_type: + * @pool: a #GstVaapiVideoPool + * + * Retrieves the type of objects the video @pool supports. + * + * Return value: the #GstVaapiVideoPoolObjectType of the underlying pool + * objects + */ +GstVaapiVideoPoolObjectType +gst_vaapi_video_pool_get_object_type(GstVaapiVideoPool *pool) +{ + g_return_val_if_fail(pool != NULL, (GstVaapiVideoPoolObjectType)0); + + return pool->object_type; +} + +/** * gst_vaapi_video_pool_get_object: * @pool: a #GstVaapiVideoPool * diff --git a/gst-libs/gst/vaapi/gstvaapivideopool.h b/gst-libs/gst/vaapi/gstvaapivideopool.h index 2f132775..03b6cffd 100644 --- a/gst-libs/gst/vaapi/gstvaapivideopool.h +++ b/gst-libs/gst/vaapi/gstvaapivideopool.h @@ -34,6 +34,18 @@ G_BEGIN_DECLS typedef struct _GstVaapiVideoPool GstVaapiVideoPool; +/** + * GstVaapiVideoPoolObjectType: + * @GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE: #GstVaapiImage objects. + * @GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_SURFACE: #GstVaapiSurface objects. + * + * The set of all supported #GstVaapiVideoPool object types. + */ +typedef enum { + GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE = 1, + GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_SURFACE +} GstVaapiVideoPoolObjectType; + GstVaapiVideoPool * gst_vaapi_video_pool_ref(GstVaapiVideoPool *pool); @@ -47,6 +59,9 @@ gst_vaapi_video_pool_replace(GstVaapiVideoPool **old_pool_ptr, GstVaapiDisplay * gst_vaapi_video_pool_get_display(GstVaapiVideoPool *pool); +GstVaapiVideoPoolObjectType +gst_vaapi_video_pool_get_object_type(GstVaapiVideoPool *pool); + gpointer gst_vaapi_video_pool_get_object(GstVaapiVideoPool *pool); diff --git a/gst-libs/gst/vaapi/gstvaapivideopool_priv.h b/gst-libs/gst/vaapi/gstvaapivideopool_priv.h index df664809..8da750e9 100644 --- a/gst-libs/gst/vaapi/gstvaapivideopool_priv.h +++ b/gst-libs/gst/vaapi/gstvaapivideopool_priv.h @@ -44,6 +44,7 @@ struct _GstVaapiVideoPool { /*< private >*/ GstVaapiMiniObject parent_instance; + guint object_type; GstVaapiDisplay *display; GQueue free_objects; GList *used_objects; @@ -67,7 +68,8 @@ struct _GstVaapiVideoPoolClass { G_GNUC_INTERNAL void -gst_vaapi_video_pool_init(GstVaapiVideoPool *pool, GstVaapiDisplay *display); +gst_vaapi_video_pool_init(GstVaapiVideoPool *pool, GstVaapiDisplay *display, + GstVaapiVideoPoolObjectType object_type); G_GNUC_INTERNAL void |