diff --git a/sys/v4l2/gstv4l2transform.c b/sys/v4l2/gstv4l2transform.c index eb22a3ef75..eaa8608038 100644 --- a/sys/v4l2/gstv4l2transform.c +++ b/sys/v4l2/gstv4l2transform.c @@ -47,7 +47,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_v4l2_transform_debug); enum { PROP_0, - V4L2_STD_OBJECT_PROPS + V4L2_STD_OBJECT_PROPS, + PROP_DISABLE_PASSTHROUGH }; typedef struct @@ -72,6 +73,9 @@ gst_v4l2_transform_set_property (GObject * object, gst_v4l2_object_set_property_helper (self->v4l2capture, prop_id, value, pspec); break; + case PROP_DISABLE_PASSTHROUGH: + self->disable_passthrough = g_value_get_boolean (value); + break; /* By default, only set on output */ default: @@ -94,6 +98,9 @@ gst_v4l2_transform_get_property (GObject * object, gst_v4l2_object_get_property_helper (self->v4l2capture, prop_id, value, pspec); break; + case PROP_DISABLE_PASSTHROUGH: + g_value_set_boolean (value, self->disable_passthrough); + break; /* By default read from output */ default: @@ -190,6 +197,9 @@ gst_v4l2_transform_set_caps (GstBaseTransform * trans, GstCaps * incaps, GstV4l2Error error = GST_V4L2_ERROR_INIT; GstV4l2Transform *self = GST_V4L2_TRANSFORM (trans); + if (self->disable_passthrough) + gst_base_transform_set_passthrough (trans, FALSE); + if (self->incaps && self->outcaps) { if (gst_caps_is_equal (incaps, self->incaps) && gst_caps_is_equal (outcaps, self->outcaps)) { @@ -1125,6 +1135,11 @@ gst_v4l2_transform_class_init (GstV4l2TransformClass * klass) GST_DEBUG_FUNCPTR (gst_v4l2_transform_change_state); gst_v4l2_object_install_m2m_properties_helper (gobject_class); + + g_object_class_install_property (gobject_class, PROP_DISABLE_PASSTHROUGH, + g_param_spec_boolean ("disable-passthrough", "Disable Passthrough", + "Forces passing buffers through the converter", FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } static void diff --git a/sys/v4l2/gstv4l2transform.h b/sys/v4l2/gstv4l2transform.h index ea6b9a57bd..29f3f3c655 100644 --- a/sys/v4l2/gstv4l2transform.h +++ b/sys/v4l2/gstv4l2transform.h @@ -61,6 +61,8 @@ struct _GstV4l2Transform /* Selected caps */ GstCaps *incaps; GstCaps *outcaps; + + gboolean disable_passthrough; }; struct _GstV4l2TransformClass