bool verbose_log;
bool nice_verbose;
bool network_simulator;
- gchar **gst_args;
- gchar **gst_excluded_elements;
+ GStrv gst_args;
+ GStrv gst_excluded_elements;
const char *stun_server;
int jitterbuffer_latency;
int bundle_policy;
typedef struct _ini_item_media_source_s {
const char *source_element;
- gchar **source_element_properties;
+ GStrv source_element_properties;
/* video source pipeline */
const char *v_raw_format;
int v_width;
typedef struct _ini_item_rendering_sink_s {
const char *a_sink_element;
const char *v_sink_element;
- gchar **a_hw_decoder_elements;
- gchar **v_hw_decoder_elements;
+ GStrv a_hw_decoder_elements;
+ GStrv v_hw_decoder_elements;
bool v_overlay_resource_required;
} ini_item_rendering_sink_s;
const gchar *klass_name;
GstCaps *src_caps;
GstCaps *sink_caps;
- gchar **excluded_elements;
+ GStrv excluded_elements;
} element_info_s;
typedef struct _webrtc_signal_s {
int _gst_build_pipeline(webrtc_s *webrtc);
void _gst_destroy_pipeline(webrtc_s *webrtc);
int _gst_pipeline_set_state(webrtc_s *webrtc, GstState state);
-void _gst_set_element_properties(GstElement *element, gchar **key_value_pairs);
+void _gst_set_element_properties(GstElement *element, GStrv key_value_pairs);
int _add_media_source(webrtc_s *webrtc, int type, unsigned int *source_id);
int _add_media_source_internal(webrtc_s *webrtc, int type, unsigned int *source_id);
int _remove_media_source(webrtc_s *webrtc, unsigned int source_id);
Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.3.65
+Version: 0.3.66
Release: 0
Group: Multimedia/API
License: Apache-2.0
return delimiter;
}
-static void __ini_read_list(dictionary *dict, const char *category, const char *item, gchar ***list)
+static void __ini_read_list(dictionary *dict, const char *category, const char *item, GStrv *list)
{
const char *str;
gchar *path;
static int __parse_attribute_value(const gchar *value, int *pt, gchar **attr_param)
{
- gchar **values;
+ g_auto(GStrv) values = NULL;
+ gint64 _pt;
RET_VAL_IF(value == NULL, -1, "value is NULL");
RET_VAL_IF(pt == NULL && attr_param == NULL, -1, "pt and attr_param is NULL");
values = g_strsplit(value, " ", 2);
if (g_strv_length(values) != 2) {
LOG_ERROR("empty attribute parameter, value[%s]", value);
- g_strfreev(values);
return -1;
}
if (pt) {
- if (!g_strcmp0(values[0], "0")) {
+ if (g_str_equal(values[0], "0")) {
*pt = 0;
} else {
- *pt = g_ascii_strtoll((const gchar *)values[0], NULL, 10);
+ _pt = g_ascii_strtoll((const gchar *)values[0], NULL, 10);
/* g_ascii_strtoll() returns 0 on failure */
- if (*pt == 0) {
+ if (_pt == 0) {
LOG_ERROR("invalid value[%s] for pt", values[0]);
- g_strfreev(values);
return -1;
}
+
+ *pt = (int)_pt;
}
}
if (attr_param)
*attr_param = g_strdup(values[1]);
- g_strfreev(values);
-
return 0;
}
gchar *factory_name;
GstElementFactory *factory = NULL;
const gchar *factory_klass = NULL;
- gchar **str_arr;
+ GStrv str_arr;
if (!GST_IS_ELEMENT_FACTORY(feature))
return FALSE;
char **argv = NULL;
GError *err = NULL;
gboolean gst_ret;
- gchar **gst_args;
+ GStrv gst_args;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
return WEBRTC_ERROR_NONE;
}
-static void __parse_type_and_set_value(GType type, GstElement *element, gchar **key_value_pair)
+static void __parse_type_and_set_value(GType type, GstElement *element, GStrv key_value_pair)
{
RET_IF(element == NULL, "element is NULL");
RET_IF(key_value_pair == NULL, "key_value_pairs is NULL");
LOG_DEBUG("element[%s] property[%s] value[type:0x%x, %s]", GST_ELEMENT_NAME(element), key_value_pair[0], (unsigned int)type, key_value_pair[1]);
}
-void _gst_set_element_properties(GstElement *element, gchar **key_value_pairs)
+void _gst_set_element_properties(GstElement *element, GStrv key_value_pairs)
{
- gchar **key_value_pair;
+ GStrv key_value_pair;
GParamSpec *param_spec;
RET_IF(element == NULL, "element is NULL");
//LCOV_EXCL_START
static int __parse_message(gchar *message, webrtc_signaling_message_type_e *type, gchar **content)
{
- gchar **contents;
+ g_auto(GStrv) contents = NULL;
RET_VAL_IF(message == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "message is NULL");
RET_VAL_IF(type == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "type is NULL");
contents = g_strsplit(message, " ", 2);
if (g_strv_length(contents) != 2) {
LOG_ERROR("invalid message[%s]", message);
- g_strfreev(contents);
return WEBRTC_ERROR_INVALID_OPERATION;
}
LOG_INFO("[%s] type[%d] content[%s]", contents[0], *type, *content);
- g_strfreev(contents);
-
return WEBRTC_ERROR_NONE;
}
return WEBRTC_ERROR_NONE;
}
-//LCOV_EXCL_STOP
\ No newline at end of file
+//LCOV_EXCL_STOP
return peer;
}
-static received_message_type_e __parse_message(const gchar *message, gchar ***contents)
+static received_message_type_e __parse_message(const gchar *message, GStrv *contents)
{
received_message_type_e type = RECEIVED_MESSAGE_TYPE_UNKNOWN;
webrtc_signaling_server_s *server = (webrtc_signaling_server_s *)lws_context_user(lws_get_context(wsi));
received_message_type_e type;
gchar *message = g_strndup((const gchar *)in, (gsize)len);
- gchar **contents = NULL;
+ g_auto(GStrv) contents = NULL;
LOG_INFO("RECEIVE:\n%s", message);
}
g_free(message);
- if (contents)
- g_strfreev(contents);
break;
}
case LWS_CALLBACK_CLOSED: {
return WEBRTC_ERROR_NONE;
}
-//LCOV_EXCL_STOP
\ No newline at end of file
+//LCOV_EXCL_STOP
static unsigned int __get_id_from_name(const gchar *name)
{
- gchar **tokens = NULL;
- gint64 id;
+ g_auto(GStrv) tokens = NULL;
RET_VAL_IF(name == NULL, 0, "name is NULL");
tokens = g_strsplit(name, "_", 2);
- id = g_ascii_strtoll(tokens[1], NULL, 10);
+ RET_VAL_IF(g_strv_length(tokens) < 2, 0, "invalid name %s", name);
- g_strfreev(tokens);
-
- return (unsigned int)id;
+ return (unsigned int)g_ascii_strtoll(tokens[1], NULL, 10);
}
static void __invoke_track_added_cb(webrtc_s *webrtc, const gchar *name, bool is_audio, bool build_track_context)
gchar *factory_name;
const gchar *klass;
webrtc_s *webrtc = (webrtc_s *)user_data;
- gchar **str_arr;
+ GStrv str_arr;
RET_VAL_IF(webrtc == NULL, GST_AUTOPLUG_SELECT_SKIP, "webrtc is NULL, skip it");
RET_IF(!conn, "conn is NULL");
if (type == WEBRTC_DATA_CHANNEL_TYPE_STRING) {
- gchar **str_arr = NULL;
+ g_auto(GStrv) str_arr = NULL;
g_print("string message[%s]\n", (char *)message);
} else {
__render_text_message_in_idle(conn, message);
}
-
- if (str_arr)
- g_strfreev(str_arr);
-
} else if (type == WEBRTC_DATA_CHANNEL_TYPE_BYTES) {
webrtc_bytes_data_h *data = message;
const char *data_p;
static void __handle_room_related_message(const gchar *text)
{
- gchar **tokens = NULL;
+ g_auto(GStrv) tokens = NULL;
guint len;
guint i;
g_print("\n[from SERVER > %s]\n", text);
g_signaling_server.server_status = SERVER_STATUS_ERROR_FOUND;
}
-
- if (tokens)
- g_strfreev(tokens);
}
static void __websocket_message_cb(SoupWebsocketConnection *ws_conn, SoupWebsocketDataType type, GBytes *message, gpointer user_data)