From: Víctor Manuel Jáquez Leal Date: Tue, 24 Aug 2021 11:33:29 +0000 (+0200) Subject: va: filter: Add gst_va_filter_add_deinterlace_buffer() X-Git-Tag: 1.19.3~507^2~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=419ef31d1e0633e94a32fb7c7e2f5a9a7082bd6c;p=platform%2Fupstream%2Fgstreamer.git va: filter: Add gst_va_filter_add_deinterlace_buffer() This function decorates gst_va_filter_add_filter_buffer() to get the number of past and future frames to hold, given the method. Part-of: --- diff --git a/sys/va/gstvafilter.c b/sys/va/gstvafilter.c index a033e12..23edb7e 100644 --- a/sys/va/gstvafilter.c +++ b/sys/va/gstvafilter.c @@ -1375,6 +1375,48 @@ _query_pipeline_caps (GstVaFilter * self, GArray * filters, } gboolean +gst_va_filter_add_deinterlace_buffer (GstVaFilter * self, + VAProcDeinterlacingType method, guint32 * forward, guint32 * backward) +{ + GArray *filters = NULL; + VAProcFilterParameterBufferDeinterlacing params = { + .type = VAProcFilterDeinterlacing, + .algorithm = method, + }; + VAProcPipelineCaps pipeline_caps = { 0, }; + gboolean ret; + + g_return_val_if_fail (GST_IS_VA_FILTER (self), FALSE); + + if (!gst_va_filter_is_open (self)) + return FALSE; + + if (!(method != VAProcDeinterlacingNone + && method != VAProcDeinterlacingCount)) + return FALSE; + + if (!gst_va_filter_add_filter_buffer (self, ¶ms, sizeof (params), 1)) + return FALSE; + + GST_OBJECT_LOCK (self); + if (self->filters) + filters = g_array_ref (self->filters); + GST_OBJECT_UNLOCK (self); + ret = _query_pipeline_caps (self, filters, &pipeline_caps); + if (filters) + g_array_unref (filters); + if (!ret) + return FALSE; + + if (forward) + *forward = pipeline_caps.num_forward_references; + if (backward) + *backward = pipeline_caps.num_backward_references; + + return TRUE; +} + +gboolean gst_va_filter_add_filter_buffer (GstVaFilter * self, gpointer data, gsize size, guint num) { diff --git a/sys/va/gstvafilter.h b/sys/va/gstvafilter.h index d5a6989..8abaeff 100644 --- a/sys/va/gstvafilter.h +++ b/sys/va/gstvafilter.h @@ -95,6 +95,10 @@ gboolean gst_va_filter_add_filter_buffer (GstVaFilter * self, gpointer data, gsize size, guint num); +gboolean gst_va_filter_add_deinterlace_buffer(GstVaFilter * self, + VAProcDeinterlacingType method, + guint32 * forward, + guint32 * backward); gboolean gst_va_filter_drop_filter_buffers (GstVaFilter * self); gboolean gst_va_filter_process (GstVaFilter * self, GstVaSample * src,