webrtc_private: Add explicit pipeline parameter to GENERATE_DOT macro 35/265435/3
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 19 Oct 2021 09:54:23 +0000 (18:54 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 19 Oct 2021 11:45:49 +0000 (20:45 +0900)
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 <sc11.lee@samsung.com>
include/webrtc_private.h
packaging/capi-media-webrtc.spec
src/webrtc_private.c
src/webrtc_sink.c

index 03f60e8dedd0266ad2f3b653d694685def451247..45a1055b6f97f873d5ad03e7f11dd1606a290d57 100644 (file)
@@ -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);
 
index 2012fba1ff5c2f6831b4c49c8ed40e842f284013..7858b427ce1d563aac2f005b3e0154cb9e28af55 100644 (file)
@@ -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
index 68a22d53decc78fabcf430e71204e0d4c14fb270..362b83f50bec8955c0a085909524ea33c0727f3a 100644 (file)
@@ -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)
index ac7db7aa94bf71b5dac9931845f779f906abde0b..11b988d8aed334c08424d9587b8f63ed4d775a3e 100644 (file)
@@ -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)