Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.4.35
+Version: 0.4.36
Release: 0
Group: Multimedia/API
License: Apache-2.0
_channel->webrtc = webrtc;
_channel->channel = dc_obj;
- if (!g_hash_table_insert(webrtc->data_channels, (gpointer)_channel, (gpointer)_channel)) {
- LOG_ERROR("should not be reached here, _channel[%p] already exist, it'll be removed", _channel);
- g_mutex_unlock(&_channel->mutex);
- g_hash_table_remove(webrtc->data_channels, _channel);
- return NULL;
- }
+ ASSERT(g_hash_table_insert(webrtc->data_channels, (gpointer)_channel, (gpointer)_channel));
_connect_and_append_signal(&_channel->signals, dc_obj, "on-open", G_CALLBACK(__data_channel_on_open_cb), _channel);
_connect_and_append_signal(&_channel->signals, dc_obj, "on-message-string", G_CALLBACK(__data_channel_on_message_string_cb), _channel);
if (iniparser_getsecnkeys(ini->dict, category_source_names[i]) > 0) {
ini_item_media_source_s *source = g_new0(ini_item_media_source_s, 1);
__apply_media_source_setting(ini, source, category_source_names[i]);
- if (!g_hash_table_insert(ini->sources, g_strdup(category_source_names[i]), (gpointer)source)) {
- LOG_WARNING("[%s] already exist", category_source_names[i]);
- continue;
- }
+ ASSERT(g_hash_table_insert(ini->sources, g_strdup(category_source_names[i]), (gpointer)source));
}
}
client = g_new0(webrtc_client_slot_s, 1);
client->wsi = wsi;
client->id = id;
- if (!g_hash_table_insert(server->clients, new_peer, (gpointer)client)) {
- LOG_ERROR("should not be reached here, new_peer[%s] already exist, wsi[%p] will be removed", new_peer, wsi);
- g_hash_table_remove(server->clients, new_peer);
- __send_message(wsi, SIGNALING_MESSAGE_REPLY_CONNECT_ERROR);
- return;
- }
+ ASSERT(g_hash_table_insert(server->clients, new_peer, (gpointer)client));
LOG_INFO("[%s] is connected", new_peer);
context = g_main_context_new();
g_main_context_push_thread_default(context);
- if (!g_hash_table_insert(webrtc->track_build_contexts, id, context)) {
- LOG_ERROR("should not be reached here, id[%s] already exist, it'll be removed", id);
- g_hash_table_remove(webrtc->track_build_contexts, id);
- return WEBRTC_ERROR_INVALID_OPERATION;
- }
+ ASSERT(g_hash_table_insert(webrtc->track_build_contexts, id, context));
return WEBRTC_ERROR_NONE;
}
if (__link_pads(webrtc, src_pad, sink, decodebin) != WEBRTC_ERROR_NONE)
goto error_before_insert;
- if (!g_hash_table_insert(webrtc->gst.sink_slots, track_name, (gpointer)sink)) {
- LOG_ERROR("should not be reached here, track_name[%s] already exist, sink id[%u] will be removed", track_name, sink->id);
- g_hash_table_remove(webrtc->gst.sink_slots, track_name);
- return WEBRTC_ERROR_INVALID_OPERATION;
- }
+ ASSERT(g_hash_table_insert(webrtc->gst.sink_slots, track_name, (gpointer)sink));
if (!gst_element_sync_state_with_parent(GST_ELEMENT(sink->bin))) {
LOG_ERROR("failed to gst_element_sync_state_with_parent() for [%s]", GST_ELEMENT_NAME(sink->bin));
if (__link_pads(webrtc, src_pad, sink, depayloader) != WEBRTC_ERROR_NONE)
goto error_before_insert;
- if (!g_hash_table_insert(webrtc->gst.sink_slots, track_name, (gpointer)sink)) {
- LOG_ERROR("should not be reached here, track_name[%s] already exist, sink id[%u] will be removed", track_name, sink->id);
- g_hash_table_remove(webrtc->gst.sink_slots, track_name);
- return WEBRTC_ERROR_INVALID_OPERATION;
- }
+ ASSERT(g_hash_table_insert(webrtc->gst.sink_slots, track_name, (gpointer)sink));
sink->encoded_frame_cb = is_audio ? &(webrtc->encoded_audio_frame_cb) : &(webrtc->encoded_video_frame_cb);
sink->media_types = is_audio ? MEDIA_TYPE_AUDIO : MEDIA_TYPE_VIDEO;
/* The gst_element_get_request_pad() of webrtcbin will trigger the transceiver callback. To update the mline value of
* new transceiver object to the source structure in the callback, hash table inserting should be preceded. */
- if (!g_hash_table_insert(webrtc->gst.source_slots, bin_name, (gpointer)source)) {
- LOG_ERROR("should not be reached here, bin_name[%s] already exist, source id[%u] will be removed", bin_name, source->id);
- g_hash_table_remove(webrtc->gst.source_slots, bin_name);
- return WEBRTC_ERROR_INVALID_OPERATION;
- }
+ ASSERT(g_hash_table_insert(webrtc->gst.source_slots, bin_name, (gpointer)source));
*source_id = source->id;
webrtc->gst.sources[*source_id - 1] = source;
/* The gst_element_get_request_pad() of webrtcbin will trigger the transceiver callback. To update the mline value of
* new transceiver object to the source structure in the callback, hash table inserting should be preceded. */
- if (!g_hash_table_insert(webrtc->gst.source_slots, name, (gpointer)source)) {
- LOG_ERROR("should not be reached here, name[%s] already exist, source id[%u] will be removed", name, source->id);
- g_hash_table_remove(webrtc->gst.source_slots, name);
- return WEBRTC_ERROR_INVALID_OPERATION;
- }
+ ASSERT(g_hash_table_insert(webrtc->gst.source_slots, name, (gpointer)source));
*source_id = source->id;
webrtc->gst.sources[*source_id - 1] = source;