Use bool instead of gboolean 10/247310/2
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 9 Nov 2020 10:04:36 +0000 (19:04 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 10 Nov 2020 00:31:41 +0000 (09:31 +0900)
One exception is following original function prototype.
 e.g) type of return value and callback function

[Version] 0.1.49
[Issue Type] Revision

Change-Id: I44bcd10c34c254d5b92b709deb7b8d518801ba56
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/webrtc_private.h
packaging/capi-media-webrtc.spec
src/webrtc.c
src/webrtc_ini.c
src/webrtc_private.c
src/webrtc_sink.c
src/webrtc_source.c

index b89131efcece7f1652ac934db50c7e9afd9289d6..14acd5bb1dbb6b8ec4f4bef56cda9f27b31cc48d 100644 (file)
@@ -275,8 +275,8 @@ void _connect_and_append_signal(GList **signals, GObject *obj, const char *sig_n
 void _disconnect_signal(gpointer data);
 GstElement *_create_element(const char *factory_name, const char *name);
 GstElement *_create_element_from_registry(element_info_s *elem_info);
-int _add_no_target_ghostpad_to_slot(webrtc_gst_slot_s *slot, gboolean is_src, GstPad **new_pad);
-int _set_ghost_pad_target(GstPad *ghost_pad, GstElement *target_element, gboolean is_src);
+int _add_no_target_ghostpad_to_slot(webrtc_gst_slot_s *slot, bool is_src, GstPad **new_pad);
+int _set_ghost_pad_target(GstPad *ghost_pad, GstElement *target_element, bool is_src);
 int _add_rendering_sink_bin(webrtc_s *webrtc, GstPad *src_pad);
 void _sink_slot_destroy_cb(gpointer data);
 void _source_slot_destroy_cb(gpointer data);
@@ -284,10 +284,10 @@ void _generate_dot(webrtc_s *webrtc, const gchar *name);
 
 int _webrtcbin_create_offer(webrtc_s *webrtc, char **offer);
 int _webrtcbin_create_answer(webrtc_s *webrtc, char **answer);
-int _webrtcbin_set_session_description(webrtc_s *webrtc, const char *description, gboolean is_remote);
+int _webrtcbin_set_session_description(webrtc_s *webrtc, const char *description, bool is_remote);
 int _webrtcbin_add_ice_candidate(webrtc_s *webrtc, const char *candidate);
 void _webrtcbin_on_data_channel_cb(GstElement *webrtcbin, GObject *data_channel, gpointer user_data);
-gboolean _webrtcbin_have_remote_offer(webrtc_s *webrtc);
+bool _webrtcbin_have_remote_offer(webrtc_s *webrtc);
 
 void _init_data_channels(webrtc_s *webrtc);
 void _destroy_data_channels(webrtc_s *webrtc);
index 9779ebd371618dea8d2e69a0e34b9edfd336ada2..c239900a1adcdb34aae2504a2f04b911d0f6db85 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.1.48
+Version:    0.1.49
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index a47d6ca50a184703e5900a9d230d96712ee3b41e..7af3d784f73ca4f883f5d30469be16375beee4bd 100644 (file)
@@ -515,7 +515,7 @@ int webrtc_set_local_description(webrtc_h webrtc, const char *description)
 
        LOG_INFO("description: %s", description);
 
-       ret = _webrtcbin_set_session_description(webrtc, description, FALSE);
+       ret = _webrtcbin_set_session_description(webrtc, description, false);
 
        g_mutex_unlock(&_webrtc->mutex);
 
@@ -536,7 +536,7 @@ int webrtc_set_remote_description(webrtc_h webrtc, const char *description)
 
        LOG_INFO("description: %s", description);
 
-       ret = _webrtcbin_set_session_description(webrtc, description, TRUE);
+       ret = _webrtcbin_set_session_description(webrtc, description, true);
 
        g_mutex_unlock(&_webrtc->mutex);
 
index 2a62da421dec249c2658af4b8ee7eac3b74b41d6..14e91f15bc5b36b76ef305498836cbc6d3e5a1ad 100644 (file)
@@ -18,7 +18,7 @@
 #include "webrtc_private.h"
 
 #define WEBRTC_INI_PATH                "/etc/multimedia/mmfw_webrtc.ini"
-#define DEFAULT_GENERATE_DOT           TRUE
+#define DEFAULT_GENERATE_DOT           true
 #define DEFAULT_DOT_PATH               "/tmp"
 
 /* categories */
@@ -181,7 +181,7 @@ static int __ini_get_int(dictionary *dict, const char *category, const char *ite
        return ret_val;
 }
 
-static bool __ini_get_boolean(dictionary *dict, const char *category, const char *item, gboolean default_value)
+static bool __ini_get_boolean(dictionary *dict, const char *category, const char *item, bool default_value)
 {
        gchar *path;
        bool ret_val;
index 86cc748c9619b535d246d5a9f88984ebb1ad71d9..122d83aff32693708c2371dd531feea1765925d0 100644 (file)
@@ -135,15 +135,15 @@ static gchar *__make_ice_candidate_message(guint mlineindex, gchar *candidate)
        return text;
 }
 
-static gboolean __meet_gst_state(webrtc_state_e state, GstState gst_state)
+static bool __meet_gst_state(webrtc_state_e state, GstState gst_state)
 {
        if (state == WEBRTC_STATE_IDLE && gst_state == GST_STATE_READY)
-               return TRUE;
+               return true;
 
        if (state == WEBRTC_STATE_NEGOTIATING && gst_state == GST_STATE_PLAYING)
-               return TRUE;
+               return true;
 
-       return FALSE;
+       return false;
 }
 
 void _invoke_state_changed_cb(webrtc_s *webrtc, webrtc_state_e old, webrtc_state_e new)
@@ -382,7 +382,7 @@ int _gst_init(webrtc_s *webrtc)
        int argc = 1;
        char **argv = NULL;
        GError *err = NULL;
-       gboolean gst_ret = 0;
+       gboolean gst_ret;
        gchar **gst_args;
 
        RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
@@ -701,7 +701,7 @@ static GstPad* __add_no_target_ghostpad(GstElement *bin, const char *pad_name, b
        return ghost_pad;
 }
 
-int _add_no_target_ghostpad_to_slot(webrtc_gst_slot_s *slot, gboolean is_src, GstPad **new_pad)
+int _add_no_target_ghostpad_to_slot(webrtc_gst_slot_s *slot, bool is_src, GstPad **new_pad)
 {
        gchar *pad_name;
 
@@ -720,7 +720,7 @@ int _add_no_target_ghostpad_to_slot(webrtc_gst_slot_s *slot, gboolean is_src, Gs
        return WEBRTC_ERROR_NONE;
 }
 
-int _set_ghost_pad_target(GstPad *ghost_pad, GstElement *target_element, gboolean is_src)
+int _set_ghost_pad_target(GstPad *ghost_pad, GstElement *target_element, bool is_src)
 {
        GstPad *target_pad;
 
@@ -1068,7 +1068,7 @@ void _webrtcbin_on_negotiation_needed(GstElement *webrtcbin, gpointer user_data)
        LOG_DEBUG("<<< end of the callback");
 }
 
-static void __update_session_description(GstPromise *promise, gboolean is_offer, gpointer user_data)
+static void __update_session_description(GstPromise *promise, bool is_offer, gpointer user_data)
 {
        GstWebRTCSessionDescription *desc = NULL;
        const GstStructure *reply;
@@ -1108,7 +1108,7 @@ static void __offer_created_cb(GstPromise *promise, gpointer user_data)
 
        LOG_DEBUG_ENTER();
 
-       __update_session_description(promise, TRUE, webrtc);
+       __update_session_description(promise, true, webrtc);
 
        g_cond_signal(&webrtc->desc_cond);
 
@@ -1124,14 +1124,14 @@ static void __answer_created_cb(GstPromise *promise, gpointer user_data)
 
        LOG_DEBUG_ENTER();
 
-       __update_session_description(promise, FALSE, webrtc);
+       __update_session_description(promise, false, webrtc);
 
        g_cond_signal(&webrtc->desc_cond);
 
        LOG_DEBUG_LEAVE();
 }
 
-static int _create_session_description(webrtc_s *webrtc, gboolean is_offer, char **desc)
+static int _create_session_description(webrtc_s *webrtc, bool is_offer, char **desc)
 {
        GstPromise *promise;
        gint64 end_time;
@@ -1167,7 +1167,7 @@ int _webrtcbin_create_offer(webrtc_s *webrtc, char **offer)
        RET_VAL_IF(offer == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "offer is NULL");
        RET_VAL_IF(webrtc->gst.webrtcbin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "webrtcbin is NULL");
 
-       return _create_session_description(webrtc, TRUE, offer);
+       return _create_session_description(webrtc, true, offer);
 }
 
 int _webrtcbin_create_answer(webrtc_s *webrtc, char **answer)
@@ -1176,7 +1176,7 @@ int _webrtcbin_create_answer(webrtc_s *webrtc, char **answer)
        RET_VAL_IF(answer == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "answer is NULL");
        RET_VAL_IF(webrtc->gst.webrtcbin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "webrtcbin is NULL");
 
-       return _create_session_description(webrtc, FALSE, answer);
+       return _create_session_description(webrtc, false, answer);
 }
 
 /* Use g_free() to release the sdp and type parameter. */
@@ -1244,7 +1244,7 @@ end:
        return ret;
 }
 
-int _webrtcbin_set_session_description(webrtc_s *webrtc, const char *description, gboolean is_remote)
+int _webrtcbin_set_session_description(webrtc_s *webrtc, const char *description, bool is_remote)
 {
        int ret = WEBRTC_ERROR_NONE;
        gchar *sdp;
@@ -1375,7 +1375,7 @@ int _webrtcbin_add_ice_candidate(webrtc_s *webrtc, const char *candidate)
        return ret;
 }
 
-gboolean _webrtcbin_have_remote_offer(webrtc_s *webrtc)
+bool _webrtcbin_have_remote_offer(webrtc_s *webrtc)
 {
        GstWebRTCSignalingState signaling_state;
 
index a07e1518d8baabb877112a9bc70e875ae1394964..8379ea88dd16f2134d231641f3ce183a4ca919da 100644 (file)
@@ -148,7 +148,7 @@ static unsigned int __get_id_from_name(const gchar* name)
        return (unsigned int)id;
 }
 
-static void __invoke_track_added_cb(webrtc_s *webrtc, const gchar *name, gboolean is_video)
+static void __invoke_track_added_cb(webrtc_s *webrtc, const gchar *name, bool is_video)
 {
        RET_IF(webrtc == NULL, "webrtc is NULL");
        RET_IF(name == NULL, "name is NULL");
@@ -195,11 +195,11 @@ static void __decodebin_pad_added_cb(GstElement *decodebin, GstPad *new_pad, gpo
        LOG_INFO("[%s], new_pad[%s], media_type[%s]", GST_ELEMENT_NAME(decodebin), GST_PAD_NAME(new_pad), media_type);
 
        if (g_strrstr(media_type, "video")) {
-               __invoke_track_added_cb(webrtc, GST_ELEMENT_NAME(decodebin), TRUE);
+               __invoke_track_added_cb(webrtc, GST_ELEMENT_NAME(decodebin), true);
                ret = __build_videosink(webrtc, decodebin, new_pad);
 
        } else if (g_strrstr(media_type, "audio")) {
-               __invoke_track_added_cb(webrtc, GST_ELEMENT_NAME(decodebin), FALSE);
+               __invoke_track_added_cb(webrtc, GST_ELEMENT_NAME(decodebin), false);
                ret = __build_audiosink(webrtc, decodebin, new_pad);
 
        } else {
@@ -282,11 +282,11 @@ int _add_rendering_sink_bin(webrtc_s *webrtc, GstPad *src_pad)
        g_signal_connect(decodebin, "autoplug-select", G_CALLBACK(__decodebin_autoplug_select_cb), webrtc);
        g_signal_connect(decodebin, "element-added", G_CALLBACK(__decodebin_element_added_cb), NULL);
 
-       ret = _add_no_target_ghostpad_to_slot(sink, FALSE, &sink_pad);
+       ret = _add_no_target_ghostpad_to_slot(sink, false, &sink_pad);
        if (ret != WEBRTC_ERROR_NONE)
                goto error_before_insert;
 
-       ret = _set_ghost_pad_target(sink_pad, decodebin, FALSE);
+       ret = _set_ghost_pad_target(sink_pad, decodebin, false);
        if (ret != WEBRTC_ERROR_NONE)
                goto error_before_insert;
 
index 5e4e3e822e99a1e0a3206149aae49daedb7dcc2b..611e8abbaa44e4814760e8559ebeaf48c7a0c4b9 100644 (file)
@@ -215,7 +215,7 @@ static GstCaps *__make_rtp_caps(const gchar *media_type, unsigned int id)
 {
        gchar *caps_str;
        GstCaps *caps;
-       gboolean is_video;
+       bool is_video;
        codec_type_e codec_type;
 
        RET_VAL_IF(media_type == NULL, NULL, "media_type is NULL");
@@ -339,7 +339,7 @@ static int __build_camerasrc(webrtc_s *webrtc, webrtc_gst_slot_s *source, GstPad
                return WEBRTC_ERROR_INVALID_OPERATION;
        }
 
-       return _set_ghost_pad_target(ghost_src_pad, capsfilter2, TRUE);
+       return _set_ghost_pad_target(ghost_src_pad, capsfilter2, true);
 }
 
 static int __build_audiosrc(webrtc_s *webrtc, webrtc_gst_slot_s *source, GstPad *ghost_src_pad)
@@ -373,7 +373,7 @@ static int __build_audiosrc(webrtc_s *webrtc, webrtc_gst_slot_s *source, GstPad
                return WEBRTC_ERROR_INVALID_OPERATION;
        }
 
-       return _set_ghost_pad_target(ghost_src_pad, capsfilter2, TRUE);
+       return _set_ghost_pad_target(ghost_src_pad, capsfilter2, true);
 }
 
 static int __build_videotestsrc(webrtc_s *webrtc, webrtc_gst_slot_s *source, GstPad *ghost_src_pad)
@@ -408,7 +408,7 @@ static int __build_videotestsrc(webrtc_s *webrtc, webrtc_gst_slot_s *source, Gst
                return WEBRTC_ERROR_INVALID_OPERATION;
        }
 
-       return _set_ghost_pad_target(ghost_src_pad, capsfilter2, TRUE);
+       return _set_ghost_pad_target(ghost_src_pad, capsfilter2, true);
 }
 
 static int __build_audiotestsrc(webrtc_s *webrtc, webrtc_gst_slot_s *source, GstPad *ghost_src_pad)
@@ -443,7 +443,7 @@ static int __build_audiotestsrc(webrtc_s *webrtc, webrtc_gst_slot_s *source, Gst
                return WEBRTC_ERROR_INVALID_OPERATION;
        }
 
-       return _set_ghost_pad_target(ghost_src_pad, capsfilter2, TRUE);
+       return _set_ghost_pad_target(ghost_src_pad, capsfilter2, true);
 }
 
 static int __build_source_bin(webrtc_s *webrtc, webrtc_gst_slot_s *source, webrtc_media_source_type_e type)
@@ -455,7 +455,7 @@ static int __build_source_bin(webrtc_s *webrtc, webrtc_gst_slot_s *source, webrt
        RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
        RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
 
-       ret = _add_no_target_ghostpad_to_slot(source, TRUE, &src_pad);
+       ret = _add_no_target_ghostpad_to_slot(source, true, &src_pad);
        RET_VAL_IF(ret != WEBRTC_ERROR_NONE, ret, "failed to _add_no_target_ghostpad_to_slot()");
 
        switch (type) {