Add API to identify the underlying GstVaapiVideoPool object type.
gst_vaapi_surface_pool_new
<SUBSECTION Standard>
GST_VAAPI_SURFACE_POOL
-gst_vaapi_surface_pool_get_type
</SECTION>
<SECTION>
<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
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;
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;
}
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;
}
/**
+ * 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
*
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);
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);
/*< private >*/
GstVaapiMiniObject parent_instance;
+ guint object_type;
GstVaapiDisplay *display;
GQueue free_objects;
GList *used_objects;
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