From: Hyunil Date: Fri, 4 Oct 2019 03:53:16 +0000 (+0900) Subject: Support Zero copy(tbm) in auto plugging mode X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce2a417bc996de9a465c6d79281dd257406f99fe;p=platform%2Fcore%2Fapi%2Fmediastreamer.git Support Zero copy(tbm) in auto plugging mode Change-Id: I704a24082c148e3bd9c34086f0a680aa1cbb8cf0 Signed-off-by: Hyunil (cherry picked from commit 69e74b8cc339568de23fdf0d467978aac12d6357) --- diff --git a/src/media_streamer_gst.c b/src/media_streamer_gst.c index 30a06c0..e99e588 100644 --- a/src/media_streamer_gst.c +++ b/src/media_streamer_gst.c @@ -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) {