From: Sangchul Lee Date: Tue, 19 Oct 2021 09:54:23 +0000 (+0900) Subject: webrtc_private: Add explicit pipeline parameter to GENERATE_DOT macro X-Git-Tag: submit/tizen/20211028.055213~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8286a9253544434e8aa4bae6453bd7dd6b10a389;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_private: Add explicit pipeline parameter to GENERATE_DOT macro This will be used to print dot of other piplines. Log level is changed to 'warning' in _generate_dot(). [Version] 0.2.132 [Issue Type] Debug feature Change-Id: Iaa91b2d8ab77614f5b3d6f2dc0e729c79eb1b34a Signed-off-by: Sangchul Lee --- diff --git a/include/webrtc_private.h b/include/webrtc_private.h index 03f60e8d..45a1055b 100644 --- a/include/webrtc_private.h +++ b/include/webrtc_private.h @@ -187,13 +187,13 @@ do { \ x_slot->webrtc = x_webrtc; \ } while (0) -#define GENERATE_DOT(x_webrtc, x_fmt, x_arg...) \ +#define GENERATE_DOT(x_webrtc, x_pipeline, x_fmt, x_arg...) \ do { \ gchar *dot_name; \ if (!x_webrtc->ini.general.generate_dot) \ break; \ dot_name = g_strdup_printf(""x_fmt"", x_arg); \ - _generate_dot(x_webrtc, dot_name); \ + _generate_dot(x_pipeline, dot_name); \ g_free(dot_name); \ } while (0) @@ -601,7 +601,7 @@ bool _is_owner_of_track_build_context(webrtc_s *webrtc, unsigned int track_id); void _track_build_context_destroy_cb(gpointer data); void _sink_slot_destroy_cb(gpointer data); void _source_slot_destroy_cb(gpointer data); -void _generate_dot(webrtc_s *webrtc, const gchar *name); +void _generate_dot(GstElement *pipeline, const gchar *name); GstStructure* _get_structure_from_data_channel_options(bundle *options); diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 2012fba1..7858b427 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -1,6 +1,6 @@ Name: capi-media-webrtc Summary: A WebRTC library in Tizen Native API -Version: 0.2.131 +Version: 0.2.132 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_private.c b/src/webrtc_private.c index 68a22d53..362b83f5 100644 --- a/src/webrtc_private.c +++ b/src/webrtc_private.c @@ -109,21 +109,18 @@ static const char *__get_error_string(webrtc_error_e error) } } -void _generate_dot(webrtc_s *webrtc, const gchar *name) +void _generate_dot(GstElement *pipeline, const gchar *name) { gchar *dot_name; - RET_IF(webrtc == NULL, "webrtc is NULL"); - RET_IF(webrtc->gst.pipeline == NULL, "pipeline is NULL"); + RET_IF(pipeline == NULL, "pipeline is NULL"); + RET_IF(name == NULL, "name is NULL"); - if (!name) - dot_name = g_strdup(DEFAULT_DOT_FILE_NAME_PREFIX); - else - dot_name = g_strconcat(DEFAULT_DOT_FILE_NAME_PREFIX, ".", name, NULL); + dot_name = g_strconcat(DEFAULT_DOT_FILE_NAME_PREFIX, ".", name, NULL); - GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(webrtc->gst.pipeline), GST_DEBUG_GRAPH_SHOW_ALL, dot_name); + GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(pipeline), GST_DEBUG_GRAPH_SHOW_ALL, dot_name); - LOG_INFO("dot file[%s] is generated", dot_name); + LOG_WARNING("dot file[%s] is generated", dot_name); g_free(dot_name); } @@ -232,7 +229,7 @@ void _invoke_state_changed_cb(webrtc_s *webrtc, webrtc_state_e old, webrtc_state if (new == WEBRTC_STATE_PLAYING) _set_stats_timer(webrtc); - GENERATE_DOT(webrtc, "STATE_%s", __state_str[webrtc->state]); + GENERATE_DOT(webrtc, webrtc->gst.pipeline, "STATE_%s", __state_str[webrtc->state]); } static void __invoke_error_cb(webrtc_s *webrtc, webrtc_error_e error) @@ -1119,7 +1116,7 @@ static void __webrtcbin_pad_added_cb(GstElement *webrtcbin, GstPad *new_pad, gpo RET_IF(ret != WEBRTC_ERROR_NONE, "failed to _add_rendering_sink_bin()"); } - GENERATE_DOT(webrtc, "webrtcbin_%s", GST_PAD_NAME(new_pad)); + GENERATE_DOT(webrtc, webrtc->gst.pipeline, "webrtcbin_%s", GST_PAD_NAME(new_pad)); } static void __webrtcbin_no_more_pads_cb(GstElement *webrtcbin, gpointer user_data) diff --git a/src/webrtc_sink.c b/src/webrtc_sink.c index ac7db7aa..11b988d8 100644 --- a/src/webrtc_sink.c +++ b/src/webrtc_sink.c @@ -394,7 +394,7 @@ static void __decodebin_pad_added_cb(GstElement *decodebin, GstPad *new_pad, gpo _post_error_cb_in_idle(webrtc, ret); } - GENERATE_DOT(webrtc, "%s", GST_ELEMENT_NAME(decodebin)); + GENERATE_DOT(webrtc, webrtc->gst.pipeline, "%s", GST_ELEMENT_NAME(decodebin)); } static bool __is_factory_name_for_hw(gchar *factory_name)