summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2019-06-10 20:39:28 -0700
committerTim-Philipp Müller <tim@centricular.com>2020-01-08 18:10:21 +0000
commit043309e90081f2dbf910f14ee13999cde27472bd (patch)
treefb5a338bb54e2050317268a15aa834c3c88b525a
parent824edf6532e5471319f59a8ccab84006d94f64d2 (diff)
vaapivideomemory: allow negotiated info to be removed
Allow NULL negotiated_vinfo to be passed into gst_allocator_set_vaapi_negotiated_video_info to allow any previously set info to be removed.
-rw-r--r--gst/vaapi/gstvaapivideomemory.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c
index 3929693a..5da1b18e 100644
--- a/gst/vaapi/gstvaapivideomemory.c
+++ b/gst/vaapi/gstvaapivideomemory.c
@@ -1345,7 +1345,8 @@ gst_allocator_set_vaapi_video_info (GstAllocator * allocator,
/**
* gst_allocator_set_vaapi_negotiated_video_info:
* @allocator: a #GstAllocator
- * @negotiated_vinfo: the negotiated #GstVideoInfo to store
+ * @negotiated_vinfo: the negotiated #GstVideoInfo to store. If NULL, then
+ * removes any previously set value.
*
* Stores as GObject's qdata the @negotiated_vinfo in the allocator
* instance.
@@ -1358,11 +1359,13 @@ gst_allocator_set_vaapi_negotiated_video_info (GstAllocator * allocator,
const GstVideoInfo * negotiated_vinfo)
{
g_return_if_fail (allocator && GST_IS_ALLOCATOR (allocator));
- g_return_if_fail (negotiated_vinfo);
- g_object_set_qdata_full (G_OBJECT (allocator), NEGOTIATED_VINFO_QUARK,
- gst_video_info_copy (negotiated_vinfo),
- (GDestroyNotify) gst_video_info_free);
+ if (negotiated_vinfo)
+ g_object_set_qdata_full (G_OBJECT (allocator), NEGOTIATED_VINFO_QUARK,
+ gst_video_info_copy (negotiated_vinfo),
+ (GDestroyNotify) gst_video_info_free);
+ else
+ g_object_set_qdata (G_OBJECT (allocator), NEGOTIATED_VINFO_QUARK, NULL);
}
/**