summaryrefslogtreecommitdiffstats
path: root/gst/shapewipe
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-06-09 18:45:19 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-06-19 11:02:00 +0200
commit02b9686463c4d2d0ea54a2874284bb4f736755e6 (patch)
tree946d318a7dc850ec1c58b499d271c4c9bfeaf823 /gst/shapewipe
parent09094f2f3d1a0991345dd67787c18120da8bd73e (diff)
downloadgst-plugins-bad-02b9686463c4d2d0ea54a2874284bb4f736755e6.tar.gz
gst-plugins-bad-02b9686463c4d2d0ea54a2874284bb4f736755e6.tar.bz2
gst-plugins-bad-02b9686463c4d2d0ea54a2874284bb4f736755e6.zip
shapewipe: Proxy queries on the video pads to the correct peers
Diffstat (limited to 'gst/shapewipe')
-rw-r--r--gst/shapewipe/gstshapewipe.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gst/shapewipe/gstshapewipe.c b/gst/shapewipe/gstshapewipe.c
index e8d8207d..85f02ba7 100644
--- a/gst/shapewipe/gstshapewipe.c
+++ b/gst/shapewipe/gstshapewipe.c
@@ -69,6 +69,8 @@ static gboolean gst_shape_wipe_video_sink_setcaps (GstPad * pad,
static GstCaps *gst_shape_wipe_video_sink_getcaps (GstPad * pad);
static GstFlowReturn gst_shape_wipe_video_sink_bufferalloc (GstPad * pad,
guint64 offset, guint size, GstCaps * caps, GstBuffer ** buf);
+static gboolean gst_shape_wipe_video_sink_query (GstPad * pad,
+ GstQuery * query);
static GstFlowReturn gst_shape_wipe_mask_sink_chain (GstPad * pad,
GstBuffer * buffer);
static gboolean gst_shape_wipe_mask_sink_event (GstPad * pad, GstEvent * event);
@@ -76,6 +78,7 @@ static gboolean gst_shape_wipe_mask_sink_setcaps (GstPad * pad, GstCaps * caps);
static GstCaps *gst_shape_wipe_mask_sink_getcaps (GstPad * pad);
static gboolean gst_shape_wipe_src_event (GstPad * pad, GstEvent * event);
static GstCaps *gst_shape_wipe_src_getcaps (GstPad * pad);
+static gboolean gst_shape_wipe_src_query (GstPad * pad, GstQuery * query);
enum
{
@@ -169,6 +172,8 @@ gst_shape_wipe_init (GstShapeWipe * self, GstShapeWipeClass * g_class)
GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_getcaps));
gst_pad_set_bufferalloc_function (self->video_sinkpad,
GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_bufferalloc));
+ gst_pad_set_query_function (self->video_sinkpad,
+ GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_query));
gst_element_add_pad (GST_ELEMENT (self), self->video_sinkpad);
self->mask_sinkpad =
@@ -188,6 +193,8 @@ gst_shape_wipe_init (GstShapeWipe * self, GstShapeWipeClass * g_class)
GST_DEBUG_FUNCPTR (gst_shape_wipe_src_event));
gst_pad_set_getcaps_function (self->srcpad,
GST_DEBUG_FUNCPTR (gst_shape_wipe_src_getcaps));
+ gst_pad_set_query_function (self->srcpad,
+ GST_DEBUG_FUNCPTR (gst_shape_wipe_src_query));
gst_element_add_pad (GST_ELEMENT (self), self->srcpad);
self->mask_mutex = g_mutex_new ();
@@ -590,6 +597,50 @@ gst_shape_wipe_src_getcaps (GstPad * pad)
return ret;
}
+static gboolean
+gst_shape_wipe_video_sink_query (GstPad * pad, GstQuery * query)
+{
+ GstShapeWipe *self = GST_SHAPE_WIPE (gst_pad_get_parent (pad));
+ gboolean ret;
+ GstPad *peer = gst_pad_get_peer (self->srcpad);
+
+ GST_DEBUG_OBJECT (pad, "Handling query of type '%s'",
+ gst_query_type_get_name (GST_QUERY_TYPE (query)));
+
+ if (!peer) {
+ GST_INFO_OBJECT (pad, "No peer yet");
+ ret = FALSE;
+ } else {
+ ret = gst_pad_query (peer, query);
+ gst_object_unref (peer);
+ }
+
+ gst_object_unref (self);
+ return ret;
+}
+
+static gboolean
+gst_shape_wipe_src_query (GstPad * pad, GstQuery * query)
+{
+ GstShapeWipe *self = GST_SHAPE_WIPE (gst_pad_get_parent (pad));
+ gboolean ret;
+ GstPad *peer = gst_pad_get_peer (self->video_sinkpad);
+
+ GST_DEBUG_OBJECT (pad, "Handling query of type '%s'",
+ gst_query_type_get_name (GST_QUERY_TYPE (query)));
+
+ if (!peer) {
+ GST_INFO_OBJECT (pad, "No peer yet");
+ ret = FALSE;
+ } else {
+ ret = gst_pad_query (peer, query);
+ gst_object_unref (peer);
+ }
+
+ gst_object_unref (self);
+ return ret;
+}
+
static GstFlowReturn
gst_shape_wipe_blend_16 (GstShapeWipe * self, GstBuffer * inbuf,
GstBuffer * maskbuf, GstBuffer * outbuf)