Revise codes to use new subfunctions to init/set GValue 51/239351/5
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 24 Jul 2020 05:51:07 +0000 (14:51 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 27 Jul 2020 07:29:47 +0000 (16:29 +0900)
__ms_param_value_set() and __ms_param_value_init() are added.
Logs are added to check values easily.
Some strcmp() are replaced by comparing with enum type.

[Version] 0.1.102
[Issue Type] Improvement

Change-Id: I6ed7470a0f1c5f812d60de2457159a7d42ed6c98
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-streamer.spec
src/media_streamer_node.c

index b2f206e..81f7312 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-streamer
 Summary:    A Media Streamer API
-Version:    0.1.101
+Version:    0.1.102
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 82efdb7..624cf0e 100644 (file)
@@ -264,48 +264,154 @@ static gboolean __ms_rtp_node_has_property(media_streamer_node_s *node, const ch
 {
        GValue *val = NULL;
 
-       ms_debug_fenter();
-
-       ms_retvm_if(!node || !node->gst_element, FALSE, "Error: empty node");
-       ms_retvm_if(!param_name, FALSE, "Error: invalid property parameter");
+       ms_retvm_if(!node, FALSE, "node is NULL");
+       ms_retvm_if(!node->gst_element, FALSE, "gst_element is NULL");
+       ms_retvm_if(!param_name, FALSE, "param_name is NULL");
 
        if (node->type != MEDIA_STREAMER_NODE_TYPE_RTP)
                return FALSE;
 
        val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param_name);
 
-       ms_debug_fleave();
+       ms_debug("node[%s] %s [%s]", node->name, val ? "has" : "does not have", param_name);
 
        return val ? TRUE : FALSE;
 }
 
+static int __ms_param_value_init(GValue *value, param_data_type_e type)
+{
+       ms_retvm_if(!value, MEDIA_STREAMER_ERROR_INVALID_PARAMETER , "value is NULL");
+
+       switch (type) {
+       case PARAM_DATA_TYPE_NUMBER:
+               g_value_init(value, G_TYPE_INT);
+               break;
+       case PARAM_DATA_TYPE_BOOL:
+               g_value_init(value, G_TYPE_BOOLEAN);
+               break;
+       case PARAM_DATA_TYPE_STRING:
+               g_value_init(value, G_TYPE_STRING);
+               break;
+       case PARAM_DATA_TYPE_ENUM:
+               g_value_init(value, G_TYPE_ENUM);
+               break;
+       case PARAM_DATA_TYPE_POINTER:
+               g_value_init(value, G_TYPE_POINTER);
+               break;
+       default:
+               ms_error("not supported type[%d]", type);
+               return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
+       }
+
+       return MEDIA_STREAMER_ERROR_NONE;
+}
+
+static int __ms_param_value_set(GValue *value, param_data_type_e type, const char *param_value)
+{
+       ms_retvm_if(!value, MEDIA_STREAMER_ERROR_INVALID_PARAMETER , "value is NULL");
+       ms_retvm_if(!param_value, MEDIA_STREAMER_ERROR_INVALID_PARAMETER , "param_value is NULL");
+
+       switch (type) {
+       case PARAM_DATA_TYPE_NUMBER:
+               g_value_unset(value);
+               g_value_init(value, G_TYPE_INT);
+               g_value_set_int(value, (int)strtol(param_value, NULL, 10));
+               break;
+
+       case PARAM_DATA_TYPE_BOOL:
+               g_value_unset(value);
+               g_value_init(value, G_TYPE_BOOLEAN);
+               if (!strcmp(param_value, "true") || !strcmp(param_value, "TRUE")) {
+                       g_value_set_boolean(value, TRUE);
+               } else if (!strcmp(param_value, "false") || !strcmp(param_value, "FALSE")) {
+                       g_value_set_boolean(value, FALSE);
+               } else {
+                       ms_error("invalid parameter[%s] for PARAM_DATA_TYPE_BOOL", param_value);
+                       return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
+               }
+               break;
+
+       case PARAM_DATA_TYPE_STRING:
+               g_value_unset(value);
+               g_value_init(value, G_TYPE_STRING);
+               g_value_set_string(value, param_value);
+               break;
+
+       case PARAM_DATA_TYPE_ENUM:
+               g_value_unset(value);
+               g_value_init(value, G_TYPE_ENUM);
+               g_value_set_enum(value, (int)strtol(param_value, NULL, 10));
+               break;
+
+       case PARAM_DATA_TYPE_POINTER:
+               g_value_unset(value);
+               g_value_init(value, G_TYPE_POINTER);
+               g_value_set_pointer(value, (void*) param_value);
+               break;
+
+       default:
+               ms_error("not supported type[%d]", type);
+               return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
+       }
+
+       return MEDIA_STREAMER_ERROR_NONE;
+}
+
+static void __ms_param_value_print(GValue *value, param_data_type_e type)
+{
+       ms_retm_if(!value, "value is NULL");
+
+       switch (type) {
+       case PARAM_DATA_TYPE_NUMBER:
+               if (G_VALUE_HOLDS_INT(value))
+                       ms_debug("value[%d]", g_value_get_int(value));
+               else
+                       ms_debug("value[%u]", g_value_get_uint(value));
+               break;
+       case PARAM_DATA_TYPE_BOOL:
+               ms_debug("value[%d]", g_value_get_boolean(value));
+               break;
+       case PARAM_DATA_TYPE_STRING:
+               ms_debug("value[%s]", g_value_get_string(value));
+               break;
+       case PARAM_DATA_TYPE_ENUM:
+               ms_debug("value[%d]", g_value_get_enum(value));
+               break;
+       case PARAM_DATA_TYPE_POINTER:
+               ms_debug("value[%p]", g_value_get_pointer(value));
+               break;
+       default:
+               ms_error("not supported type[%d]", type);
+               break;
+       }
+}
+
 static int __ms_rtp_node_get_property(media_streamer_node_s *node, param_s *param, GValue *value)
 {
        int ret = MEDIA_STREAMER_ERROR_NONE;
        GValue *val = NULL;
 
-       ms_debug_fenter();
-
-       ms_retvm_if(!node || !node->gst_element, FALSE, "Error: empty node");
+       ms_retvm_if(!node, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "node is NULL");
+       ms_retvm_if(!node->gst_element, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "gst_element is NULL");
        ms_retvm_if(node->type != MEDIA_STREAMER_NODE_TYPE_RTP, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Invalid node type");
-       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Error: invalid property parameter");
+       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param is NULL");
        ms_retvm_if(!value, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "value is NULL");
 
+       ms_debug("param[%s]", param->param_name);
 
        val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param->param_name);
-       if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_VIDEO_IN_PORT) ||
-               !strcmp(param->param_name, MEDIA_STREAMER_PARAM_AUDIO_IN_PORT) ||
-               !strcmp(param->param_name, MEDIA_STREAMER_PARAM_VIDEO_OUT_PORT) ||
-               !strcmp(param->param_name, MEDIA_STREAMER_PARAM_AUDIO_OUT_PORT)) {
-               g_value_init(value, G_TYPE_INT);
-       } else if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_HOST)) {
-               g_value_init(value, G_TYPE_STRING);
-       } else
-               ret = MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
+       if (!val) {
+               ms_error("fail to get [%s] value from [%s]", param->param_name, GST_ELEMENT_NAME(node->gst_element));
+               return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
+       }
+
+       ret = __ms_param_value_init(value, param->data_type);
+       if (ret != MEDIA_STREAMER_ERROR_NONE)
+               return ret;
 
        g_value_copy(val, value);
 
-       ms_debug_fleave();
+       __ms_param_value_print(value, param->data_type);
 
        return ret;
 }
@@ -315,32 +421,22 @@ static int __ms_rtp_node_set_property(media_streamer_node_s *node, param_s *para
        int ret = MEDIA_STREAMER_ERROR_NONE;
        GValue *val = NULL;
 
-       ms_debug_fenter();
-
-       ms_retvm_if(!node || !node->gst_element, MEDIA_STREAMER_ERROR_INVALID_OPERATION, "Error: empty node");
+       ms_retvm_if(!node, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "node is NULL");
+       ms_retvm_if(!node->gst_element, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "gst_element is NULL");
        ms_retvm_if(node->type != MEDIA_STREAMER_NODE_TYPE_RTP, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Invalid node type");
-       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Error: invalid property parameter");
+       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param is NULL");
        ms_retvm_if(!param_value, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param_value is NULL");
 
+       ms_debug("param[%s] param_value[%s]", param->param_name, param_value);
+
        val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param->param_name);
        if (!val) {
-               ms_error("fail to get [%s] val from [%s]", param->param_name, GST_ELEMENT_NAME(node->gst_element));
+               ms_error("fail to get [%s] value from [%s]", param->param_name, GST_ELEMENT_NAME(node->gst_element));
                return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
        }
 
-       if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_VIDEO_IN_PORT) ||
-               !strcmp(param->param_name, MEDIA_STREAMER_PARAM_AUDIO_IN_PORT) ||
-               !strcmp(param->param_name, MEDIA_STREAMER_PARAM_VIDEO_OUT_PORT) ||
-               !strcmp(param->param_name, MEDIA_STREAMER_PARAM_AUDIO_OUT_PORT)) {
-               g_value_unset(val);
-               g_value_init(val, G_TYPE_INT);
-               g_value_set_int(val, (int)strtol(param_value, NULL, 10));
-       } else if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_HOST)) {
-               g_value_unset(val);
-               g_value_init(val, G_TYPE_STRING);
-               g_value_set_string(val, param_value);
-       } else if (!strcmp(param->param_name, MS_PARAM_VIDEO_IN_FORMAT) ||
-                          !strcmp(param->param_name, MS_PARAM_AUDIO_IN_FORMAT)) {
+       if (!strcmp(param->param_name, MS_PARAM_VIDEO_IN_FORMAT) ||
+               !strcmp(param->param_name, MS_PARAM_AUDIO_IN_FORMAT)) {
                GstCaps *caps = gst_caps_from_string(param_value);
                if (caps) {
                        g_value_unset(val);
@@ -350,7 +446,7 @@ static int __ms_rtp_node_set_property(media_streamer_node_s *node, param_s *para
                        ret = MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
                }
        } else {
-               ret = MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
+               ret = __ms_param_value_set(val, param->data_type, param_value);
        }
 
        ms_debug_fleave();
@@ -362,22 +458,18 @@ static gboolean __ms_webrtc_node_has_property(media_streamer_node_s *node, const
 {
        GValue *val = NULL;
 
-       ms_debug_fenter();
-
-       ms_retvm_if(!node || !node->gst_element, FALSE, "Error: empty node");
-       ms_retvm_if(!param_name, FALSE, "Error: invalid property parameter");
+       ms_retvm_if(!node, FALSE, "node is NULL");
+       ms_retvm_if(!node->gst_element, FALSE, "gst_element is NULL");
+       ms_retvm_if(!param_name, FALSE, "param_name is NULL");
 
-       if (node->type == MEDIA_STREAMER_NODE_TYPE_WEBRTC) {
-               val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param_name);
-
-               ms_debug_fleave();
+       if (node->type != MEDIA_STREAMER_NODE_TYPE_WEBRTC)
+               return FALSE;
 
-               return val ? TRUE : FALSE;
-       }
+       val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param_name);
 
-       ms_debug_fleave();
+       ms_debug("node[%s] %s [%s]", node->name, val ? "has" : "does not have", param_name);
 
-       return FALSE;
+       return val ? TRUE : FALSE;
 }
 
 static int __ms_webrtc_node_set_property(media_streamer_node_s *node, param_s *param, const char *param_value)
@@ -385,86 +477,80 @@ static int __ms_webrtc_node_set_property(media_streamer_node_s *node, param_s *p
        GValue *val = NULL;
        int ret;
 
-       ms_debug_fenter();
-
-       ms_retvm_if(!node || !node->gst_element, MEDIA_STREAMER_ERROR_INVALID_OPERATION, "Error: empty node");
+       ms_retvm_if(!node, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "node is NULL");
+       ms_retvm_if(!node->gst_element, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "gst_element is NULL");
        ms_retvm_if(node->type != MEDIA_STREAMER_NODE_TYPE_WEBRTC, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Invalid node type");
-       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Error: invalid property parameter");
+       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param is NULL");
        ms_retvm_if(!param_value, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param_value is NULL");
 
+       ms_debug("param[%s] param_value[%s]", param->param_name, param_value);
+
        val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param->param_name);
        if (!val) {
                ms_error("failed to get [%s] val from [%s]", param->param_name, GST_ELEMENT_NAME(node->gst_element));
                return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
        }
 
-       if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_WEBRTC_PEER_TYPE)) {
+       switch (param->prop_enum) {
+       case PROP_NAME_WEBRTC_PEER_TYPE:
                if (strcmp(param_value, WEBRTC_PEER_OFFER) && strcmp(param_value, WEBRTC_PEER_ANSWER)) {
                        ms_error("failed to set property, param value should be [%s] or [%s]", WEBRTC_PEER_OFFER, WEBRTC_PEER_ANSWER);
                        return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
                }
-               g_value_unset(val);
-               g_value_init(val, G_TYPE_STRING);
-               g_value_set_string(val, param_value);
+               ret = __ms_param_value_set(val, param->data_type, param_value);
+               break;
 
-       } else if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_WEBRTC_STUN_SERVER)) {
+       case PROP_NAME_WEBRTC_STUN_SERVER:
                ret = ms_webrtcbin_set_stun_server(node, param_value);
                if (ret != MEDIA_STREAMER_ERROR_NONE) {
                        ms_error("failed to set STUN server: %s", param_value);
                        return ret;
                }
-               g_value_unset(val);
-               g_value_init(val, G_TYPE_STRING);
-               g_value_set_string(val, param_value);
+               ret = __ms_param_value_set(val, param->data_type, param_value);
+               break;
 
-       } else if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_WEBRTC_REMOTE_SESSION_DESCRIPTION)) {
+       case PROP_NAME_WEBRTC_REMOTE_SESSION_DESCRIPTION:
                ret = ms_webrtcbin_set_remote_session_description(node, param_value);
                if (ret != MEDIA_STREAMER_ERROR_NONE) {
                        ms_error("failed to set remote session description:\n%s", param_value);
                        return ret;
                }
-               g_value_unset(val);
-               g_value_init(val, G_TYPE_STRING);
-               g_value_set_string(val, param_value);
+               ret = __ms_param_value_set(val, param->data_type, param_value);
+               break;
 
-       } else if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_WEBRTC_ADD_ICE_CANDIDATE)) {
+       case PROP_NAME_WEBRTC_ADD_ICE_CANDIDATE:
                ret = ms_webrtcbin_add_ice_candidate(node, param_value);
                if (ret != MEDIA_STREAMER_ERROR_NONE) {
                        ms_error("failed to add ICE candidate: %s", param_value);
                        return ret;
                }
+               break;
 
-       } else {
+       default:
                ms_error("failed to set property, undefined param name[%s]", param->param_name);
                return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
        }
 
-       ms_debug_fleave();
-
-       return MEDIA_STREAMER_ERROR_NONE;
+       return ret;
 }
 
 static gboolean __ms_adaptive_src_node_has_property(media_streamer_node_s *node, const char *param_name)
 {
        GValue *val = NULL;
 
-       ms_debug_fenter();
-
-       ms_retvm_if(!node || !node->gst_element, FALSE, "Error: empty node");
-       ms_retvm_if(!param_name, FALSE, "Error: invalid property parameter");
-
-       if (node->type == MEDIA_STREAMER_NODE_TYPE_SRC &&
-               node->subtype == MEDIA_STREAMER_NODE_SRC_TYPE_ADAPTIVE) {
-               val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param_name);
+       ms_retvm_if(!node, FALSE, "node is NULL");
+       ms_retvm_if(!node->gst_element, FALSE, "gst_element is NULL");
+       ms_retvm_if(!param_name, FALSE, "param_name is NULL");
 
-               ms_debug_fleave();
+       if (node->type != MEDIA_STREAMER_NODE_TYPE_SRC ||
+               node->subtype != MEDIA_STREAMER_NODE_SRC_TYPE_ADAPTIVE)
+               return FALSE;
 
-               return val ? TRUE : FALSE;
-       }
+       val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param_name);
 
-       ms_debug_fleave();
+       ms_debug("node[%s] %s [%s]", node->name, val ? "has" : "does not have", param_name);
 
-       return FALSE;
+       return val ? TRUE : FALSE;
 }
 
 static int __ms_adaptive_src_node_get_property(media_streamer_node_s *node, param_s *param, GValue *value)
@@ -472,23 +558,28 @@ static int __ms_adaptive_src_node_get_property(media_streamer_node_s *node, para
        int ret = MEDIA_STREAMER_ERROR_NONE;
        GValue *val = NULL;
 
-       ms_debug_fenter();
-
-       ms_retvm_if(!node || !node->gst_element, FALSE, "Error: empty node");
+       ms_retvm_if(!node, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "node is NULL");
+       ms_retvm_if(!node->gst_element, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "gst_element is NULL");
        ms_retvm_if(node->type != MEDIA_STREAMER_NODE_TYPE_SRC &&
                        node->subtype != MEDIA_STREAMER_NODE_SRC_TYPE_ADAPTIVE, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Invalid node type");
-       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Error: invalid property parameter");
+       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param is NULL");
        ms_retvm_if(!value, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "value is NULL");
 
+       ms_debug("param[%s]", param->param_name);
+
        val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param->param_name);
-       if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_URI))
-               g_value_init(value, G_TYPE_STRING);
-       else
-               ret = MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
+       if (!val) {
+               ms_error("fail to get [%s] value from [%s]", param->param_name, GST_ELEMENT_NAME(node->gst_element));
+               return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
+       }
+
+       ret = __ms_param_value_init(value, param->data_type);
+       if (ret != MEDIA_STREAMER_ERROR_NONE)
+               return ret;
 
        g_value_copy(val, value);
 
-       ms_debug_fleave();
+       __ms_param_value_print(value, param->data_type);
 
        return ret;
 }
@@ -498,29 +589,22 @@ static int __ms_adaptive_src_node_set_property(media_streamer_node_s *node, para
        int ret = MEDIA_STREAMER_ERROR_NONE;
        GValue *val = NULL;
 
-       ms_debug_fenter();
-
-       ms_retvm_if(!node || !node->gst_element, MEDIA_STREAMER_ERROR_INVALID_OPERATION, "Error: empty node");
+       ms_retvm_if(!node, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "node is NULL");
+       ms_retvm_if(!node->gst_element, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "gst_element is NULL");
        ms_retvm_if(node->type != MEDIA_STREAMER_NODE_TYPE_SRC &&
                        node->subtype != MEDIA_STREAMER_NODE_SRC_TYPE_ADAPTIVE, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Invalid node type");
-       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Error: invalid property parameter");
+       ms_retvm_if(!param, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param is NULL");
        ms_retvm_if(!param_value, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param_value is NULL");
 
+       ms_debug("param[%s] param_value[%s]", param->param_name, param_value);
+
        val = (GValue *)g_object_get_data(G_OBJECT(node->gst_element), param->param_name);
        if (!val) {
                ms_error("fail to get [%s] val from [%s]", param->param_name, GST_ELEMENT_NAME(node->gst_element));
                return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
        }
 
-       if (!strcmp(param->param_name, MEDIA_STREAMER_PARAM_URI)) {
-               g_value_unset(val);
-               g_value_init(val, G_TYPE_STRING);
-               g_value_set_string(val, param_value);
-       } else {
-               ret = MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
-       }
-
-       ms_debug_fleave();
+       ret = __ms_param_value_init(val, param->data_type);
 
        return ret;
 }
@@ -1843,7 +1927,7 @@ static int __ms_node_get_param_list(media_streamer_node_s *node, GList **param_l
                param_spec = g_object_class_find_property(G_OBJECT_GET_CLASS(node->gst_element), param_table[it_param].prop_name);
                if (param_spec || __ms_rtp_node_has_property(node, param_table[it_param].prop_name) ||
                                __ms_adaptive_src_node_has_property(node, param_table[it_param].prop_name)) {
-                       ms_info("Got parameter [%s] for node [%s]", param_table[it_param].param_name, node->name);
+                       ms_info("param [%s, prop:%s] for node [%s]", param_table[it_param].param_name, param_table[it_param].prop_name, node->name);
                        *param_list = g_list_append(*param_list, &(param_table[it_param]));
                }
        }
@@ -1953,7 +2037,7 @@ int ms_node_set_param_value(media_streamer_node_s *node, param_s *param, const c
                break;
 
        default:
-               ms_info("Can not set parameter [%s, %s] in the node [%s]", param->param_name, param->prop_name, node->name);
+               ms_info("Can not set parameter [%s, prop:%s] in the node [%s]", param->param_name, param->prop_name, node->name);
                ret = MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
                break;
        }
@@ -2054,7 +2138,7 @@ int ms_node_get_param(media_streamer_node_s *node, const char *param_name, param
                                        __ms_adaptive_src_node_has_property(node, param_table[it_param].prop_name) ||
                                        __ms_webrtc_node_has_property(node, param_table[it_param].prop_name)) {
                                *param = &(param_table[it_param]);
-                               ms_info("Got parameter [%s, %s] for node [%s]", (*param)->param_name, (*param)->prop_name, node->name);
+                               ms_info("param [%s, prop:%s] for node [%s]", (*param)->param_name, (*param)->prop_name, node->name);
                                found_param = TRUE;
                                break;
                        }
@@ -2074,7 +2158,10 @@ static gchar *__ms_convert_prop_value_to_string(param_s *param, const GValue *va
 
        switch (param->data_type) {
        case PARAM_DATA_TYPE_NUMBER:
-               return g_strdup_printf(G_VALUE_HOLDS_INT(value) ? "%d" : "%u", g_value_get_int(value));
+               if (G_VALUE_HOLDS_INT(value))
+                       return g_strdup_printf("%d", g_value_get_int(value));
+               else
+                       return g_strdup_printf("%u", g_value_get_uint(value));
 
        case PARAM_DATA_TYPE_BOOL:
                return g_strdup(g_value_get_boolean(value) ? "true" : "false");
@@ -2102,7 +2189,7 @@ int ms_node_get_param_value(media_streamer_node_s *node, param_s *param, char **
        ms_retvm_if(param == NULL, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "param is NULL");
        ms_retvm_if(string_value == NULL, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "string_value is NULL");
 
-       ms_debug("node[%s] param[%s]", node->name, param->prop_name);
+       ms_debug("node[%s] prop_name[%s]", node->name, param->prop_name);
 
        if (node->type == MEDIA_STREAMER_NODE_TYPE_RTP)
                ret = __ms_rtp_node_get_property(node, param, &value);
@@ -2115,9 +2202,10 @@ int ms_node_get_param_value(media_streamer_node_s *node, param_s *param, char **
                        g_value_init(&value, param_spec->value_type);
                        g_object_get_property(G_OBJECT(node->gst_element), param->prop_name, &value);
 
-                       ms_info("Got parameter [%s] for node [%s] with description [%s]", param->param_name, node->name, g_param_spec_get_blurb(param_spec));
+                       ms_info("param [%s, prop:%s] for node [%s] with description [%s]",
+                               param->param_name, param->prop_name, node->name, g_param_spec_get_blurb(param_spec));
                } else {
-                       ms_error("There is no parameter [%s] for node [%s]", param->prop_name, node->name);
+                       ms_error("There is no prop_name [%s] for node [%s]", param->prop_name, node->name);
                        return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;
                }
        }