From 239cb53e060a7791294eaf0e939cd4881bb471ed Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 22 Apr 2015 13:06:30 -0300 Subject: [PATCH] digitalzoom: also skip internal pipeline in upstream caps query To avoid going through our capsfilter which would limit the choices. --- gst/camerabin2/gstdigitalzoom.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/gst/camerabin2/gstdigitalzoom.c b/gst/camerabin2/gstdigitalzoom.c index 1ca508505a..65669c995f 100644 --- a/gst/camerabin2/gstdigitalzoom.c +++ b/gst/camerabin2/gstdigitalzoom.c @@ -174,7 +174,24 @@ gst_digital_zoom_sink_query (GstPad * sink, GstObject * parent, case GST_QUERY_CAPS: case GST_QUERY_ACCEPT_CAPS: if (self->elements_created) - return gst_pad_query (self->capsfilter_sinkpad, query); + return gst_pad_peer_query (self->srcpad, query); + /* fall through */ + default: + return gst_pad_query_default (sink, parent, query); + } +} + +static gboolean +gst_digital_zoom_src_query (GstPad * sink, GstObject * parent, GstQuery * query) +{ + GstDigitalZoom *self = GST_DIGITAL_ZOOM_CAST (parent); + switch (GST_QUERY_TYPE (query)) { + /* for caps related queries we want to skip videocrop ! videoscale + * as the digital zoom preserves input dimensions */ + case GST_QUERY_CAPS: + case GST_QUERY_ACCEPT_CAPS: + if (self->elements_created) + return gst_pad_peer_query (self->sinkpad, query); /* fall through */ default: return gst_pad_query_default (sink, parent, query); @@ -250,6 +267,9 @@ gst_digital_zoom_init (GstDigitalZoom * self) gst_pad_set_query_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_digital_zoom_sink_query)); + gst_pad_set_query_function (self->srcpad, + GST_DEBUG_FUNCPTR (gst_digital_zoom_src_query)); + self->zoom = 1; }