libs: codedbuffer: port to GstMiniObject

GstVaapiMiniObject and GstVaapiObject are deprecated.

This is the first step to remove them by porting GstVaapiCodedBuffer
as a GstMiniBuffer descendant.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
This commit is contained in:
He Junyan 2019-12-18 18:00:49 +01:00 committed by GStreamer Merge Bot
parent d56824c05c
commit 6bf33ada4f
14 changed files with 98 additions and 49 deletions

View file

@ -34,7 +34,7 @@ static gboolean
coded_buffer_create (GstVaapiCodedBuffer * buf, guint buf_size, coded_buffer_create (GstVaapiCodedBuffer * buf, guint buf_size,
GstVaapiContext * context) GstVaapiContext * context)
{ {
GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (buf); GstVaapiDisplay *const display = GST_VAAPI_CODED_BUFFER_DISPLAY (buf);
VABufferID buf_id; VABufferID buf_id;
gboolean success; gboolean success;
@ -47,56 +47,62 @@ coded_buffer_create (GstVaapiCodedBuffer * buf, guint buf_size,
return FALSE; return FALSE;
GST_DEBUG ("coded buffer %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS (buf_id)); GST_DEBUG ("coded buffer %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS (buf_id));
GST_VAAPI_OBJECT_ID (buf) = buf_id; GST_VAAPI_CODED_BUFFER_ID (buf) = buf_id;
return TRUE; return TRUE;
} }
static void static void
coded_buffer_destroy (GstVaapiCodedBuffer * buf) coded_buffer_free (GstVaapiCodedBuffer * buf)
{ {
GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (buf); GstVaapiDisplay *const display = GST_VAAPI_CODED_BUFFER_DISPLAY (buf);
VABufferID buf_id; VABufferID buf_id;
buf_id = GST_VAAPI_OBJECT_ID (buf); buf_id = GST_VAAPI_CODED_BUFFER_ID (buf);
GST_DEBUG ("coded buffer %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS (buf_id)); GST_DEBUG ("coded buffer %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS (buf_id));
if (buf_id != VA_INVALID_ID) { if (buf_id != VA_INVALID_ID) {
GST_VAAPI_DISPLAY_LOCK (display); GST_VAAPI_DISPLAY_LOCK (display);
vaapi_destroy_buffer (GST_VAAPI_DISPLAY_VADISPLAY (display), &buf_id); vaapi_destroy_buffer (GST_VAAPI_DISPLAY_VADISPLAY (display), &buf_id);
GST_VAAPI_DISPLAY_UNLOCK (display); GST_VAAPI_DISPLAY_UNLOCK (display);
GST_VAAPI_OBJECT_ID (buf) = VA_INVALID_ID; GST_VAAPI_CODED_BUFFER_ID (buf) = VA_INVALID_ID;
} }
gst_vaapi_display_replace (&GST_VAAPI_CODED_BUFFER_DISPLAY (buf), NULL);
g_slice_free1 (sizeof (GstVaapiCodedBuffer), buf);
} }
static gboolean static gboolean
coded_buffer_map (GstVaapiCodedBuffer * buf) coded_buffer_map (GstVaapiCodedBuffer * buf)
{ {
GstVaapiDisplay *const display = GST_VAAPI_CODED_BUFFER_DISPLAY (buf);
if (buf->segment_list) if (buf->segment_list)
return TRUE; return TRUE;
GST_VAAPI_OBJECT_LOCK_DISPLAY (buf); GST_VAAPI_DISPLAY_LOCK (display);
buf->segment_list = vaapi_map_buffer (GST_VAAPI_OBJECT_VADISPLAY (buf), buf->segment_list =
GST_VAAPI_OBJECT_ID (buf)); vaapi_map_buffer (GST_VAAPI_DISPLAY_VADISPLAY (display),
GST_VAAPI_OBJECT_UNLOCK_DISPLAY (buf); GST_VAAPI_CODED_BUFFER_ID (buf));
GST_VAAPI_DISPLAY_UNLOCK (display);
return buf->segment_list != NULL; return buf->segment_list != NULL;
} }
static void static void
coded_buffer_unmap (GstVaapiCodedBuffer * buf) coded_buffer_unmap (GstVaapiCodedBuffer * buf)
{ {
GstVaapiDisplay *const display = GST_VAAPI_CODED_BUFFER_DISPLAY (buf);
if (!buf->segment_list) if (!buf->segment_list)
return; return;
GST_VAAPI_OBJECT_LOCK_DISPLAY (buf); GST_VAAPI_DISPLAY_LOCK (display);
vaapi_unmap_buffer (GST_VAAPI_OBJECT_VADISPLAY (buf), vaapi_unmap_buffer (GST_VAAPI_DISPLAY_VADISPLAY (display),
GST_VAAPI_OBJECT_ID (buf), (void **) &buf->segment_list); GST_VAAPI_CODED_BUFFER_ID (buf), (void **) &buf->segment_list);
GST_VAAPI_OBJECT_UNLOCK_DISPLAY (buf); GST_VAAPI_DISPLAY_UNLOCK (display);
} }
/* *INDENT-OFF* */ GST_DEFINE_MINI_OBJECT_TYPE (GstVaapiCodedBuffer, gst_vaapi_coded_buffer);
#define gst_vaapi_coded_buffer_finalize coded_buffer_destroy
GST_VAAPI_OBJECT_DEFINE_CLASS (GstVaapiCodedBuffer, gst_vaapi_coded_buffer)
/* *INDENT-ON* */
/* /*
* gst_vaapi_coded_buffer_new: * gst_vaapi_coded_buffer_new:
@ -120,10 +126,18 @@ gst_vaapi_coded_buffer_new (GstVaapiContext * context, guint buf_size)
display = GST_VAAPI_CONTEXT_DISPLAY (context); display = GST_VAAPI_CONTEXT_DISPLAY (context);
g_return_val_if_fail (display != NULL, NULL); g_return_val_if_fail (display != NULL, NULL);
buf = gst_vaapi_object_new (gst_vaapi_coded_buffer_class (), display); buf = g_slice_new (GstVaapiCodedBuffer);
if (!buf) if (!buf)
return NULL; return NULL;
gst_mini_object_init (GST_MINI_OBJECT_CAST (buf), 0,
GST_TYPE_VAAPI_CODED_BUFFER, NULL, NULL,
(GstMiniObjectFreeFunction) coded_buffer_free);
GST_VAAPI_CODED_BUFFER_DISPLAY (buf) = gst_object_ref (display);
GST_VAAPI_CODED_BUFFER_ID (buf) = VA_INVALID_ID;
buf->segment_list = NULL;
if (!coded_buffer_create (buf, buf_size, context)) if (!coded_buffer_create (buf, buf_size, context))
goto error; goto error;
return buf; return buf;
@ -131,7 +145,7 @@ gst_vaapi_coded_buffer_new (GstVaapiContext * context, guint buf_size)
/* ERRORS */ /* ERRORS */
error: error:
{ {
gst_vaapi_object_unref (buf); gst_vaapi_coded_buffer_unref (buf);
return NULL; return NULL;
} }
} }

View file

@ -42,12 +42,33 @@ typedef struct _GstVaapiCodedBuffer GstVaapiCodedBuffer;
typedef struct _GstVaapiCodedBufferProxy GstVaapiCodedBufferProxy; typedef struct _GstVaapiCodedBufferProxy GstVaapiCodedBufferProxy;
typedef struct _GstVaapiCodedBufferPool GstVaapiCodedBufferPool; typedef struct _GstVaapiCodedBufferPool GstVaapiCodedBufferPool;
#define GST_TYPE_VAAPI_CODED_BUFFER (gst_vaapi_coded_buffer_get_type ())
GType
gst_vaapi_coded_buffer_get_type (void) G_GNUC_CONST;
/**
* gst_vaapi_coded_buffer_unref: (skip)
* @buf: (transfer full): a #GstVaapiCodedBuffer.
*
* Decreases the refcount of @buf. If the refcount reaches 0, the
* @buf will be freed.
*/
static inline void gst_vaapi_coded_buffer_unref(GstVaapiCodedBuffer* buf);
static inline void
gst_vaapi_coded_buffer_unref (GstVaapiCodedBuffer * buf)
{
gst_mini_object_unref (GST_MINI_OBJECT_CAST (buf));
}
gssize gssize
gst_vaapi_coded_buffer_get_size (GstVaapiCodedBuffer * buf); gst_vaapi_coded_buffer_get_size (GstVaapiCodedBuffer * buf);
gboolean gboolean
gst_vaapi_coded_buffer_copy_into (GstBuffer * dest, GstVaapiCodedBuffer * src); gst_vaapi_coded_buffer_copy_into (GstBuffer * dest, GstVaapiCodedBuffer * src);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiCodedBuffer, gst_vaapi_coded_buffer_unref)
G_END_DECLS G_END_DECLS
#endif /* GST_VAAPI_CODED_BUFFER_H */ #endif /* GST_VAAPI_CODED_BUFFER_H */

View file

@ -26,15 +26,12 @@
#include <gst/vaapi/gstvaapicontext.h> #include <gst/vaapi/gstvaapicontext.h>
#include "gstvaapicodedbuffer.h" #include "gstvaapicodedbuffer.h"
#include "gstvaapiobject_priv.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_VAAPI_CODED_BUFFER_CAST(obj) \ #define GST_VAAPI_CODED_BUFFER_CAST(obj) \
((GstVaapiCodedBuffer *)(obj)) ((GstVaapiCodedBuffer *)(obj))
typedef struct _GstVaapiCodedBufferClass GstVaapiCodedBufferClass;
/** /**
* GstVaapiCodedBuffer: * GstVaapiCodedBuffer:
* *
@ -43,22 +40,32 @@ typedef struct _GstVaapiCodedBufferClass GstVaapiCodedBufferClass;
struct _GstVaapiCodedBuffer struct _GstVaapiCodedBuffer
{ {
/*< private >*/ /*< private >*/
GstVaapiObject parent_instance; GstMiniObject mini_object;
GstVaapiDisplay *display;
GstVaapiID object_id;
/*< public >*/
GstVaapiContext *context; GstVaapiContext *context;
VACodedBufferSegment *segment_list; VACodedBufferSegment *segment_list;
}; };
/** /**
* GstVaapiCodedBufferClass: * GST_VAAPI_CODED_BUFFER_DISPLAY:
* @buf: a #GstVaapiCodedBuffer
* *
* A VA coded buffer object wrapper class. * Macro that evaluates to the #GstVaapiDisplay of @buf
*/ */
struct _GstVaapiCodedBufferClass #undef GST_VAAPI_CODED_BUFFER_DISPLAY
{ #define GST_VAAPI_CODED_BUFFER_DISPLAY(buf) (GST_VAAPI_CODED_BUFFER (buf)->display)
/*< private >*/
GstVaapiObjectClass parent_class; /**
}; * GST_VAAPI_CODED_BUFFER_ID:
* @buf: a #GstVaapiCodedBuffer
*
* Macro that evaluates to the object ID of @buf
*/
#undef GST_VAAPI_CODED_BUFFER_ID
#define GST_VAAPI_CODED_BUFFER_ID(buf) (GST_VAAPI_CODED_BUFFER (buf)->object_id)
G_GNUC_INTERNAL G_GNUC_INTERNAL
GstVaapiCodedBuffer * GstVaapiCodedBuffer *

View file

@ -45,7 +45,7 @@ coded_buffer_proxy_finalize (GstVaapiCodedBufferProxy * proxy)
if (proxy->buffer) { if (proxy->buffer) {
if (proxy->pool) if (proxy->pool)
gst_vaapi_video_pool_put_object (proxy->pool, proxy->buffer); gst_vaapi_video_pool_put_object (proxy->pool, proxy->buffer);
gst_vaapi_object_unref (proxy->buffer); gst_vaapi_coded_buffer_unref (proxy->buffer);
proxy->buffer = NULL; proxy->buffer = NULL;
} }
gst_vaapi_video_pool_replace (&proxy->pool, NULL); gst_vaapi_video_pool_replace (&proxy->pool, NULL);
@ -115,7 +115,7 @@ gst_vaapi_coded_buffer_proxy_new_from_pool (GstVaapiCodedBufferPool * pool)
#endif #endif
if (!proxy->buffer) if (!proxy->buffer)
goto error; goto error;
gst_vaapi_object_ref (proxy->buffer); gst_mini_object_ref (GST_MINI_OBJECT_CAST (proxy->buffer));
return proxy; return proxy;
/* ERRORS */ /* ERRORS */

View file

@ -2236,7 +2236,7 @@ fill_picture (GstVaapiEncoderH264 * encoder, GstVaapiEncPicture * picture,
for (; i < 16; ++i) { for (; i < 16; ++i) {
pic_param->ReferenceFrames[i].picture_id = VA_INVALID_ID; pic_param->ReferenceFrames[i].picture_id = VA_INVALID_ID;
} }
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
pic_param->pic_parameter_set_id = encoder->view_idx; pic_param->pic_parameter_set_id = encoder->view_idx;
pic_param->seq_parameter_set_id = encoder->view_idx ? 1 : 0; pic_param->seq_parameter_set_id = encoder->view_idx ? 1 : 0;

View file

@ -2015,7 +2015,7 @@ fill_picture (GstVaapiEncoderH264Fei * encoder, GstVaapiEncPicture * picture,
for (; i < 16; ++i) { for (; i < 16; ++i) {
pic_param->ReferenceFrames[i].picture_id = VA_INVALID_ID; pic_param->ReferenceFrames[i].picture_id = VA_INVALID_ID;
} }
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
pic_param->pic_parameter_set_id = encoder->view_idx; pic_param->pic_parameter_set_id = encoder->view_idx;
pic_param->seq_parameter_set_id = encoder->view_idx ? 1 : 0; pic_param->seq_parameter_set_id = encoder->view_idx ? 1 : 0;

View file

@ -1613,7 +1613,7 @@ fill_picture (GstVaapiEncoderH265 * encoder, GstVaapiEncPicture * picture,
pic_param->reference_frames[i].picture_id = VA_INVALID_SURFACE; pic_param->reference_frames[i].picture_id = VA_INVALID_SURFACE;
pic_param->reference_frames[i].flags = 0; pic_param->reference_frames[i].flags = 0;
} }
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
/* slice_temporal_mvp_enable_flag == FALSE */ /* slice_temporal_mvp_enable_flag == FALSE */
pic_param->collocated_ref_pic_index = 0xFF; pic_param->collocated_ref_pic_index = 0xFF;

View file

@ -214,7 +214,7 @@ fill_picture (GstVaapiEncoderJpeg * encoder,
GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface); GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface);
pic_param->picture_width = GST_VAAPI_ENCODER_WIDTH (encoder); pic_param->picture_width = GST_VAAPI_ENCODER_WIDTH (encoder);
pic_param->picture_height = GST_VAAPI_ENCODER_HEIGHT (encoder); pic_param->picture_height = GST_VAAPI_ENCODER_HEIGHT (encoder);
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
pic_param->pic_flags.bits.profile = 0; /* Profile = Baseline */ pic_param->pic_flags.bits.profile = 0; /* Profile = Baseline */
pic_param->pic_flags.bits.progressive = 0; /* Sequential encoding */ pic_param->pic_flags.bits.progressive = 0; /* Sequential encoding */

View file

@ -269,7 +269,7 @@ fill_picture (GstVaapiEncoderMpeg2 * encoder,
pic_param->reconstructed_picture = pic_param->reconstructed_picture =
GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface); GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface);
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
pic_param->picture_type = get_va_enc_picture_type (picture->type); pic_param->picture_type = get_va_enc_picture_type (picture->type);
pic_param->temporal_reference = picture->frame_num & (1024 - 1); pic_param->temporal_reference = picture->frame_num & (1024 - 1);
pic_param->vbv_delay = 0xFFFF; pic_param->vbv_delay = 0xFFFF;

View file

@ -304,7 +304,7 @@ fill_picture (GstVaapiEncoderVP8 * encoder,
memset (pic_param, 0, sizeof (VAEncPictureParameterBufferVP8)); memset (pic_param, 0, sizeof (VAEncPictureParameterBufferVP8));
pic_param->reconstructed_frame = GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface); pic_param->reconstructed_frame = GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface);
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
if (picture->type == GST_VAAPI_PICTURE_TYPE_P) { if (picture->type == GST_VAAPI_PICTURE_TYPE_P) {
pic_param->pic_flags.bits.frame_type = 1; pic_param->pic_flags.bits.frame_type = 1;

View file

@ -344,7 +344,7 @@ fill_picture (GstVaapiEncoderVP9 * encoder,
memset (pic_param, 0, sizeof (VAEncPictureParameterBufferVP9)); memset (pic_param, 0, sizeof (VAEncPictureParameterBufferVP9));
pic_param->reconstructed_frame = GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface); pic_param->reconstructed_frame = GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface);
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
/* Update Reference Frame list */ /* Update Reference Frame list */
if (picture->type == GST_VAAPI_PICTURE_TYPE_I) if (picture->type == GST_VAAPI_PICTURE_TYPE_I)

View file

@ -766,7 +766,7 @@ fill_picture (GstVaapiFeiEncH264 * feienc, GstVaapiEncPicture * picture,
pic_param->ReferenceFrames[i].flags = VA_PICTURE_H264_INVALID; pic_param->ReferenceFrames[i].flags = VA_PICTURE_H264_INVALID;
} }
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
pic_param->pic_parameter_set_id = feienc->view_idx; pic_param->pic_parameter_set_id = feienc->view_idx;
pic_param->seq_parameter_set_id = feienc->view_idx ? 1 : 0; pic_param->seq_parameter_set_id = feienc->view_idx ? 1 : 0;

View file

@ -1342,7 +1342,7 @@ fill_picture (GstVaapiFEIPakH264 * feipak, GstVaapiEncPicture * picture,
pic_param->ReferenceFrames[i].picture_id = VA_INVALID_ID; pic_param->ReferenceFrames[i].picture_id = VA_INVALID_ID;
pic_param->ReferenceFrames[i].frame_idx = VA_PICTURE_H264_INVALID; pic_param->ReferenceFrames[i].frame_idx = VA_PICTURE_H264_INVALID;
} }
pic_param->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf); pic_param->coded_buf = GST_VAAPI_CODED_BUFFER_ID (codedbuf);
return TRUE; return TRUE;
} }

View file

@ -67,14 +67,16 @@ gst_vaapi_video_pool_init (GstVaapiVideoPool * pool, GstVaapiDisplay * display,
void void
gst_vaapi_video_pool_finalize (GstVaapiVideoPool * pool) gst_vaapi_video_pool_finalize (GstVaapiVideoPool * pool)
{ {
if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE) { if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE
|| pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_CODED_BUFFER) {
g_list_free_full (pool->used_objects, g_list_free_full (pool->used_objects,
(GDestroyNotify) gst_mini_object_unref); (GDestroyNotify) gst_mini_object_unref);
} else { } else {
g_list_free_full (pool->used_objects, gst_vaapi_object_unref); g_list_free_full (pool->used_objects, gst_vaapi_object_unref);
} }
if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE) { if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE
|| pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_CODED_BUFFER) {
g_queue_foreach (&pool->free_objects, (GFunc) gst_mini_object_unref, NULL); g_queue_foreach (&pool->free_objects, (GFunc) gst_mini_object_unref, NULL);
} else { } else {
g_queue_foreach (&pool->free_objects, (GFunc) gst_vaapi_object_unref, NULL); g_queue_foreach (&pool->free_objects, (GFunc) gst_vaapi_object_unref, NULL);
@ -195,10 +197,12 @@ gst_vaapi_video_pool_get_object_unlocked (GstVaapiVideoPool * pool)
++pool->used_count; ++pool->used_count;
pool->used_objects = g_list_prepend (pool->used_objects, object); pool->used_objects = g_list_prepend (pool->used_objects, object);
if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE) if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE
|| pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_CODED_BUFFER) {
object = gst_mini_object_ref (GST_MINI_OBJECT_CAST (object)); object = gst_mini_object_ref (GST_MINI_OBJECT_CAST (object));
else } else {
object = gst_vaapi_object_ref (object); object = gst_vaapi_object_ref (object);
}
return object; return object;
} }
@ -235,10 +239,12 @@ gst_vaapi_video_pool_put_object_unlocked (GstVaapiVideoPool * pool,
if (!elem) if (!elem)
return; return;
if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE) if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE
|| pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_CODED_BUFFER) {
gst_mini_object_unref (GST_MINI_OBJECT_CAST (object)); gst_mini_object_unref (GST_MINI_OBJECT_CAST (object));
else } else {
gst_vaapi_object_unref (object); gst_vaapi_object_unref (object);
}
--pool->used_count; --pool->used_count;
pool->used_objects = g_list_delete_link (pool->used_objects, elem); pool->used_objects = g_list_delete_link (pool->used_objects, elem);
@ -271,7 +277,8 @@ static inline gboolean
gst_vaapi_video_pool_add_object_unlocked (GstVaapiVideoPool * pool, gst_vaapi_video_pool_add_object_unlocked (GstVaapiVideoPool * pool,
gpointer object) gpointer object)
{ {
if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE) { if (pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE
|| pool->object_type == GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_CODED_BUFFER) {
g_queue_push_tail (&pool->free_objects, g_queue_push_tail (&pool->free_objects,
gst_mini_object_ref (GST_MINI_OBJECT_CAST (object))); gst_mini_object_ref (GST_MINI_OBJECT_CAST (object)));
} else { } else {