[Converter/Aggregator] change condition for caps query
authorJaeyun <jy1210.jung@samsung.com>
Tue, 30 Oct 2018 12:33:28 +0000 (21:33 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Wed, 31 Oct 2018 04:01:24 +0000 (04:01 +0000)
for accept-caps query in sink pad, change condition to set the query result.
(true when caps is fixed)

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
gst/tensor_aggregator/tensor_aggregator.c
gst/tensor_converter/tensor_converter.c

index c428a19..efa0591 100644 (file)
@@ -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:
index b3024db..d677583 100644 (file)
@@ -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: