return ret;
}
-static gboolean
-gst_stream_synchronizer_acceptcaps (GstPad * pad, GstCaps * caps)
-{
- GstPad *opad;
- gboolean ret = FALSE;
-
- opad = gst_stream_get_other_pad_from_pad (pad);
- if (opad) {
- ret = gst_pad_peer_accept_caps (opad, caps);
- gst_object_unref (opad);
- }
-
- GST_LOG_OBJECT (pad, "Caps%s accepted: %" GST_PTR_FORMAT, (ret ? "" : " not"),
- caps);
-
- return ret;
-}
-
/* srcpad functions */
static gboolean
gst_stream_synchronizer_src_event (GstPad * pad, GstEvent * event)
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_query));
gst_pad_set_getcaps_function (stream->sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_getcaps));
- gst_pad_set_acceptcaps_function (stream->sinkpad,
- GST_DEBUG_FUNCPTR (gst_stream_synchronizer_acceptcaps));
gst_pad_set_event_function (stream->sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_sink_event));
gst_pad_set_chain_function (stream->sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_query));
gst_pad_set_getcaps_function (stream->srcpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_getcaps));
- gst_pad_set_acceptcaps_function (stream->srcpad,
- GST_DEBUG_FUNCPTR (gst_stream_synchronizer_acceptcaps));
gst_pad_set_event_function (stream->srcpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_src_event));
}
static gboolean
-gst_subtitle_overlay_subtitle_sink_acceptcaps (GstPad * pad, GstCaps * caps)
-{
- GstCaps *othercaps = gst_subtitle_overlay_subtitle_sink_getcaps (pad, NULL);
- gboolean ret = gst_caps_is_subset (caps, othercaps);
-
- gst_caps_unref (othercaps);
-
- return ret;
-}
-
-static gboolean
gst_subtitle_overlay_subtitle_sink_setcaps (GstSubtitleOverlay * self,
GstCaps * caps)
{
return ret;
}
+static gboolean
+gst_subtitle_overlay_subtitle_sink_query (GstPad * pad, GstQuery * query)
+{
+ GstSubtitleOverlay *self = GST_SUBTITLE_OVERLAY (gst_pad_get_parent (pad));
+ gboolean ret;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_ACCEPT_CAPS:
+ {
+ GstCaps *caps, *othercaps;
+
+ gst_query_parse_accept_caps (query, &caps);
+ othercaps = gst_subtitle_overlay_subtitle_sink_getcaps (pad, NULL);
+ ret = gst_caps_is_subset (caps, othercaps);
+ gst_caps_unref (othercaps);
+ gst_query_set_accept_caps_result (query, ret);
+ ret = TRUE;
+ break;
+ }
+ default:
+ ret = gst_pad_query_default (pad, query);
+ break;
+ }
+ gst_object_unref (self);
+
+ return ret;
+}
+
static void
gst_subtitle_overlay_init (GstSubtitleOverlay * self)
{
GST_DEBUG_FUNCPTR (gst_subtitle_overlay_subtitle_sink_unlink));
gst_pad_set_event_function (self->subtitle_sinkpad,
GST_DEBUG_FUNCPTR (gst_subtitle_overlay_subtitle_sink_event));
+ gst_pad_set_query_function (self->subtitle_sinkpad,
+ GST_DEBUG_FUNCPTR (gst_subtitle_overlay_subtitle_sink_query));
gst_pad_set_chain_function (self->subtitle_sinkpad,
GST_DEBUG_FUNCPTR (gst_subtitle_overlay_subtitle_sink_chain));
gst_pad_set_getcaps_function (self->subtitle_sinkpad,
GST_DEBUG_FUNCPTR (gst_subtitle_overlay_subtitle_sink_getcaps));
- gst_pad_set_acceptcaps_function (self->subtitle_sinkpad,
- GST_DEBUG_FUNCPTR (gst_subtitle_overlay_subtitle_sink_acceptcaps));
proxypad =
GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD