summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2019-12-18 12:57:01 +0100
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2019-12-20 05:01:07 +0000
commitd56824c05cc3245143dab4fb716902158ec6b7c6 (patch)
treecd7556f2f0e4503900a624c5c71cb59769a89333 /gst
parenta6289308ee6f992fe6530cae3c6592a7a0b12ba3 (diff)
libs: image: port to GstMiniObject base class
GstVaapiMiniObject and GstVaapiObject are deprecrated. This is the first step to remove them, by porting GstVaapiImage as a GstMiniObject. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Diffstat (limited to 'gst')
-rw-r--r--gst/vaapi/gstvaapipluginbase.c2
-rw-r--r--gst/vaapi/gstvaapivideomemory.c8
-rw-r--r--gst/vaapi/gstvaapivideometa.c14
3 files changed, 13 insertions, 11 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c
index 35714d0a..db088be9 100644
--- a/gst/vaapi/gstvaapipluginbase.c
+++ b/gst/vaapi/gstvaapipluginbase.c
@@ -1401,7 +1401,7 @@ extract_allowed_surface_formats (GstVaapiDisplay * display,
if (res)
g_array_append_val (out_formats, img_format);
- gst_vaapi_object_unref (image);
+ gst_vaapi_image_unref (image);
/* Just reuse the surface if the format is specified */
if (specified_format == GST_VIDEO_FORMAT_UNKNOWN)
gst_vaapi_object_replace (&surface, NULL);
diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c
index 5da1b18e..c6af52c4 100644
--- a/gst/vaapi/gstvaapivideomemory.c
+++ b/gst/vaapi/gstvaapivideomemory.c
@@ -128,7 +128,7 @@ ensure_image (GstVaapiVideoMemory * mem)
reset_image_usage (&mem->usage_flag);
} else if (gst_vaapi_surface_get_format (mem->surface) !=
GST_VIDEO_INFO_FORMAT (mem->image_info)) {
- gst_vaapi_object_replace (&mem->image, NULL);
+ gst_mini_object_replace ((GstMiniObject **) & mem->image, NULL);
reset_image_usage (&mem->usage_flag);
}
}
@@ -393,7 +393,7 @@ gst_vaapi_video_memory_reset_image (GstVaapiVideoMemory * mem)
GST_VAAPI_VIDEO_ALLOCATOR_CAST (GST_MEMORY_CAST (mem)->allocator);
if (!use_native_formats (mem->usage_flag))
- gst_vaapi_object_replace (&mem->image, NULL);
+ gst_mini_object_replace ((GstMiniObject **) & mem->image, NULL);
else if (mem->image) {
gst_vaapi_video_pool_put_object (allocator->image_pool, mem->image);
mem->image = NULL;
@@ -703,7 +703,7 @@ gst_video_info_update_from_surface (GstVideoInfo * vip,
gst_vaapi_image_unmap (image);
bail:
- gst_vaapi_object_unref (image);
+ gst_vaapi_image_unref (image);
return ret;
/* ERRORS */
@@ -912,7 +912,7 @@ allocator_configure_image_info (GstVaapiDisplay * display,
bail:
if (image)
- gst_vaapi_object_unref (image);
+ gst_vaapi_image_unref (image);
return ret;
/* ERRORS */
diff --git a/gst/vaapi/gstvaapivideometa.c b/gst/vaapi/gstvaapivideometa.c
index 08040a9d..3a0d3133 100644
--- a/gst/vaapi/gstvaapivideometa.c
+++ b/gst/vaapi/gstvaapivideometa.c
@@ -78,8 +78,9 @@ set_display (GstVaapiVideoMeta * meta, GstVaapiDisplay * display)
static inline void
set_image (GstVaapiVideoMeta * meta, GstVaapiImage * image)
{
- meta->image = gst_vaapi_object_ref (image);
- set_display (meta, gst_vaapi_object_get_display (GST_VAAPI_OBJECT (image)));
+ meta->image =
+ (GstVaapiImage *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (image));
+ set_display (meta, gst_vaapi_image_get_display (image));
}
static gboolean
@@ -131,7 +132,7 @@ gst_vaapi_video_meta_destroy_image (GstVaapiVideoMeta * meta)
if (meta->image) {
if (meta->image_pool)
gst_vaapi_video_pool_put_object (meta->image_pool, meta->image);
- gst_vaapi_object_unref (meta->image);
+ gst_vaapi_image_unref (meta->image);
meta->image = NULL;
}
gst_vaapi_video_pool_replace (&meta->image_pool, NULL);
@@ -228,7 +229,8 @@ gst_vaapi_video_meta_copy (GstVaapiVideoMeta * meta)
copy->ref_count = 1;
copy->display = gst_object_ref (meta->display);
copy->image_pool = NULL;
- copy->image = meta->image ? gst_vaapi_object_ref (meta->image) : NULL;
+ copy->image = meta->image ? (GstVaapiImage *)
+ gst_mini_object_ref (GST_MINI_OBJECT_CAST (meta->image)) : NULL;
copy->proxy = meta->proxy ? gst_vaapi_surface_proxy_copy (meta->proxy) : NULL;
copy->converter = meta->converter;
copy->render_flags = meta->render_flags;
@@ -462,7 +464,7 @@ gst_vaapi_video_meta_get_display (GstVaapiVideoMeta * meta)
*
* Retrieves the #GstVaapiImage bound to the @meta. The @meta owns
* the #GstVaapiImage so the caller is responsible for calling
- * gst_vaapi_object_ref() when needed.
+ * gst_mini_object_ref() when needed.
*
* Return value: the #GstVaapiImage bound to the @meta, or %NULL if
* there is none
@@ -526,7 +528,7 @@ gst_vaapi_video_meta_set_image_from_pool (GstVaapiVideoMeta * meta,
*
* Retrieves the #GstVaapiSurface bound to the @meta. The @meta
* owns the #GstVaapiSurface so the caller is responsible for calling
- * gst_vaapi_object_ref() when needed.
+ * gst_mini_object_ref() when needed.
*
* Return value: the #GstVaapiSurface bound to the @meta, or %NULL if
* there is none