From 76060c9542847a93edc6912dc21a4ef8f162dd75 Mon Sep 17 00:00:00 2001 From: Jacobo Aragunde PĂ©rez Date: Wed, 29 Apr 2015 16:34:07 +0200 Subject: vaapidecodebin: expose deinterlace-method property from inner vaapipostproc https://bugzilla.gnome.org/show_bug.cgi?id=745901 --- gst/vaapi/gstvaapidecodebin.c | 20 +++++++++++++++++++- gst/vaapi/gstvaapidecodebin.h | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapidecodebin.c b/gst/vaapi/gstvaapidecodebin.c index 27d0f4ad..840548f3 100644 --- a/gst/vaapi/gstvaapidecodebin.c +++ b/gst/vaapi/gstvaapidecodebin.c @@ -37,13 +37,15 @@ GST_DEBUG_CATEGORY_STATIC (gst_debug_vaapi_decode_bin); #define DEFAULT_QUEUE_MAX_SIZE_BUFFERS 0 #define DEFAULT_QUEUE_MAX_SIZE_BYTES 0 #define DEFAULT_QUEUE_MAX_SIZE_TIME 0 +#define DEFAULT_DEINTERLACE_METHOD GST_VAAPI_DEINTERLACE_METHOD_BOB enum { PROP_0, PROP_MAX_SIZE_BUFFERS, PROP_MAX_SIZE_BYTES, - PROP_MAX_SIZE_TIME + PROP_MAX_SIZE_TIME, + PROP_DEINTERLACE_METHOD }; #define GST_VAAPI_DECODE_BIN_SURFACE_CAPS \ @@ -120,6 +122,11 @@ gst_vaapi_decode_bin_set_property (GObject * object, g_object_set (G_OBJECT (vaapidecbin->queue), "max-size-time", vaapidecbin->max_size_time, NULL); break; + case PROP_DEINTERLACE_METHOD: + vaapidecbin->deinterlace_method = g_value_get_enum (value); + g_object_set (G_OBJECT (vaapidecbin->postproc), "deinterlace-method", + vaapidecbin->deinterlace_method, NULL); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -142,6 +149,9 @@ gst_vaapi_decode_bin_get_property (GObject * object, case PROP_MAX_SIZE_TIME: g_value_set_uint64 (value, vaapidecbin->max_size_time); break; + case PROP_DEINTERLACE_METHOD: + g_value_set_enum (value, vaapidecbin->deinterlace_method); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -181,6 +191,11 @@ gst_vaapi_decode_bin_class_init (GstVaapiDecodeBinClass * klass) "Max. amount of data in the queue (in ns, 0=disable)", 0, G_MAXUINT64, DEFAULT_QUEUE_MAX_SIZE_TIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, PROP_DEINTERLACE_METHOD, + g_param_spec_enum ("deinterlace-method", "Deinterlace method", + "Deinterlace method to use", GST_VAAPI_TYPE_DEINTERLACE_METHOD, + DEFAULT_DEINTERLACE_METHOD, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_vaapi_decode_bin_sink_factory)); @@ -223,6 +238,9 @@ gst_vaapi_decode_bin_configure (GstVaapiDecodeBin * vaapidecbin) "max-size-buffers", vaapidecbin->max_size_buffers, "max-size-time", vaapidecbin->max_size_time, NULL); + g_object_set (G_OBJECT (vaapidecbin->postproc), + "deinterlace-method", vaapidecbin->deinterlace_method, NULL); + gst_bin_add_many (GST_BIN (vaapidecbin), vaapidecbin->decoder, vaapidecbin->queue, vaapidecbin->postproc, NULL); diff --git a/gst/vaapi/gstvaapidecodebin.h b/gst/vaapi/gstvaapidecodebin.h index 4d3acfdb..928683fc 100644 --- a/gst/vaapi/gstvaapidecodebin.h +++ b/gst/vaapi/gstvaapidecodebin.h @@ -23,6 +23,8 @@ #ifndef GST_VAAPI_DECODE_BIN_H #define GST_VAAPI_DECODE_BIN_H +#include + G_BEGIN_DECLS #define GST_TYPE_VAAPI_DECODE_BIN (gst_vaapi_decode_bin_get_type ()) @@ -49,6 +51,7 @@ typedef struct _GstVaapiDecodeBin { guint max_size_buffers; guint max_size_bytes; guint64 max_size_time; + GstVaapiDeinterlaceMethod deinterlace_method; } GstVaapiDecodeBin; -- cgit v1.2.3