From c8a2dcd255388f35fbf4fab70540aac0416f7c19 Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Tue, 30 Oct 2018 21:33:28 +0900 Subject: [PATCH] [Converter/Aggregator] change condition for caps query for accept-caps query in sink pad, change condition to set the query result. (true when caps is fixed) Signed-off-by: Jaeyun Jung --- gst/tensor_aggregator/tensor_aggregator.c | 11 +++++++---- gst/tensor_converter/tensor_converter.c | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gst/tensor_aggregator/tensor_aggregator.c b/gst/tensor_aggregator/tensor_aggregator.c index c428a19..efa0591 100644 --- a/gst/tensor_aggregator/tensor_aggregator.c +++ b/gst/tensor_aggregator/tensor_aggregator.c @@ -457,16 +457,19 @@ gst_tensor_aggregator_sink_query (GstPad * pad, GstObject * parent, { GstCaps *caps; GstCaps *template_caps; - gboolean res; + gboolean res = FALSE; gst_query_parse_accept_caps (query, &caps); silent_debug_caps (caps, "accept-caps"); - template_caps = gst_pad_get_pad_template_caps (pad); - res = gst_caps_can_intersect (template_caps, caps); + if (gst_caps_is_fixed (caps)) { + template_caps = gst_pad_get_pad_template_caps (pad); + + res = gst_caps_can_intersect (template_caps, caps); + gst_caps_unref (template_caps); + } gst_query_set_accept_caps_result (query, res); - gst_caps_unref (template_caps); return TRUE; } default: diff --git a/gst/tensor_converter/tensor_converter.c b/gst/tensor_converter/tensor_converter.c index b3024db..d677583 100644 --- a/gst/tensor_converter/tensor_converter.c +++ b/gst/tensor_converter/tensor_converter.c @@ -500,16 +500,19 @@ gst_tensor_converter_sink_query (GstPad * pad, GstObject * parent, { GstCaps *caps; GstCaps *template_caps; - gboolean res; + gboolean res = FALSE; gst_query_parse_accept_caps (query, &caps); silent_debug_caps (caps, "accept-caps"); - template_caps = gst_pad_get_pad_template_caps (pad); - res = gst_caps_can_intersect (template_caps, caps); + if (gst_caps_is_fixed (caps)) { + template_caps = gst_pad_get_pad_template_caps (pad); + + res = gst_caps_can_intersect (template_caps, caps); + gst_caps_unref (template_caps); + } gst_query_set_accept_caps_result (query, res); - gst_caps_unref (template_caps); return TRUE; } default: -- 2.7.4