summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2014-10-23 23:55:48 +1100
committerMatthew Waters <matthew@centricular.com>2014-10-23 23:58:33 +1100
commit7d9044cf05fd82d704feee7ed945bc89ba31a45f (patch)
tree3fc93607762a98ef204c8db8ddce4f5bfcc769f4
parente40d70c69a96daf9081275dbca5c79bdd37438cc (diff)
glmixer: override the accept caps query in order to 'convert' capsfeatures
Otherwise, it is only possible for the sink pads and the src pads to have the exact same caps features. We can convert from any feature to another feature so support that.
-rw-r--r--ext/gl/gstglmixer.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/gl/gstglmixer.c b/ext/gl/gstglmixer.c
index 743bacc90..da6ba67ed 100644
--- a/ext/gl/gstglmixer.c
+++ b/ext/gl/gstglmixer.c
@@ -268,6 +268,26 @@ context_error:
}
static gboolean
+gst_gl_mixer_pad_sink_acceptcaps (GstPad * pad, GstGLMixer * mix,
+ GstCaps * caps)
+{
+ gboolean ret;
+ GstCaps *template_caps;
+
+ GST_DEBUG_OBJECT (pad, "try accept caps of %" GST_PTR_FORMAT, caps);
+
+ template_caps = gst_pad_get_pad_template_caps (pad);
+ template_caps = gst_caps_make_writable (template_caps);
+
+ ret = gst_caps_can_intersect (caps, template_caps);
+ GST_DEBUG_OBJECT (pad, "%saccepted caps %" GST_PTR_FORMAT,
+ (ret ? "" : "not "), caps);
+ gst_caps_unref (template_caps);
+
+ return ret;
+}
+
+static gboolean
gst_gl_mixer_sink_query (GstAggregator * agg, GstAggregatorPad * bpad,
GstQuery * query)
{
@@ -277,6 +297,16 @@ gst_gl_mixer_sink_query (GstAggregator * agg, GstAggregatorPad * bpad,
GST_TRACE ("QUERY %" GST_PTR_FORMAT, query);
switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_ACCEPT_CAPS:
+ {
+ GstCaps *caps;
+
+ gst_query_parse_accept_caps (query, &caps);
+ ret = gst_gl_mixer_pad_sink_acceptcaps (GST_PAD (bpad), mix, caps);
+ gst_query_set_accept_caps_result (query, ret);
+ ret = TRUE;
+ break;
+ }
case GST_QUERY_ALLOCATION:
{
GstQuery *decide_query = NULL;