Support Zero copy(tbm) in auto plugging mode 40/215240/2
authorHyunil <hyunil46.park@samsung.com>
Fri, 4 Oct 2019 03:53:16 +0000 (12:53 +0900)
committerHyunil <hyunil46.park@samsung.com>
Fri, 4 Oct 2019 03:59:32 +0000 (12:59 +0900)
Change-Id: I704a24082c148e3bd9c34086f0a680aa1cbb8cf0
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
src/media_streamer_gst.c

index f75adaa..214c180 100644 (file)
@@ -674,6 +674,8 @@ static void __decodebin_nomore_pads_combine(GstPad *src_pad, media_streamer_s *m
 {
        GstElement *found_element = NULL;
        const gchar *new_pad_type = NULL;
+       GstCaps *caps = NULL;
+       gchar *caps_str = NULL;
 
        ms_debug_fenter();
 
@@ -697,8 +699,17 @@ static void __decodebin_nomore_pads_combine(GstPad *src_pad, media_streamer_s *m
                        found_element = __ms_combine_next_element(found_element, NULL, ms_streamer->transform_bin, MEDIA_STREAMER_NODE_TYPE_MUXER);
                        found_element = __ms_combine_next_element(found_element, NULL, ms_streamer->sink_bin, MEDIA_STREAMER_NODE_TYPE_SINK);
                } else {
-                       found_element = __ms_combine_next_element(found_element, src_pad, ms_streamer->transform_bin, MEDIA_STREAMER_NODE_TYPE_VIDEO_CONVERTER);
-                       found_element = __ms_combine_next_element(found_element, NULL, ms_streamer->sink_bin, MEDIA_STREAMER_NODE_TYPE_SINK);
+                       caps = gst_pad_query_caps (src_pad, NULL);
+                       caps_str = gst_caps_to_string(caps);
+                       if (caps_str && (g_strrstr(caps_str, "ST12") || g_strrstr(caps_str, "SN12") ||
+                               g_strrstr(caps_str, "SN21") || g_strrstr(caps_str, "S420") || g_strrstr(caps_str, "SR32"))){
+                               found_element = __ms_combine_next_element(found_element, src_pad, ms_streamer->sink_bin, MEDIA_STREAMER_NODE_TYPE_SINK);
+                       } else {
+                               found_element = __ms_combine_next_element(found_element, src_pad, ms_streamer->transform_bin, MEDIA_STREAMER_NODE_TYPE_VIDEO_CONVERTER);
+                               found_element = __ms_combine_next_element(found_element, NULL, ms_streamer->sink_bin, MEDIA_STREAMER_NODE_TYPE_SINK);
+                       }
+                       MS_SAFE_GFREE(caps_str);
+                       gst_caps_unref(caps);
                }
        } else if (MS_ELEMENT_IS_AUDIO(new_pad_type)) {
                if (sink_bin_type == MEDIA_STREAMER_SINK_BIN_RTP_SERVER) {