[WEBRTC_STATS_TYPE_REMOTE_OUTBOUND_RTP] = "remote-outbound-rtp",
};
-int g_menu_status;
-int g_cnt;
-gchar g_proxy[MAX_STRING_LEN];
-appdata_s g_ad;
-connection_s g_conns[MAX_CONNECTION_LEN];
-signaling_server_s g_signaling_server;
-static webrtc_signaling_server_h g_inner_signaling_server;
-
-/* for video display */
-static Evas_Object *g_win_id;
-static Evas_Object *g_eo_mine;
-static Evas_Object *g_text_eo_mine;
+static appdata_s g_ad;
#if defined(__DEBUG_VALIDATE_MEDIA_PACKET_SOURCE__) || defined(__DEBUG_VALIDATE_ENCODED_FRAME_CB__)
GstBuffer *__alloc_buffer_from_packet(media_packet_h packet);
static GstElement* __build_appsrc_opus_render_pipeline(GstElement **appsrc);
#endif
+appdata_s *get_appdata(void)
+{
+ return &g_ad;
+}
+
static void win_del(void *data, Evas_Object *obj, void *event)
{
elm_exit();
if (win == NULL)
return -1;
ad->win = win;
- g_win_id = win;
+ ad->win_id = win;
create_render_rect_and_bg(ad->win);
/* Create evas image object for EVAS surface.
* | eo (remote1) | eo (remote2) | *
* |____________________|____________________| */
for (i = 0; i < MAX_CONNECTION_LEN + 1; i++) {
- eo = (i == 0) ? &g_eo_mine : &g_conns[i - 1].render.eo;
+ eo = (i == 0) ? &g_ad.eo_mine : &g_ad.conns[i - 1].render.eo;
*eo = create_image_object(ad->win);
if (!*eo) {
g_print("failed to create evas image object\n");
int i;
for (i = 0; i < MAX_CONNECTION_LEN; i++) {
- if (g_conns[i].render.eo) {
- evas_object_del(g_conns[i].render.eo);
- g_conns[i].render.eo = NULL;
+ if (g_ad.conns[i].render.eo) {
+ evas_object_del(g_ad.conns[i].render.eo);
+ g_ad.conns[i].render.eo = NULL;
}
- if (g_conns[i].render.text_eo) {
- evas_object_del(g_conns[i].render.text_eo);
- g_conns[i].render.text_eo = NULL;
+ if (g_ad.conns[i].render.text_eo) {
+ evas_object_del(g_ad.conns[i].render.text_eo);
+ g_ad.conns[i].render.text_eo = NULL;
}
}
- if (g_eo_mine) {
- evas_object_del(g_eo_mine);
- g_eo_mine = NULL;
+ if (g_ad.eo_mine) {
+ evas_object_del(g_ad.eo_mine);
+ g_ad.eo_mine = NULL;
}
- if (g_win_id) {
- evas_object_del(g_win_id);
- g_win_id = NULL;
+ if (ad->win_id) {
+ evas_object_del(ad->win_id);
+ ad->win_id = NULL;
}
ad->win = NULL;
if (source_idx >= MAX_MEDIA_PACKET_SOURCE_LEN)
return;
- media_packet_source_s *packet_source = &g_conns[conn_idx].packet_sources[source_idx];
+ media_packet_source_s *packet_source = &g_ad.conns[conn_idx].packet_sources[source_idx];
packet_source->source_id = 0;
if (packet_source->format) {
{
int ret = WEBRTC_ERROR_NONE;
- RET_IF(g_conns[index].webrtc, "already created");
+ RET_IF(g_ad.conns[index].webrtc, "already created");
- ret = webrtc_create(&g_conns[index].webrtc);
+ ret = webrtc_create(&g_ad.conns[index].webrtc);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
- g_conns[index].index = index;
- g_print("webrtc[%p, index:%d] is created\n", g_conns[index].webrtc, index);
+ g_ad.conns[index].index = index;
+ g_print("webrtc[%p, index:%d] is created\n", g_ad.conns[index].webrtc, index);
}
static void _webrtc_destroy(int index)
int ret = WEBRTC_ERROR_NONE;
int i;
- RET_IF(!g_conns[index].webrtc, "webrtc is NULL");
+ RET_IF(!g_ad.conns[index].webrtc, "webrtc is NULL");
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].channels[i]) {
- webrtc_destroy_data_channel(g_conns[index].channels[i]);
- g_conns[index].channels[i] = NULL;
+ if (g_ad.conns[index].channels[i]) {
+ webrtc_destroy_data_channel(g_ad.conns[index].channels[i]);
+ g_ad.conns[index].channels[i] = NULL;
}
- g_conns[index].recv_channels[i] = NULL;
+ g_ad.conns[index].recv_channels[i] = NULL;
}
- ret = webrtc_destroy(g_conns[index].webrtc);
+ ret = webrtc_destroy(g_ad.conns[index].webrtc);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
- g_print("webrtc[%p, index:%d] is destroyed\n", g_conns[index].webrtc, index);
+ g_print("webrtc[%p, index:%d] is destroyed\n", g_ad.conns[index].webrtc, index);
- g_conns[index].webrtc = NULL;
- if (g_conns[index].offer) {
- free(g_conns[index].offer);
- g_conns[index].offer = NULL;
+ g_ad.conns[index].webrtc = NULL;
+ if (g_ad.conns[index].offer) {
+ free(g_ad.conns[index].offer);
+ g_ad.conns[index].offer = NULL;
}
- if (g_conns[index].answer) {
- free(g_conns[index].answer);
- g_conns[index].answer = NULL;
+ if (g_ad.conns[index].answer) {
+ free(g_ad.conns[index].answer);
+ g_ad.conns[index].answer = NULL;
}
- if (g_conns[index].remote_desc) {
- free(g_conns[index].remote_desc);
- g_conns[index].remote_desc = NULL;
+ if (g_ad.conns[index].remote_desc) {
+ free(g_ad.conns[index].remote_desc);
+ g_ad.conns[index].remote_desc = NULL;
}
- g_list_free_full(g_conns[index].ice_candidates, free);
- g_conns[index].ice_candidates = NULL;
+ g_list_free_full(g_ad.conns[index].ice_candidates, free);
+ g_ad.conns[index].ice_candidates = NULL;
- g_conns[index].channel_index = 0;
+ g_ad.conns[index].channel_index = 0;
for (i = 0; i < MAX_MEDIA_PACKET_SOURCE_LEN; i++)
__release_packet_source(index, i);
- if (g_conns[index].source.stream_info) {
- sound_manager_destroy_stream_information(g_conns[index].source.stream_info);
- g_conns[index].source.stream_info = NULL;
+ if (g_ad.conns[index].source.stream_info) {
+ sound_manager_destroy_stream_information(g_ad.conns[index].source.stream_info);
+ g_ad.conns[index].source.stream_info = NULL;
}
- if (g_conns[index].render.stream_info) {
- sound_manager_destroy_stream_information(g_conns[index].render.stream_info);
- g_conns[index].render.stream_info = NULL;
+ if (g_ad.conns[index].render.stream_info) {
+ sound_manager_destroy_stream_information(g_ad.conns[index].render.stream_info);
+ g_ad.conns[index].render.stream_info = NULL;
}
- g_conns[index].render.loopback_track_id = 0;
+ g_ad.conns[index].render.loopback_track_id = 0;
#ifndef TIZEN_TV
- if (g_conns[index].encoded_audio_frame_cb_is_set)
- g_conns[index].encoded_audio_frame_cb_is_set = false;
+ if (g_ad.conns[index].encoded_audio_frame_cb_is_set)
+ g_ad.conns[index].encoded_audio_frame_cb_is_set = false;
- if (g_conns[index].encoded_video_frame_cb_is_set)
- g_conns[index].encoded_video_frame_cb_is_set = false;
+ if (g_ad.conns[index].encoded_video_frame_cb_is_set)
+ g_ad.conns[index].encoded_video_frame_cb_is_set = false;
- if (g_conns[index].render.espp) {
- g_conns[index].render.espp = NULL;
+ if (g_ad.conns[index].render.espp) {
+ g_ad.conns[index].render.espp = NULL;
g_print("espp close & destroy\n");
}
#endif
{
int ret = WEBRTC_ERROR_NONE;
- RET_IF(!g_conns[index].webrtc, "webrtc is NULL");
+ RET_IF(!g_ad.conns[index].webrtc, "webrtc is NULL");
- ret = webrtc_start(g_conns[index].webrtc);
+ ret = webrtc_start(g_ad.conns[index].webrtc);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_start() success\n");
#ifndef TIZEN_TV
- if (g_conns[index].encoded_audio_frame_cb_is_set ||
- g_conns[index].encoded_video_frame_cb_is_set) {
- if (!g_conns[index].render.espp)
+ if (g_ad.conns[index].encoded_audio_frame_cb_is_set ||
+ g_ad.conns[index].encoded_video_frame_cb_is_set) {
+ if (!g_ad.conns[index].render.espp)
g_print("espp create & open\n");
}
- if (g_conns[index].encoded_audio_frame_cb_is_set)
+ if (g_ad.conns[index].encoded_audio_frame_cb_is_set)
g_print("espp set audio stream info\n");
- if (g_conns[index].encoded_video_frame_cb_is_set)
+ if (g_ad.conns[index].encoded_video_frame_cb_is_set)
g_print("espp set video stream info\n");
#endif
}
int ret = WEBRTC_ERROR_NONE;
int i;
- RET_IF(!g_conns[index].webrtc, "webrtc is NULL");
+ RET_IF(!g_ad.conns[index].webrtc, "webrtc is NULL");
- ret = webrtc_stop(g_conns[index].webrtc);
+ ret = webrtc_stop(g_ad.conns[index].webrtc);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_stop() success\n");
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].recv_channels[i] != NULL)
- g_conns[index].recv_channels[i] = NULL;
+ if (g_ad.conns[index].recv_channels[i] != NULL)
+ g_ad.conns[index].recv_channels[i] = NULL;
}
#ifdef __DEBUG_VALIDATE_ENCODED_FRAME_CB__
- if (g_conns[index].video_render_pipeline) {
- if (gst_element_set_state(g_conns[index].video_render_pipeline, GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE)
+ if (g_ad.conns[index].video_render_pipeline) {
+ if (gst_element_set_state(g_ad.conns[index].video_render_pipeline, GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE)
g_printerr("failed to set state to NULL\n");
- gst_object_unref(g_conns[index].video_render_pipeline);
- g_conns[index].video_render_pipeline = NULL;
- g_conns[index].appsrc_for_video = NULL;
+ gst_object_unref(g_ad.conns[index].video_render_pipeline);
+ g_ad.conns[index].video_render_pipeline = NULL;
+ g_ad.conns[index].appsrc_for_video = NULL;
g_print("video render pipeline is released\n");
}
- if (g_conns[index].audio_render_pipeline) {
- if (gst_element_set_state(g_conns[index].audio_render_pipeline, GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE)
+ if (g_ad.conns[index].audio_render_pipeline) {
+ if (gst_element_set_state(g_ad.conns[index].audio_render_pipeline, GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE)
g_printerr("failed to set state to NULL\n");
- gst_object_unref(g_conns[index].audio_render_pipeline);
- g_conns[index].audio_render_pipeline = NULL;
- g_conns[index].appsrc_for_audio = NULL;
+ gst_object_unref(g_ad.conns[index].audio_render_pipeline);
+ g_ad.conns[index].audio_render_pipeline = NULL;
+ g_ad.conns[index].appsrc_for_audio = NULL;
g_print("audio render pipeline is released\n");
}
#endif
#ifndef TIZEN_TV
- if (g_conns[index].encoded_audio_frame_cb_is_set ||
- g_conns[index].encoded_video_frame_cb_is_set) {
- if (g_conns[index].render.espp) {
- g_conns[index].render.espp = NULL;
+ if (g_ad.conns[index].encoded_audio_frame_cb_is_set ||
+ g_ad.conns[index].encoded_video_frame_cb_is_set) {
+ if (g_ad.conns[index].render.espp) {
+ g_ad.conns[index].render.espp = NULL;
g_print("espp destroy\n");
}
}
int ret = WEBRTC_ERROR_NONE;
webrtc_state_e state;
- ret = webrtc_get_state(g_conns[index].webrtc, &state);
+ ret = webrtc_get_state(g_ad.conns[index].webrtc, &state);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("state: [%s]\n", g_webrtc_state_str[state]);
int i;
for (i = 0; i < MAX_MEDIA_PACKET_SOURCE_LEN; i++) {
- if (g_conns[index].packet_sources[i].source_id == 0)
+ if (g_ad.conns[index].packet_sources[i].source_id == 0)
return i;
}
return -1;
for (i = 0; i < MAX_MEDIA_PACKET_SOURCE_LEN; i++) {
- if (g_conns[index].packet_sources[i].source_id == source_id)
+ if (g_ad.conns[index].packet_sources[i].source_id == source_id)
return i;
}
i = _get_empty_packet_sources_index(index);
RET_IF(i == -1, "media packet source can be added up to %d", MAX_MEDIA_PACKET_SOURCE_LEN);
}
- ret = webrtc_add_media_source(g_conns[index].webrtc, type, &_source_id);
+ ret = webrtc_add_media_source(g_ad.conns[index].webrtc, type, &_source_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
if (type == WEBRTC_MEDIA_SOURCE_TYPE_MEDIA_PACKET) {
- g_conns[index].packet_sources[i].source_id = _source_id;
- g_mutex_init(&g_conns[index].packet_sources[i].mutex);
- g_cond_init(&g_conns[index].packet_sources[i].cond);
+ g_ad.conns[index].packet_sources[i].source_id = _source_id;
+ g_mutex_init(&g_ad.conns[index].packet_sources[i].mutex);
+ g_cond_init(&g_ad.conns[index].packet_sources[i].cond);
}
break;
case WEBRTC_MEDIA_SOURCE_TYPE_CUSTOM_AUDIO ... WEBRTC_MEDIA_SOURCE_TYPE_CUSTOM_VIDEO:
- ret = webrtc_add_media_source_internal(g_conns[index].webrtc, type, &_source_id);
+ ret = webrtc_add_media_source_internal(g_ad.conns[index].webrtc, type, &_source_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
break;
default:
int ret = WEBRTC_ERROR_NONE;
unsigned int _source_id = 0;
- ret = webrtc_add_media_source(g_conns[index].webrtc, WEBRTC_MEDIA_SOURCE_TYPE_MIC, &_source_id);
+ ret = webrtc_add_media_source(g_ad.conns[index].webrtc, WEBRTC_MEDIA_SOURCE_TYPE_MIC, &_source_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
- if (g_conns[index].source.stream_info) {
- sound_manager_destroy_stream_information(g_conns[index].source.stream_info);
- g_conns[index].source.stream_info = NULL;
+ if (g_ad.conns[index].source.stream_info) {
+ sound_manager_destroy_stream_information(g_ad.conns[index].source.stream_info);
+ g_ad.conns[index].source.stream_info = NULL;
}
- if (__get_mic_sound_stream_info(aec, &g_conns[index].source.stream_info) < 0) {
+ if (__get_mic_sound_stream_info(aec, &g_ad.conns[index].source.stream_info) < 0) {
g_printerr("failed to __get_mic_sound_stream_info()\n");
} else {
- ret = webrtc_mic_source_set_sound_stream_info(g_conns[index].webrtc, _source_id, g_conns[index].source.stream_info);
+ ret = webrtc_mic_source_set_sound_stream_info(g_ad.conns[index].webrtc, _source_id, g_ad.conns[index].source.stream_info);
if (ret != WEBRTC_ERROR_NONE)
g_printerr("failed to webrtc_mic_source_set_sound_stream_info(), ret[0x%x]\n", ret);
}
int ret = WEBRTC_ERROR_NONE;
int i;
- ret = webrtc_remove_media_source(g_conns[index].webrtc, source_id);
+ ret = webrtc_remove_media_source(g_ad.conns[index].webrtc, source_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_remove_media_source() success, source_id[%u]\n", source_id);
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_media_source_set_pause(g_conns[index].webrtc, source_id, media_type, pause);
+ ret = webrtc_media_source_set_pause(g_ad.conns[index].webrtc, source_id, media_type, pause);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_set_pause() success, source_id[%u], media_type[%s], pause[%d]\n",
int ret = WEBRTC_ERROR_NONE;
bool paused = false;
- ret = webrtc_media_source_get_pause(g_conns[index].webrtc, source_id, media_type, &paused);
+ ret = webrtc_media_source_get_pause(g_ad.conns[index].webrtc, source_id, media_type, &paused);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_get_pause() success, source_id[%u], media_type[%s], paused[%d]\n",
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_media_source_set_video_resolution(g_conns[index].webrtc, source_id, width, height);
+ ret = webrtc_media_source_set_video_resolution(g_ad.conns[index].webrtc, source_id, width, height);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_set_video_resolution() success, source_id[%u], [%dx%d]\n", source_id, width, height);
int width;
int height;
- ret = webrtc_media_source_get_video_resolution(g_conns[index].webrtc, source_id, &width, &height);
+ ret = webrtc_media_source_get_video_resolution(g_ad.conns[index].webrtc, source_id, &width, &height);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_get_video_resolution() success, source_id[%u], [%dx%d]\n", source_id, width, height);
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_media_source_set_video_framerate(g_conns[index].webrtc, source_id, framerate);
+ ret = webrtc_media_source_set_video_framerate(g_ad.conns[index].webrtc, source_id, framerate);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_set_video_framerate() success, source_id[%u], framerate[%d]\n", source_id, framerate);
int ret = WEBRTC_ERROR_NONE;
int framerate;
- ret = webrtc_media_source_get_video_framerate(g_conns[index].webrtc, source_id, &framerate);
+ ret = webrtc_media_source_get_video_framerate(g_ad.conns[index].webrtc, source_id, &framerate);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_get_video_framerate() success, source_id[%u], framerate[%d]\n", source_id, framerate);
if (__create_formats(type, &format) == -1)
return;
- ret = webrtc_media_packet_source_set_format(g_conns[index].webrtc, source_id, format);
+ ret = webrtc_media_packet_source_set_format(g_ad.conns[index].webrtc, source_id, format);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_media_format() success, source_id[%u], format[%p]\n", source_id, format);
i = _find_packet_sources_index(index, source_id);
RET_IF(i == -1, "could not find media packet source id[%u]", source_id);
- if (g_conns[index].packet_sources[i].format)
- media_format_unref(g_conns[index].packet_sources[i].format);
- g_conns[index].packet_sources[i].format = format;
- g_conns[index].packet_sources[i].webrtc = g_conns[index].webrtc;
+ if (g_ad.conns[index].packet_sources[i].format)
+ media_format_unref(g_ad.conns[index].packet_sources[i].format);
+ g_ad.conns[index].packet_sources[i].format = format;
+ g_ad.conns[index].packet_sources[i].webrtc = g_ad.conns[index].webrtc;
}
static void _webrtc_media_source_get_transceiver_direction(int index, unsigned int source_id, webrtc_media_type_e media_type)
int ret = WEBRTC_ERROR_NONE;
webrtc_transceiver_direction_e direction;
- ret = webrtc_media_source_get_transceiver_direction(g_conns[index].webrtc, source_id, media_type, &direction);
+ ret = webrtc_media_source_get_transceiver_direction(g_ad.conns[index].webrtc, source_id, media_type, &direction);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_get_transceiver_direction() success, source_id[%u], media_type[%s], direction[%s]\n",
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_media_source_set_transceiver_direction(g_conns[index].webrtc, source_id, media_type, direction);
+ ret = webrtc_media_source_set_transceiver_direction(g_ad.conns[index].webrtc, source_id, media_type, direction);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_set_transceiver_direction() success, source_id[%u], media_type[%s], direction[%s]\n",
static void _webrtc_set_display_type(int index, int type)
{
- g_conns[index].render.display_type = type;
+ g_ad.conns[index].render.display_type = type;
g_print("display type[%d] is set, it'll be applied when starting rendering video.\n", type);
}
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_set_display_mode(g_conns[index].webrtc, track_id, mode);
+ ret = webrtc_set_display_mode(g_ad.conns[index].webrtc, track_id, mode);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_display_mode() success, track_id[%u], mode[%u]\n", track_id, mode);
int ret = WEBRTC_ERROR_NONE;
webrtc_display_mode_e mode;
- ret = webrtc_get_display_mode(g_conns[index].webrtc, track_id, &mode);
+ ret = webrtc_get_display_mode(g_ad.conns[index].webrtc, track_id, &mode);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_get_display_mode() success, track_id[%u], mode[%u]\n", track_id, mode);
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_set_display_visible(g_conns[index].webrtc, track_id, (bool)visible);
+ ret = webrtc_set_display_visible(g_ad.conns[index].webrtc, track_id, (bool)visible);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_display_visible() success, track_id[%u], visible[%u]\n", track_id, visible);
int ret = WEBRTC_ERROR_NONE;
bool visible;
- ret = webrtc_get_display_visible(g_conns[index].webrtc, track_id, &visible);
+ ret = webrtc_get_display_visible(g_ad.conns[index].webrtc, track_id, &visible);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_get_display_visible() success, track_id[%u], visible[%u]\n", track_id, visible);
int ret = WEBRTC_ERROR_NONE;
unsigned int track_id;
- if (!g_conns[index].render.stream_info) {
- ret = sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, NULL, NULL, &g_conns[index].render.stream_info);
+ if (!g_ad.conns[index].render.stream_info) {
+ ret = sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, NULL, NULL, &g_ad.conns[index].render.stream_info);
RET_IF(ret != SOUND_MANAGER_ERROR_NONE, "failed to sound_manager_create_stream_information(), ret[0x%x]", ret);
}
- ret = webrtc_media_source_set_audio_loopback(g_conns[index].webrtc, source_id, g_conns[index].render.stream_info, &track_id);
+ ret = webrtc_media_source_set_audio_loopback(g_ad.conns[index].webrtc, source_id, g_ad.conns[index].render.stream_info, &track_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_set_audio_loopback() success, source_id[%u] track_id[%u]\n", source_id, track_id);
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_media_source_unset_audio_loopback(g_conns[index].webrtc, source_id);
+ ret = webrtc_media_source_unset_audio_loopback(g_ad.conns[index].webrtc, source_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_unset_audio_loopback() success, source_id[%u]\n", source_id);
int ret = WEBRTC_ERROR_NONE;
unsigned int track_id;
- ret = webrtc_media_source_set_video_loopback(g_conns[index].webrtc, source_id, WEBRTC_DISPLAY_TYPE_EVAS, g_eo_mine, &track_id);
+ ret = webrtc_media_source_set_video_loopback(g_ad.conns[index].webrtc, source_id, WEBRTC_DISPLAY_TYPE_EVAS, g_ad.eo_mine, &track_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_set_video_loopback() success, source_id[%u] track_id[%u]\n", source_id, track_id);
- g_conns[index].render.loopback_track_id = track_id;
+ g_ad.conns[index].render.loopback_track_id = track_id;
}
static void _webrtc_media_source_unset_video_loopback(int index, unsigned int source_id)
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_media_source_unset_video_loopback(g_conns[index].webrtc, source_id);
+ ret = webrtc_media_source_unset_video_loopback(g_ad.conns[index].webrtc, source_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
- evas_object_hide(g_eo_mine);
+ evas_object_hide(g_ad.eo_mine);
g_print("webrtc_media_source_unset_video_loopback() success, source_id[%u]\n", source_id);
}
int ret;
int i, j;
gchar *string_with_peer_id;
- string_with_peer_id = g_strdup_printf("[%d] %s", g_signaling_server.local_peer_id, string);
+ string_with_peer_id = g_strdup_printf("[%d] %s", g_ad.signaling_server.local_peer_id, string);
for (i = 0; i < MAX_CONNECTION_LEN; i++) {
- if (!g_conns[i].webrtc)
+ if (!g_ad.conns[i].webrtc)
continue;
for (j = 0; j < MAX_CHANNEL_LEN; j++) {
- if (!g_conns[i].channels[j])
+ if (!g_ad.conns[i].channels[j])
continue;
- g_print("[%d] data_channel[%p], index[%d]: ", i, g_conns[i].channels[j], j);
+ g_print("[%d] data_channel[%p], index[%d]: ", i, g_ad.conns[i].channels[j], j);
if (send_as_bytes) {
- ret = webrtc_data_channel_send_bytes(g_conns[i].channels[j], string_with_peer_id, strlen(string_with_peer_id));
+ ret = webrtc_data_channel_send_bytes(g_ad.conns[i].channels[j], string_with_peer_id, strlen(string_with_peer_id));
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_send_bytes(), string[%s]\n", string_with_peer_id);
else
g_print("webrtc_data_channel_send_bytes() success, string[%s]\n", string_with_peer_id);
} else {
- ret = webrtc_data_channel_send_string(g_conns[i].channels[j], string_with_peer_id);
+ ret = webrtc_data_channel_send_string(g_ad.conns[i].channels[j], string_with_peer_id);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_send_string(), string[%s]\n", string_with_peer_id);
else
g_print("webrtc_data_channel_send_string() success, string[%s]\n", string_with_peer_id);
}
}
- if (g_conns[i].render.loopback_track_id > 0)
- __render_text_message(&g_text_eo_mine, 0, string_with_peer_id);
+ if (g_ad.conns[i].render.loopback_track_id > 0)
+ __render_text_message(&g_ad.text_eo_mine, 0, string_with_peer_id);
}
g_free(string_with_peer_id);
unsigned int buffered_amount;
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].channels[i] == NULL)
+ if (g_ad.conns[index].channels[i] == NULL)
continue;
- g_print("data_channel[%p], index[%d]: ", g_conns[index].channels[i], i);
+ g_print("data_channel[%p], index[%d]: ", g_ad.conns[index].channels[i], i);
fd = open(file_path, O_RDONLY);
if (fd == -1) {
expected_size = g_strdup_printf("expected size:%llu", (unsigned long long)st.st_size);
expected_name = g_strdup_printf("expected name:%s", basename((char *)file_path));
- ret = webrtc_data_channel_send_string(g_conns[index].channels[i], expected_size);
+ ret = webrtc_data_channel_send_string(g_ad.conns[index].channels[i], expected_size);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_send_string(), string[%s]\n", expected_size);
else
g_print("webrtc_data_channel_send_string() success, string[%s]\n", expected_size);
- ret = webrtc_data_channel_send_string(g_conns[index].channels[i], expected_name);
+ ret = webrtc_data_channel_send_string(g_ad.conns[index].channels[i], expected_name);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_send_string(), string[%s]\n", expected_name);
else
sum_size += read_size;
g_print("%s : [%llu / %llu]bytes is read.", file_path, sum_size, (unsigned long long)st.st_size);
- ret = webrtc_data_channel_send_bytes(g_conns[index].channels[i], buffer, (unsigned int)read_size);
+ ret = webrtc_data_channel_send_bytes(g_ad.conns[index].channels[i], buffer, (unsigned int)read_size);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_send_bytes(), file_path[%s], size[%zd]\n", file_path, read_size);
- ret = webrtc_data_channel_get_buffered_amount(g_conns[index].channels[i], &buffered_amount);
+ ret = webrtc_data_channel_get_buffered_amount(g_ad.conns[index].channels[i], &buffered_amount);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_get_buffered_amount()\n");
if (buffered_amount > 0)
static void _webrtc_media_source_set_mute(int index, unsigned int source_id, webrtc_media_type_e media_type, bool mute)
{
- int ret = webrtc_media_source_set_mute(g_conns[index].webrtc, source_id, media_type, mute);
+ int ret = webrtc_media_source_set_mute(g_ad.conns[index].webrtc, source_id, media_type, mute);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_set_mute() success, source_id[%d], media_type[%s], mute[%d]\n",
static void _webrtc_media_source_get_mute(int index, unsigned int source_id, webrtc_media_type_e media_type)
{
bool muted = false;
- int ret = webrtc_media_source_get_mute(g_conns[index].webrtc, source_id, media_type, &muted);
+ int ret = webrtc_media_source_get_mute(g_ad.conns[index].webrtc, source_id, media_type, &muted);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_source_get_mute() success, source_id[%d], media_type[%s], muted[%d]\n",
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_screen_source_set_crop(g_conns[index].webrtc, source_id, x, y, w, h, is_vertical, width, height);
+ ret = webrtc_screen_source_set_crop(g_ad.conns[index].webrtc, source_id, x, y, w, h, is_vertical, width, height);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_screen_source_set_crop(), source_id[%d], ret[0x%x]\n", source_id, ret);
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_screen_source_unset_crop(g_conns[index].webrtc, source_id);
+ ret = webrtc_screen_source_unset_crop(g_ad.conns[index].webrtc, source_id);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_screen_source_unset_crop(), source_id[%d], ret[0x%x]\n", source_id, ret);
}
if (!uri)
return;
- ret = webrtc_set_stun_server(g_conns[index].webrtc, uri);
+ ret = webrtc_set_stun_server(g_ad.conns[index].webrtc, uri);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_stun_server() success, uri[%s]\n", uri);
int ret = WEBRTC_ERROR_NONE;
char *stun_server;
- ret = webrtc_get_stun_server(g_conns[index].webrtc, &stun_server);
+ ret = webrtc_get_stun_server(g_ad.conns[index].webrtc, &stun_server);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("STUN server[%s]", stun_server);
if (!uri)
return;
- ret = webrtc_add_turn_server(g_conns[index].webrtc, uri);
+ ret = webrtc_add_turn_server(g_ad.conns[index].webrtc, uri);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_add_turn_server() success, uri[%s]\n", uri);
{
int ret = 0;
- ret = webrtc_foreach_turn_server(g_conns[index].webrtc, foreach_turn_server, NULL);
+ ret = webrtc_foreach_turn_server(g_ad.conns[index].webrtc, foreach_turn_server, NULL);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_foreach_turn_server() success\n");
{
int ret = 0;
- ret = webrtc_set_bundle_policy(g_conns[index].webrtc, policy);
+ ret = webrtc_set_bundle_policy(g_ad.conns[index].webrtc, policy);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_bundle_policy() success\n");
int ret = 0;
webrtc_bundle_policy_e policy;
- ret = webrtc_get_bundle_policy(g_conns[index].webrtc, &policy);
+ ret = webrtc_get_bundle_policy(g_ad.conns[index].webrtc, &policy);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_get_bundle_policy() success, policy[%d]\n", policy);
{
int ret = 0;
- ret = webrtc_set_ice_transport_policy(g_conns[index].webrtc, policy);
+ ret = webrtc_set_ice_transport_policy(g_ad.conns[index].webrtc, policy);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_ice_transport_policy() success\n");
int ret = 0;
webrtc_ice_transport_policy_e policy;
- ret = webrtc_get_ice_transport_policy(g_conns[index].webrtc, &policy);
+ ret = webrtc_get_ice_transport_policy(g_ad.conns[index].webrtc, &policy);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_get_ice_transport_policy() success, policy[%d]\n", policy);
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_set_rtp_packet_drop_probability(g_conns[0].webrtc, sender, probability);
+ ret = webrtc_set_rtp_packet_drop_probability(g_ad.conns[0].webrtc, sender, probability);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_rtp_packet_drop_probability() success, sender[%u] probability[%f]\n", sender, probability);
int ret = WEBRTC_ERROR_NONE;
float probability;
- ret = webrtc_get_rtp_packet_drop_probability(g_conns[0].webrtc, sender, &probability);
+ ret = webrtc_get_rtp_packet_drop_probability(g_ad.conns[0].webrtc, sender, &probability);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("_webrtc_get_rtp_packet_drop_probability() success, sender[%u] probability[%f]\n", sender, probability);
int i;
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].channels[i] == NULL)
+ if (g_ad.conns[index].channels[i] == NULL)
continue;
- ret = webrtc_data_channel_set_buffered_amount_low_cb(g_conns[index].channels[i], threshold, __data_channel_buffered_amount_low_cb, &g_conns[index]);
+ ret = webrtc_data_channel_set_buffered_amount_low_cb(g_ad.conns[index].channels[i], threshold, __data_channel_buffered_amount_low_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_set_buffered_amount_low_cb(), index[%d]\n", i);
else
unsigned int threshold;
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].channels[i] == NULL)
+ if (g_ad.conns[index].channels[i] == NULL)
continue;
- ret = webrtc_data_channel_get_buffered_amount_low_threshold(g_conns[index].channels[i], &threshold);
+ ret = webrtc_data_channel_get_buffered_amount_low_threshold(g_ad.conns[index].channels[i], &threshold);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_get_buffered_amount_low_threshold(), index[%d]\n", i);
else
int i;
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].channels[i] == NULL)
+ if (g_ad.conns[index].channels[i] == NULL)
continue;
- ret = webrtc_data_channel_unset_buffered_amount_low_cb(g_conns[index].channels[i]);
+ ret = webrtc_data_channel_unset_buffered_amount_low_cb(g_ad.conns[index].channels[i]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_unset_buffered_amount_low_cb(), index[%d]\n", i);
else
unsigned int buffered_amount;
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].channels[i] == NULL)
+ if (g_ad.conns[index].channels[i] == NULL)
continue;
- ret = webrtc_data_channel_get_buffered_amount(g_conns[index].channels[i], &buffered_amount);
+ ret = webrtc_data_channel_get_buffered_amount(g_ad.conns[index].channels[i], &buffered_amount);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_data_channel_get_buffered_amount(), index[%d]\n", i);
else
return;
}
- ret = webrtc_foreach_stats(g_conns[index].webrtc, type_mask, __stats_cb, NULL);
+ ret = webrtc_foreach_stats(g_ad.conns[index].webrtc, type_mask, __stats_cb, NULL);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_foreach_stats(), index[%d]\n", index);
else
RET_IF(!message, "message is NULL");
message_for_room = g_strdup_printf ("ROOM_PEER_MSG %d %s", remote_peer_id, message);
- soup_websocket_connection_send_text(g_signaling_server.ws_conn, message_for_room);
+ soup_websocket_connection_send_text(g_ad.signaling_server.ws_conn, message_for_room);
g_free(message_for_room);
}
if (type == SIGNALING_MESSAGE_TYPE_CONNECTED) {
g_print("\n[from SERVER > CONNECTED %s]\n", message);
- g_signaling_server.is_connected = true;
- g_signaling_server.server_status = SERVER_STATUS_CONNECTED;
- g_signaling_server.local_peer_id = atoi(message);
+ g_ad.signaling_server.is_connected = true;
+ g_ad.signaling_server.server_status = SERVER_STATUS_CONNECTED;
+ g_ad.signaling_server.local_peer_id = atoi(message);
} else if (type == SIGNALING_MESSAGE_TYPE_DISCONNECTED) {
g_print("\n[from SERVER > DISCONNECTED %s]\n", message);
- g_signaling_server.is_connected = false;
- g_signaling_server.server_status = SERVER_STATUS_DISCONNECTED;
+ g_ad.signaling_server.is_connected = false;
+ g_ad.signaling_server.server_status = SERVER_STATUS_DISCONNECTED;
} else if (type == SIGNALING_MESSAGE_TYPE_SESSION_ESTABLISHED) {
g_print("\n[from SERVER > SESSION_ESTABLISHED with %s]\n", message);
- g_signaling_server.server_status = SERVER_STATUS_SESSION_ESTABLISHED;
+ g_ad.signaling_server.server_status = SERVER_STATUS_SESSION_ESTABLISHED;
} else if (type == SIGNALING_MESSAGE_TYPE_SESSION_CLOSED) {
g_print("\n[from SERVER > SESSION_CLOSED with %s]\n", message);
- g_signaling_server.server_status = SERVER_STATUS_SESSION_CLOSED;
+ g_ad.signaling_server.server_status = SERVER_STATUS_SESSION_CLOSED;
} else if (type == SIGNALING_MESSAGE_TYPE_SDP) {
g_print("\n[from SERVER > SDP]\n%s\n", message);
{
int ret = WEBRTC_ERROR_NONE;
- if (strlen(g_signaling_server.url) > 0) {
- g_printerr("server[%s] is already set by 'ss'\n", g_signaling_server.url);
+ if (strlen(g_ad.signaling_server.url) > 0) {
+ g_printerr("server[%s] is already set by 'ss'\n", g_ad.signaling_server.url);
return;
}
- ret = webrtc_signaling_connect(ip, port, __signaling_message_cb, &g_conns[0], &g_signaling_server.signaling_client);
+ ret = webrtc_signaling_connect(ip, port, __signaling_message_cb, &g_ad.conns[0], &g_ad.signaling_server.signaling_client);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
- if (g_signaling_server.private_ip)
- free(g_signaling_server.private_ip);
- g_signaling_server.private_ip = strdup(ip);
- g_signaling_server.port = port;
+ if (g_ad.signaling_server.private_ip)
+ free(g_ad.signaling_server.private_ip);
+ g_ad.signaling_server.private_ip = strdup(ip);
+ g_ad.signaling_server.port = port;
g_print("webrtc_signaling_connect() success\n");
}
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_signaling_disconnect(g_signaling_server.signaling_client);
+ ret = webrtc_signaling_disconnect(g_ad.signaling_server.signaling_client);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_signaling_disconnect() success\n");
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_signaling_request_session(g_signaling_server.signaling_client, peer_id);
+ ret = webrtc_signaling_request_session(g_ad.signaling_server.signaling_client, peer_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_signaling_request_session() success\n");
int ret = WEBRTC_ERROR_NONE;
RET_IF(!message, "message is NULL");
- RET_IF(!g_signaling_server.signaling_client, "signaling_client is NULL");
+ RET_IF(!g_ad.signaling_server.signaling_client, "signaling_client is NULL");
- ret = webrtc_signaling_send_message(g_signaling_server.signaling_client, message);
+ ret = webrtc_signaling_send_message(g_ad.signaling_server.signaling_client, message);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_signaling_send_message() success\n");
RET_IF(!conn, "conn is NULL");
g_print("\n[to SERVER > ICE]\n%s\n", candidate);
- if (g_signaling_server.ws_conn) {
+ if (g_ad.signaling_server.ws_conn) {
if (conn->is_for_room)
_websocket_connection_send_text_for_room(conn, conn->remote_peer_id, candidate);
else
- soup_websocket_connection_send_text(g_signaling_server.ws_conn, candidate);
- } else if (g_signaling_server.signaling_client && g_signaling_server.is_connected) {
+ soup_websocket_connection_send_text(g_ad.signaling_server.ws_conn, candidate);
+ } else if (g_ad.signaling_server.signaling_client && g_ad.signaling_server.is_connected) {
_webrtc_signaling_send_message(candidate);
}
}
static void _webrtc_set_all_negotiation_state_change_cbs(int index)
{
- int ret = webrtc_set_peer_connection_state_change_cb(g_conns[index].webrtc, __peer_connection_state_change_cb, &g_conns[index]);
+ int ret = webrtc_set_peer_connection_state_change_cb(g_ad.conns[index].webrtc, __peer_connection_state_change_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_peer_connection_state_change_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_set_peer_connection_state_change_cb() success\n");
- ret = webrtc_set_signaling_state_change_cb(g_conns[index].webrtc, __signaling_state_change_cb, &g_conns[index]);
+ ret = webrtc_set_signaling_state_change_cb(g_ad.conns[index].webrtc, __signaling_state_change_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_signaling_state_change_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_set_signaling_state_change_cb() success\n");
- ret = webrtc_set_ice_gathering_state_change_cb(g_conns[index].webrtc, __ice_gathering_state_change_cb, &g_conns[index]);
+ ret = webrtc_set_ice_gathering_state_change_cb(g_ad.conns[index].webrtc, __ice_gathering_state_change_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_ice_gathering_state_change_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_set_ice_gathering_state_change_cb() success\n");
- ret = webrtc_set_ice_connection_state_change_cb(g_conns[index].webrtc, __ice_connection_state_change_cb, &g_conns[index]);
+ ret = webrtc_set_ice_connection_state_change_cb(g_ad.conns[index].webrtc, __ice_connection_state_change_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_ice_connection_state_change_cb(), ret[0x%x]\n", ret);
else
static void _webrtc_unset_all_negotiation_state_change_cbs(int index)
{
- int ret = webrtc_unset_peer_connection_state_change_cb(g_conns[index].webrtc);
+ int ret = webrtc_unset_peer_connection_state_change_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_peer_connection_state_change_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_unset_peer_connection_state_change_cb() success\n");
- ret = webrtc_unset_signaling_state_change_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_signaling_state_change_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_signaling_state_change_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_unset_signaling_state_change_cb() success\n");
- ret = webrtc_unset_ice_gathering_state_change_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_ice_gathering_state_change_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_ice_gathering_state_change_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_unset_ice_gathering_state_change_cb() success\n");
- ret = webrtc_unset_ice_connection_state_change_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_ice_connection_state_change_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_ice_connection_state_change_cb(), ret[0x%x]\n", ret);
else
webrtc_ice_gathering_state_e ice_gathering_state = WEBRTC_ICE_GATHERING_STATE_NEW;
webrtc_ice_connection_state_e ice_conn_state = WEBRTC_ICE_CONNECTION_STATE_NEW;
- ret = webrtc_get_peer_connection_state(g_conns[index].webrtc, &peer_conn_state);
+ ret = webrtc_get_peer_connection_state(g_ad.conns[index].webrtc, &peer_conn_state);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_get_peer_connection_state()\n");
- ret = webrtc_get_signaling_state(g_conns[index].webrtc, &signaling_state);
+ ret = webrtc_get_signaling_state(g_ad.conns[index].webrtc, &signaling_state);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_get_signaling_state()\n");
- ret = webrtc_get_ice_gathering_state(g_conns[index].webrtc, &ice_gathering_state);
+ ret = webrtc_get_ice_gathering_state(g_ad.conns[index].webrtc, &ice_gathering_state);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_get_ice_gathering_state()\n");
- ret = webrtc_get_ice_connection_state(g_conns[index].webrtc, &ice_conn_state);
+ ret = webrtc_get_ice_connection_state(g_ad.conns[index].webrtc, &ice_conn_state);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_get_ice_connection_state()\n");
if (type == WEBRTC_MEDIA_TYPE_VIDEO) {
#ifndef __DEBUG_VALIDATE_ENCODED_FRAME_CB__
if (conn->render.display_type == WEBRTC_DISPLAY_TYPE_OVERLAY) {
- g_print("Video track is added, set display - overlay, object[%p]\n", g_win_id);
- webrtc_set_display(webrtc, id, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win_id);
+ g_print("Video track is added, set display - overlay, object[%p]\n", g_ad.win_id);
+ webrtc_set_display(webrtc, id, WEBRTC_DISPLAY_TYPE_OVERLAY, g_ad.win_id);
} else if (conn->render.display_type == WEBRTC_DISPLAY_TYPE_EVAS) {
g_print("Video track is added, set display - evas object[%p]\n", conn->render.eo);
static void _webrtc_set_all_basic_cbs(int index)
{
/* COMMON */
- int ret = webrtc_set_error_cb(g_conns[index].webrtc, __error_cb, g_conns[index].webrtc);
+ int ret = webrtc_set_error_cb(g_ad.conns[index].webrtc, __error_cb, g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_error_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_set_error_cb() success\n");
- ret = webrtc_set_state_changed_cb(g_conns[index].webrtc, __state_changed_cb, &g_conns[index]);
+ ret = webrtc_set_state_changed_cb(g_ad.conns[index].webrtc, __state_changed_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_state_changed_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_set_state_changed_cb() success\n");
- ret = webrtc_set_negotiation_needed_cb(g_conns[index].webrtc, __negotiation_needed_cb, g_conns[index].webrtc);
+ ret = webrtc_set_negotiation_needed_cb(g_ad.conns[index].webrtc, __negotiation_needed_cb, g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_negotiation_needed_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_set_negotiation_needed_cb() success\n");
- ret = webrtc_set_ice_candidate_cb(g_conns[index].webrtc, __ice_candidate_cb, &g_conns[index]);
+ ret = webrtc_set_ice_candidate_cb(g_ad.conns[index].webrtc, __ice_candidate_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_ice_candidate_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_set_ice_candidate_cb() success\n");
/* MEDIA RENDER */
- ret = webrtc_set_track_added_cb(g_conns[index].webrtc, __track_added_cb, &g_conns[index]);
+ ret = webrtc_set_track_added_cb(g_ad.conns[index].webrtc, __track_added_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_track_added_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_set_track_added_cb() success\n");
/* DATA CHANNEL */
- ret = webrtc_set_data_channel_cb(g_conns[index].webrtc, __data_channel_cb, &g_conns[index]);
+ ret = webrtc_set_data_channel_cb(g_ad.conns[index].webrtc, __data_channel_cb, &g_ad.conns[index]);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_data_channel_cb(), ret[0x%x]\n", ret);
else
static void _webrtc_unset_all_basic_cbs(int index)
{
/* COMMON */
- int ret = webrtc_unset_error_cb(g_conns[index].webrtc);
+ int ret = webrtc_unset_error_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_error_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_unset_error_cb() success\n");
- ret = webrtc_unset_state_changed_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_state_changed_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_state_changed_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_unset_state_changed_cb() success\n");
- ret = webrtc_unset_negotiation_needed_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_negotiation_needed_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_negotiation_needed_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_unset_negotiation_needed_cb() success\n");
- ret = webrtc_unset_ice_candidate_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_ice_candidate_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_ice_candidate_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_unset_ice_candidate_cb() success\n");
/* MEDIA RENDER */
- ret = webrtc_unset_track_added_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_track_added_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_track_added_cb(), ret[0x%x]\n", ret);
else
g_print("webrtc_unset_track_added_cb() success\n");
/* DATA CHANNEL */
- ret = webrtc_unset_data_channel_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_data_channel_cb(g_ad.conns[index].webrtc);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_unset_data_channel_cb(), ret[0x%x]\n", ret);
else
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_set_encoded_audio_frame_cb(g_conns[index].webrtc, __encoded_frame_cb, &g_conns[index]);
+ ret = webrtc_set_encoded_audio_frame_cb(g_ad.conns[index].webrtc, __encoded_frame_cb, &g_ad.conns[index]);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_encoded_audio_frame_cb() success\n");
#ifndef __DEBUG_VALIDATE_ENCODED_FRAME_CB__
#ifndef TIZEN_TV
- if (!g_conns[index].encoded_audio_frame_cb_is_set) {
- g_conns[index].encoded_audio_frame_cb_is_set = true;
- if (!g_conns[index].render.espp)
+ if (!g_ad.conns[index].encoded_audio_frame_cb_is_set) {
+ g_ad.conns[index].encoded_audio_frame_cb_is_set = true;
+ if (!g_ad.conns[index].render.espp)
g_print("espp create & open\n");
g_print("espp set audio stream info\n");
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_unset_encoded_audio_frame_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_encoded_audio_frame_cb(g_ad.conns[index].webrtc);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_unset_encoded_audio_frame_cb() success\n");
#ifndef __DEBUG_VALIDATE_ENCODED_FRAME_CB__
#ifndef TIZEN_TV
- if (g_conns[index].encoded_audio_frame_cb_is_set) {
- g_conns[index].encoded_audio_frame_cb_is_set = false;
+ if (g_ad.conns[index].encoded_audio_frame_cb_is_set) {
+ g_ad.conns[index].encoded_audio_frame_cb_is_set = false;
g_print("espp close & destroy\n");
}
#endif
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_set_encoded_video_frame_cb(g_conns[index].webrtc, __encoded_frame_cb, &g_conns[index]);
+ ret = webrtc_set_encoded_video_frame_cb(g_ad.conns[index].webrtc, __encoded_frame_cb, &g_ad.conns[index]);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_set_encoded_video_frame_cb() success\n");
#ifndef __DEBUG_VALIDATE_ENCODED_FRAME_CB__
#ifndef TIZEN_TV
- if (!g_conns[index].encoded_video_frame_cb_is_set) {
- g_conns[index].encoded_video_frame_cb_is_set = true;
- if (!g_conns[index].render.espp) {
+ if (!g_ad.conns[index].encoded_video_frame_cb_is_set) {
+ g_ad.conns[index].encoded_video_frame_cb_is_set = true;
+ if (!g_ad.conns[index].render.espp) {
g_print("espp create & open\n");
}
g_print("espp set video stream info\n");
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_unset_encoded_video_frame_cb(g_conns[index].webrtc);
+ ret = webrtc_unset_encoded_video_frame_cb(g_ad.conns[index].webrtc);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_unset_encoded_video_frame_cb() success\n");
#ifndef __DEBUG_VALIDATE_ENCODED_FRAME_CB__
#ifndef TIZEN_TV
- if (g_conns[index].encoded_video_frame_cb_is_set) {
- g_conns[index].encoded_video_frame_cb_is_set = false;
+ if (g_ad.conns[index].encoded_video_frame_cb_is_set) {
+ g_ad.conns[index].encoded_video_frame_cb_is_set = false;
g_print("espp close & destroy\n");
}
#endif
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_media_packet_source_set_buffer_state_changed_cb(g_conns[index].webrtc, source_id, __media_packet_source_buffer_state_changed_cb, &g_conns[index]);
+ ret = webrtc_media_packet_source_set_buffer_state_changed_cb(g_ad.conns[index].webrtc, source_id, __media_packet_source_buffer_state_changed_cb, &g_ad.conns[index]);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_packet_source_set_buffer_state_changed_cb() success\n");
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_media_packet_source_unset_buffer_state_changed_cb(g_conns[index].webrtc, source_id);
+ ret = webrtc_media_packet_source_unset_buffer_state_changed_cb(g_ad.conns[index].webrtc, source_id);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_media_packet_source_unset_buffer_state_changed_cb() success\n");
_webrtc_set_all_negotiation_state_change_cbs(index);
for (i = 0; i < MAX_MEDIA_PACKET_SOURCE_LEN; i++) {
- if (g_conns[index].packet_sources[i].source_id > 0)
- _webrtc_media_packet_source_set_buffer_state_changed_cb(0, g_conns[index].packet_sources[i].source_id);
+ if (g_ad.conns[index].packet_sources[i].source_id > 0)
+ _webrtc_media_packet_source_set_buffer_state_changed_cb(0, g_ad.conns[index].packet_sources[i].source_id);
}
}
_webrtc_unset_all_negotiation_state_change_cbs(index);
for (i = 0; i < MAX_MEDIA_PACKET_SOURCE_LEN; i++) {
- if (g_conns[index].packet_sources[i].source_id > 0)
- _webrtc_media_packet_source_unset_buffer_state_changed_cb(0, g_conns[index].packet_sources[i].source_id);
+ if (g_ad.conns[index].packet_sources[i].source_id > 0)
+ _webrtc_media_packet_source_unset_buffer_state_changed_cb(0, g_ad.conns[index].packet_sources[i].source_id);
}
}
int ret = WEBRTC_ERROR_NONE;
gchar *label;
- RET_IF(g_conns[index].channel_index == MAX_CHANNEL_LEN, "%d channels are already created, skip it", MAX_CHANNEL_LEN);
+ RET_IF(g_ad.conns[index].channel_index == MAX_CHANNEL_LEN, "%d channels are already created, skip it", MAX_CHANNEL_LEN);
- label = g_strdup_printf("data_channel_%d_%d", index, g_conns[index].channel_index);
+ label = g_strdup_printf("data_channel_%d_%d", index, g_ad.conns[index].channel_index);
- ret = webrtc_create_data_channel(g_conns[index].webrtc, label, NULL, &g_conns[index].channels[g_conns[index].channel_index]);
+ ret = webrtc_create_data_channel(g_ad.conns[index].webrtc, label, NULL, &g_ad.conns[index].channels[g_ad.conns[index].channel_index]);
if (ret != WEBRTC_ERROR_NONE) {
g_print("failed to webrtc_create_data_channel()\n");
} else {
g_print("webrtc_create_data_channel() success, channel[%p], index[%d]\n",
- g_conns[index].channels[g_conns[index].channel_index], g_conns[index].channel_index);
- webrtc_data_channel_set_open_cb(g_conns[index].channels[g_conns[index].channel_index], __data_channel_open_cb, &g_conns[index]);
- webrtc_data_channel_set_message_cb(g_conns[index].channels[g_conns[index].channel_index], __data_channel_message_cb, &g_conns[index]);
- webrtc_data_channel_set_error_cb(g_conns[index].channels[g_conns[index].channel_index], __data_channel_error_cb, &g_conns[index]);
- webrtc_data_channel_set_close_cb(g_conns[index].channels[g_conns[index].channel_index], __data_channel_close_cb, &g_conns[index]);
- g_conns[index].channel_index++;
+ g_ad.conns[index].channels[g_ad.conns[index].channel_index], g_ad.conns[index].channel_index);
+ webrtc_data_channel_set_open_cb(g_ad.conns[index].channels[g_ad.conns[index].channel_index], __data_channel_open_cb, &g_ad.conns[index]);
+ webrtc_data_channel_set_message_cb(g_ad.conns[index].channels[g_ad.conns[index].channel_index], __data_channel_message_cb, &g_ad.conns[index]);
+ webrtc_data_channel_set_error_cb(g_ad.conns[index].channels[g_ad.conns[index].channel_index], __data_channel_error_cb, &g_ad.conns[index]);
+ webrtc_data_channel_set_close_cb(g_ad.conns[index].channels[g_ad.conns[index].channel_index], __data_channel_close_cb, &g_ad.conns[index]);
+ g_ad.conns[index].channel_index++;
}
g_free(label);
int i;
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].channels[i] == NULL)
+ if (g_ad.conns[index].channels[i] == NULL)
continue;
- ret = webrtc_destroy_data_channel(g_conns[index].channels[i]);
+ ret = webrtc_destroy_data_channel(g_ad.conns[index].channels[i]);
if (ret != WEBRTC_ERROR_NONE) {
g_print("failed to _webrtc_destroy_data_channel(), index[%d]\n", i);
} else {
g_print("_webrtc_destroy_data_channel() success, send channel index[%d]\n", i);
- g_conns[index].channels[i] = NULL;
+ g_ad.conns[index].channels[i] = NULL;
}
}
- g_conns[index].channel_index = 0;
+ g_ad.conns[index].channel_index = 0;
for (i = 0; i < MAX_CHANNEL_LEN; i++)
- g_conns[index].recv_channels[i] = NULL;
+ g_ad.conns[index].recv_channels[i] = NULL;
}
static void _webrtc_data_channel_get_label(int index)
char *label = NULL;
for (i = 0; i < MAX_CHANNEL_LEN; i++) {
- if (g_conns[index].channels[i] == NULL)
+ if (g_ad.conns[index].channels[i] == NULL)
continue;
- label = __get_channel_label(g_conns[index].channels[i]);
+ label = __get_channel_label(g_ad.conns[index].channels[i]);
if (!label)
continue;
if (!uri)
return;
- if (g_signaling_server.signaling_client) {
+ if (g_ad.signaling_server.signaling_client) {
g_printerr("already set by 'scc'\n");
return;
}
static void _request_session(int remote_peer_id)
{
- if (!g_signaling_server.ws_conn && !g_signaling_server.is_connected) {
- g_printerr("server[%s] is not connected\n", g_signaling_server.url);
+ if (!g_ad.signaling_server.ws_conn && !g_ad.signaling_server.is_connected) {
+ g_printerr("server[%s] is not connected\n", g_ad.signaling_server.url);
return;
}
- if (g_signaling_server.ws_conn) {
+ if (g_ad.signaling_server.ws_conn) {
gchar *msg;
- if (soup_websocket_connection_get_state(g_signaling_server.ws_conn) != SOUP_WEBSOCKET_STATE_OPEN) {
+ if (soup_websocket_connection_get_state(g_ad.signaling_server.ws_conn) != SOUP_WEBSOCKET_STATE_OPEN) {
g_printerr("websocket is not opened\n");
return;
}
msg = g_strdup_printf("SESSION %d", remote_peer_id);
g_print("\n[to SERVER > %s]\n", msg);
- soup_websocket_connection_send_text(g_signaling_server.ws_conn, msg);
+ soup_websocket_connection_send_text(g_ad.signaling_server.ws_conn, msg);
g_free(msg);
} else {
RET_IF(!room_name, "room_name is NULL");
- if (!g_signaling_server.ws_conn && !g_signaling_server.is_connected) {
- g_printerr("server[%s] is not connected\n", g_signaling_server.url);
+ if (!g_ad.signaling_server.ws_conn && !g_ad.signaling_server.is_connected) {
+ g_printerr("server[%s] is not connected\n", g_ad.signaling_server.url);
return;
}
- RET_IF(!g_signaling_server.ws_conn, "ws_conn is NULL");
+ RET_IF(!g_ad.signaling_server.ws_conn, "ws_conn is NULL");
- if (soup_websocket_connection_get_state(g_signaling_server.ws_conn) != SOUP_WEBSOCKET_STATE_OPEN) {
+ if (soup_websocket_connection_get_state(g_ad.signaling_server.ws_conn) != SOUP_WEBSOCKET_STATE_OPEN) {
g_printerr("websocket is not opened\n");
return;
}
msg = g_strdup_printf("ROOM %s", room_name);
g_print("\n[to SERVER > %s]\n", msg);
- soup_websocket_connection_send_text(g_signaling_server.ws_conn, msg);
+ soup_websocket_connection_send_text(g_ad.signaling_server.ws_conn, msg);
g_free(msg);
}
{
char *desc;
- if (!g_signaling_server.ws_conn && !g_signaling_server.is_connected) {
- g_printerr("server[%s] is not connected\n", g_signaling_server.url);
+ if (!g_ad.signaling_server.ws_conn && !g_ad.signaling_server.is_connected) {
+ g_printerr("server[%s] is not connected\n", g_ad.signaling_server.url);
return;
}
- desc = is_offer ? g_conns[0].offer : g_conns[0].answer;
+ desc = is_offer ? g_ad.conns[0].offer : g_ad.conns[0].answer;
g_print("\n[to SERVER > local description]\n%s\n", desc);
- if (g_signaling_server.ws_conn)
- soup_websocket_connection_send_text(g_signaling_server.ws_conn, desc);
+ if (g_ad.signaling_server.ws_conn)
+ soup_websocket_connection_send_text(g_ad.signaling_server.ws_conn, desc);
else
_webrtc_signaling_send_message(desc);
}
int i = _find_packet_sources_index(index, source_id);
RET_IF(i == -1, "could not find media packet source id[%u]", source_id);
- RET_IF(!g_conns[index].packet_sources[i].format, "please call webrtc_media_packet_source_set_format() first, press 'f'");
+ RET_IF(!g_ad.conns[index].packet_sources[i].format, "please call webrtc_media_packet_source_set_format() first, press 'f'");
- if (!g_conns[index].packet_sources[i].src_pipeline) {
- g_conns[index].packet_sources[i].src_pipeline = __make_src_pipeline(&g_conns[index].packet_sources[i]);
- RET_IF(!g_conns[index].packet_sources[i].src_pipeline, "src_pipeline is NULL");
+ if (!g_ad.conns[index].packet_sources[i].src_pipeline) {
+ g_ad.conns[index].packet_sources[i].src_pipeline = __make_src_pipeline(&g_ad.conns[index].packet_sources[i]);
+ RET_IF(!g_ad.conns[index].packet_sources[i].src_pipeline, "src_pipeline is NULL");
}
- state_change_ret = gst_element_set_state(g_conns[index].packet_sources[i].src_pipeline, GST_STATE_PLAYING);
+ state_change_ret = gst_element_set_state(g_ad.conns[index].packet_sources[i].src_pipeline, GST_STATE_PLAYING);
#ifdef __DEBUG_VALIDATE_MEDIA_PACKET_SOURCE__
- if (g_conns[index].packet_sources[i].render_pipeline)
- state_change_ret = gst_element_set_state(g_conns[index].packet_sources[i].render_pipeline, GST_STATE_PLAYING);
+ if (g_ad.conns[index].packet_sources[i].render_pipeline)
+ state_change_ret = gst_element_set_state(g_ad.conns[index].packet_sources[i].render_pipeline, GST_STATE_PLAYING);
#endif
RET_IF(state_change_ret == GST_STATE_CHANGE_FAILURE, "failed to set state to PLAYING");
- g_conns[index].packet_sources[i].is_stop_requested = false;
+ g_ad.conns[index].packet_sources[i].is_stop_requested = false;
g_print("_start_pushing_packet()\n");
}
int i = _find_packet_sources_index(index, source_id);
RET_IF(i == -1, "could not find media packet source id[%u]", source_id);
- RET_IF(!g_conns[index].packet_sources[i].src_pipeline, "already stopped for pushing packet");
+ RET_IF(!g_ad.conns[index].packet_sources[i].src_pipeline, "already stopped for pushing packet");
- if (g_conns[index].packet_sources[i].is_overflowed)
- g_cond_signal(&g_conns[index].packet_sources[i].cond);
+ if (g_ad.conns[index].packet_sources[i].is_overflowed)
+ g_cond_signal(&g_ad.conns[index].packet_sources[i].cond);
- g_conns[index].packet_sources[i].is_stop_requested = true;
+ g_ad.conns[index].packet_sources[i].is_stop_requested = true;
- gst_element_set_state(g_conns[index].packet_sources[i].src_pipeline, GST_STATE_PAUSED);
+ gst_element_set_state(g_ad.conns[index].packet_sources[i].src_pipeline, GST_STATE_PAUSED);
#ifdef __DEBUG_VALIDATE_MEDIA_PACKET_SOURCE__
- if (g_conns[index].packet_sources[i].render_pipeline)
- gst_element_set_state(g_conns[index].packet_sources[i].render_pipeline, GST_STATE_PAUSED);
+ if (g_ad.conns[index].packet_sources[i].render_pipeline)
+ gst_element_set_state(g_ad.conns[index].packet_sources[i].render_pipeline, GST_STATE_PAUSED);
#endif
g_print("_stop_pushing_packet()\n");
{
int ret = 0;
- ret = webrtc_file_source_set_path(g_conns[index].webrtc, source_id, path);
+ ret = webrtc_file_source_set_path(g_ad.conns[index].webrtc, source_id, path);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_file_source_set_path(), source_id[%d], ret[0x%x]\n", source_id, ret);
else
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_file_source_set_looping(g_conns[index].webrtc, source_id, looping);
+ ret = webrtc_file_source_set_looping(g_ad.conns[index].webrtc, source_id, looping);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_file_source_set_looping() success, source_id[%u] looping_state[%u]\n", source_id, looping);
int ret = WEBRTC_ERROR_NONE;
bool looping_state;
- ret = webrtc_file_source_get_looping(g_conns[index].webrtc, source_id, &looping_state);
+ ret = webrtc_file_source_get_looping(g_ad.conns[index].webrtc, source_id, &looping_state);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_file_source_get_looping() success, source_id[%u] looping_state[%u]\n", source_id, looping_state);
for (i = 0; i < MAX_CONNECTION_LEN; i++) {
unsigned int source_id = 0;
- if (g_conns[i].webrtc)
+ if (g_ad.conns[i].webrtc)
continue;
- g_conns[i].remote_peer_id = atoi((const char *)peer_id);
- g_conns[i].is_for_room = true;
- g_conns[i].is_offer = is_offer;
+ g_ad.conns[i].remote_peer_id = atoi((const char *)peer_id);
+ g_ad.conns[i].is_for_room = true;
+ g_ad.conns[i].is_offer = is_offer;
if (i > 0) /* follow the source type of the first one */
- g_conns[i].room_source_type = g_conns[0].room_source_type;
+ g_ad.conns[i].room_source_type = g_ad.conns[0].room_source_type;
_webrtc_create(i);
_webrtc_set_all_basic_cbs(i);
_webrtc_set_all_negotiation_state_change_cbs(i);
_webrtc_create_data_channel(i);
- switch (g_conns[i].room_source_type) {
+ switch (g_ad.conns[i].room_source_type) {
case 1:
_webrtc_add_media_source(i, WEBRTC_MEDIA_SOURCE_TYPE_AUDIOTEST, NULL);
_webrtc_add_media_source(i, WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST, &source_id);
}
for (i = 0; i < MAX_CONNECTION_LEN; i++) {
- if (g_conns[i].remote_peer_id <= 0)
+ if (g_ad.conns[i].remote_peer_id <= 0)
continue;
- if (g_conns[i].remote_peer_id == atoi((const char *)peer_id)) {
+ if (g_ad.conns[i].remote_peer_id == atoi((const char *)peer_id)) {
if (index)
*index = i;
- return &g_conns[i];
+ return &g_ad.conns[i];
}
}
if (g_str_has_prefix(text, "ROOM_OK")) {
g_print("\n[from SERVER > %s]\n", text);
- g_signaling_server.server_status = SERVER_STATUS_ROOM_ESTABLISHED;
+ g_ad.signaling_server.server_status = SERVER_STATUS_ROOM_ESTABLISHED;
/* parse text, get the previous peers in the room and negotiate to each other */
if (strlen(text) > strlen("ROOM_OK")) {
} else {
g_print("\n[from SERVER > %s]\n", text);
- g_signaling_server.server_status = SERVER_STATUS_ERROR_FOUND;
+ g_ad.signaling_server.server_status = SERVER_STATUS_ERROR_FOUND;
}
}
RET_IF(!conn, "conn is NULL");
RET_IF(!ws_conn, "ws_conn is NULL");
- RET_IF(g_signaling_server.ws_conn != ws_conn, "not matched ws_conn[%p, %p]", g_signaling_server.ws_conn, ws_conn);
+ RET_IF(g_ad.signaling_server.ws_conn != ws_conn, "not matched ws_conn[%p, %p]", g_ad.signaling_server.ws_conn, ws_conn);
RET_IF(type != SOUP_WEBSOCKET_DATA_TEXT, "invalid data type(%d)", type);
data = g_bytes_get_data(message, &size);
/* NOTE: Logics below can be different in each server */
if (g_strcmp0(text, "HELLO") == 0) {
- g_print("\n[from SERVER > %s] registered done, local_peer_id[%d]\n", text, g_signaling_server.local_peer_id);
+ g_print("\n[from SERVER > %s] registered done, local_peer_id[%d]\n", text, g_ad.signaling_server.local_peer_id);
} else if (g_strcmp0(text, "SESSION_OK") == 0) {
g_print("\n[from SERVER > %s]\n", text);
- g_signaling_server.server_status = SERVER_STATUS_SESSION_ESTABLISHED;
+ g_ad.signaling_server.server_status = SERVER_STATUS_SESSION_ESTABLISHED;
} else if (g_str_has_prefix(text, "ROOM_")) {
__handle_room_related_message(text);
} else if (g_str_has_prefix(text, "ERROR")) {
g_print("\n[from SERVER > %s]\n", text);
- g_signaling_server.server_status = SERVER_STATUS_ERROR_FOUND;
+ g_ad.signaling_server.server_status = SERVER_STATUS_ERROR_FOUND;
} else {
__handle_json_structured_message(conn, text);
g_error_free(error);
return;
}
- g_print("\n[%s] is connected, conn[%p]\n", g_signaling_server.url, conn);
+ g_print("\n[%s] is connected, conn[%p]\n", g_ad.signaling_server.url, conn);
- g_signaling_server.ws_conn = ws_conn;
- g_signaling_server.server_status = SERVER_STATUS_CONNECTED;
+ g_ad.signaling_server.ws_conn = ws_conn;
+ g_ad.signaling_server.server_status = SERVER_STATUS_CONNECTED;
- g_signal_connect(ws_conn, "closed", G_CALLBACK(__websocket_closed_cb), &g_signaling_server);
+ g_signal_connect(ws_conn, "closed", G_CALLBACK(__websocket_closed_cb), &g_ad.signaling_server);
g_signal_connect(ws_conn, "message", G_CALLBACK(__websocket_message_cb), conn);
- g_signaling_server.local_peer_id = __send_greeting_to_register(ws_conn);
+ g_ad.signaling_server.local_peer_id = __send_greeting_to_register(ws_conn);
}
static void _connect_signaling_server(void)
SoupURI *proxy_uri;
const char *https_aliases[] = {"wss", NULL};
- RET_IF(g_signaling_server.signaling_client, "already set by 'scc'");
+ RET_IF(g_ad.signaling_server.signaling_client, "already set by 'scc'");
- if (strlen(g_proxy) == 0) {
+ if (strlen(g_ad.proxy) == 0) {
session = soup_session_new_with_options(SOUP_SESSION_SSL_STRICT, TRUE,
SOUP_SESSION_HTTPS_ALIASES, https_aliases, NULL);
} else {
- g_print("use proxy [%s]\n", g_proxy);
- proxy_uri = soup_uri_new(g_proxy);
+ g_print("use proxy [%s]\n", g_ad.proxy);
+ proxy_uri = soup_uri_new(g_ad.proxy);
session = soup_session_new_with_options(SOUP_SESSION_SSL_STRICT, TRUE,
SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE,
SOUP_SESSION_PROXY_URI, proxy_uri,
soup_uri_free(proxy_uri);
}
- message = soup_message_new(SOUP_METHOD_GET, g_signaling_server.url);
+ message = soup_message_new(SOUP_METHOD_GET, g_ad.signaling_server.url);
- g_print("connecting to signaling server[%s]...\n", g_signaling_server.url);
+ g_print("connecting to signaling server[%s]...\n", g_ad.signaling_server.url);
soup_session_websocket_connect_async(session, message, NULL, NULL, NULL,
- (GAsyncReadyCallback) __websocket_connected_cb, &g_conns[0]);
+ (GAsyncReadyCallback) __websocket_connected_cb, &g_ad.conns[0]);
}
static void _webrtc_signaling_server_create(int port)
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_signaling_server_create(port, &g_inner_signaling_server);
+ ret = webrtc_signaling_server_create(port, &(g_ad.inner_signaling_server));
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
- g_print("webrtc_signaling_server_create() success, port[%d] g_inner_signaling_server[%p]\n", port, g_inner_signaling_server);
+ g_print("webrtc_signaling_server_create() success, port[%d] g_inner_signaling_server[%p]\n", port, g_ad.inner_signaling_server);
}
static void _webrtc_signaling_server_destroy(void)
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_signaling_server_destroy(g_inner_signaling_server);
+ ret = webrtc_signaling_server_destroy(g_ad.inner_signaling_server);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_signaling_server_destroy() success\n");
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_signaling_server_start(g_inner_signaling_server);
+ ret = webrtc_signaling_server_start(g_ad.inner_signaling_server);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_signaling_server_start() success\n");
{
int ret = WEBRTC_ERROR_NONE;
- ret = webrtc_signaling_server_stop(g_inner_signaling_server);
+ ret = webrtc_signaling_server_stop(g_ad.inner_signaling_server);
RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
g_print("webrtc_signaling_server_stop() success\n");
{
int i;
for (i = 0; i < MAX_CONNECTION_LEN; i++) {
- if (g_conns[i].webrtc != NULL) {
+ if (g_ad.conns[i].webrtc != NULL) {
_webrtc_stop(i);
_webrtc_destroy(i);
}
}
g_print("quit program\n");
- g_menu_status = CURRENT_STATUS_TERMINATE;
+ g_ad.menu_status = CURRENT_STATUS_TERMINATE;
elm_exit();
}
menu_info_s *menu_info = g_hash_table_lookup(g_ad.menu_items, cmd);
if (!menu_info)
break;
- g_menu_status = menu_info->status;
+ g_ad.menu_status = menu_info->status;
return menu_info->key_input_needed;
}
default:
{
int value;
- switch (g_menu_status) {
+ switch (g_ad.menu_status) {
case CURRENT_STATUS_CREATE:
_webrtc_create(0);
reset_menu_state();
}
case CURRENT_STATUS_CREATE_OFFER:
case CURRENT_STATUS_CREATE_OFFER_ASYNC: {
- _webrtc_create_offer(&g_conns[0], g_menu_status == CURRENT_STATUS_CREATE_OFFER ? false : true);
+ _webrtc_create_offer(&g_ad.conns[0], g_ad.menu_status == CURRENT_STATUS_CREATE_OFFER ? false : true);
reset_menu_state();
break;
}
case CURRENT_STATUS_CREATE_ANSWER:
case CURRENT_STATUS_CREATE_ANSWER_ASYNC: {
- _webrtc_create_answer(&g_conns[0], g_menu_status == CURRENT_STATUS_CREATE_ANSWER ? false: true);
+ _webrtc_create_answer(&g_ad.conns[0], g_ad.menu_status == CURRENT_STATUS_CREATE_ANSWER ? false: true);
reset_menu_state();
break;
}
case CURRENT_STATUS_SET_LOCAL_DESCRIPTION: {
value = atoi(cmd);
if (value == 1)
- _webrtc_set_local_description(&g_conns[0], true);
+ _webrtc_set_local_description(&g_ad.conns[0], true);
else if (value == 2)
- _webrtc_set_local_description(&g_conns[0], false);
+ _webrtc_set_local_description(&g_ad.conns[0], false);
else
g_print("invalid value[%d]\n", value);
break;
}
case CURRENT_STATUS_SET_REMOTE_DESCRIPTION: {
- _webrtc_set_remote_description(&g_conns[0]);
+ _webrtc_set_remote_description(&g_ad.conns[0]);
reset_menu_state();
break;
}
case CURRENT_STATUS_ADD_ICE_CANDIDATE: {
- _webrtc_add_ice_candidate(&g_conns[0], NULL);
+ _webrtc_add_ice_candidate(&g_ad.conns[0], NULL);
reset_menu_state();
break;
}
}
case CURRENT_STATUS_SET_RTP_PACKET_DROP_PROBABILITY: {
static bool sender;
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
value = atoi(cmd);
if (value != 1 && value != 2) {
break;
}
sender = (value == 1);
- g_cnt++;
+ g_ad.input_count++;
break;
case 1: {
float fvalue = strtof(cmd, NULL);
_webrtc_set_rtp_packet_drop_probability(sender, fvalue);
sender = false;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
{
int value;
- switch (g_menu_status) {
+ switch (g_ad.menu_status) {
case CURRENT_STATUS_ADD_MEDIA_SOURCE: {
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
if (value == 3) { /* mic source */
- g_cnt++;
+ g_ad.input_count++;
} else {
_webrtc_add_media_source(0, value - 1, NULL);
reset_menu_state();
break;
case 1:
_webrtc_add_mic_source(0, !(value == 0), NULL);
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
int new_state;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
media_type = value - 1;
- g_cnt++;
+ g_ad.input_count++;
break;
case 2:
new_state = value;
- if (g_menu_status == CURRENT_STATUS_MEDIA_SOURCE_SET_PAUSE)
+ if (g_ad.menu_status == CURRENT_STATUS_MEDIA_SOURCE_SET_PAUSE)
_webrtc_media_source_set_pause(0, id, media_type, new_state);
else
_webrtc_media_source_set_mute(0, id, media_type, new_state);
id = media_type = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static unsigned int id;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
- if (g_menu_status == CURRENT_STATUS_MEDIA_SOURCE_GET_PAUSE)
+ if (g_ad.menu_status == CURRENT_STATUS_MEDIA_SOURCE_GET_PAUSE)
_webrtc_media_source_get_pause(0, id, value - 1);
else
_webrtc_media_source_get_mute(0, id, value - 1);
id = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static int height;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
width = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 2:
height = value;
_webrtc_media_source_set_video_resolution(0, id, width, height);
id = width = height = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static int framerate;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
framerate = value;
_webrtc_media_source_set_video_framerate(0, id, framerate);
id = framerate = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static unsigned int id;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
_set_media_path(0, id, cmd);
id = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
case CURRENT_STATUS_FILE_SOURCE_SET_LOOPING: {
static unsigned int id;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
_webrtc_file_source_set_looping(0, id, value);
id = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static unsigned int id;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
_webrtc_media_packet_source_set_format(0, id, value);
id = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static unsigned int direction;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
media_type = value - 1;
- g_cnt++;
+ g_ad.input_count++;
break;
case 2:
direction = value - 1;
_webrtc_media_source_set_transceiver_direction(0, id, media_type, direction);
id = media_type = direction = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static unsigned int media_type;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
media_type = value - 1;
_webrtc_media_source_get_transceiver_direction(0, id, media_type);
id = media_type = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static int is_vertical;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
x = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 2:
y = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 3:
w = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 4:
h = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 5:
is_vertical = value;
int width, height;
_webrtc_screen_source_set_crop(0, id, x, y, w, h, is_vertical, &width, &height);
x = y = w = h = is_vertical = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
{
int value;
- switch (g_menu_status) {
+ switch (g_ad.menu_status) {
case CURRENT_STATUS_SET_DISPLAY_TYPE: {
value = atoi(cmd);
_webrtc_set_display_type(0, value - 1);
static unsigned int id;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
_webrtc_set_display_mode(0, id, value - 1);
id = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static unsigned int id;
value = atoi(cmd);
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
id = value;
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
_webrtc_set_display_visible(0, id, value);
id = 0;
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
static void test_webrtc_data_channel(char *cmd)
{
- switch (g_menu_status) {
+ switch (g_ad.menu_status) {
case CURRENT_STATUS_DATA_CHANNEL_CREATE: {
_webrtc_create_data_channel(0);
reset_menu_state();
static void test_webrtc_stats(char *cmd)
{
- switch (g_menu_status) {
+ switch (g_ad.menu_status) {
case CURRENT_STATUS_FOREACH_STATS: {
_webrtc_foreach_stats(0, atoi(cmd));
reset_menu_state();
{
int value;
- switch (g_menu_status) {
+ switch (g_ad.menu_status) {
case CURRENT_STATUS_SETTING_SIGNALING_SERVER: {
- _setting_uri(g_signaling_server.url, cmd);
+ _setting_uri(g_ad.signaling_server.url, cmd);
reset_menu_state();
break;
}
case CURRENT_STATUS_SETTING_PROXY: {
- _setting_uri(g_proxy, cmd);
+ _setting_uri(g_ad.proxy, cmd);
reset_menu_state();
break;
}
break;
}
case CURRENT_STATUS_REQUEST_JOIN_ROOM: {
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
value = atoi(cmd);
if (value <= 0 || value > 3) {
reset_menu_state();
break;
}
- g_conns[0].room_source_type = value;
- g_cnt++;
+ g_ad.conns[0].room_source_type = value;
+ g_ad.input_count++;
break;
case 1:
_request_join_room(cmd);
- g_cnt = 0;
+ g_ad.input_count = 0;
reset_menu_state();
break;
}
case CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_CONNECT: {
static char *ip = NULL;
- if (strlen(g_signaling_server.url) > 0) {
- g_printerr("server[%s] is already set by 'ss'\n", g_signaling_server.url);
+ if (strlen(g_ad.signaling_server.url) > 0) {
+ g_printerr("server[%s] is already set by 'ss'\n", g_ad.signaling_server.url);
reset_menu_state();
break;
}
- switch (g_cnt) {
+ switch (g_ad.input_count) {
case 0:
ip = strdup(cmd);
- g_cnt++;
+ g_ad.input_count++;
break;
case 1:
value = atoi(cmd);
_webrtc_signaling_connect(ip, value);
- g_cnt = 0;
+ g_ad.input_count = 0;
if (ip) {
free(ip);
ip = NULL;
if (!cmd)
return;
- if (g_menu_status == CURRENT_STATUS_MAINMENU) {
+ if (g_ad.menu_status == CURRENT_STATUS_MAINMENU) {
if (interpret_main_menu_cmd(cmd))
goto out;
}
- if (g_menu_status & TEST_MENU_WEBRTC_COMMON)
+ if (g_ad.menu_status & TEST_MENU_WEBRTC_COMMON)
test_webrtc_common(cmd);
- else if (g_menu_status & TEST_MENU_WEBRTC_MEDIA_SOURCE)
+ else if (g_ad.menu_status & TEST_MENU_WEBRTC_MEDIA_SOURCE)
test_webrtc_media_source(cmd);
- else if (g_menu_status & TEST_MENU_WEBRTC_MEDIA_RENDER)
+ else if (g_ad.menu_status & TEST_MENU_WEBRTC_MEDIA_RENDER)
test_webrtc_media_render(cmd);
- else if (g_menu_status & TEST_MENU_WEBRTC_DATA_CHANNEL)
+ else if (g_ad.menu_status & TEST_MENU_WEBRTC_DATA_CHANNEL)
test_webrtc_data_channel(cmd);
- else if (g_menu_status & TEST_MENU_WEBRTC_STATS)
+ else if (g_ad.menu_status & TEST_MENU_WEBRTC_STATS)
test_webrtc_stats(cmd);
- else if (g_menu_status & TEST_MENU_APP_SIGNALING)
+ else if (g_ad.menu_status & TEST_MENU_APP_SIGNALING)
app_setting_and_signaling(cmd);
- else if (g_menu_status == CURRENT_STATUS_QUIT)
+ else if (g_ad.menu_status == CURRENT_STATUS_QUIT)
quit_program();
out:
- if (g_menu_status != CURRENT_STATUS_TERMINATE)
+ if (g_ad.menu_status != CURRENT_STATUS_TERMINATE)
g_timeout_add(100, timeout_menu_display_cb, 0);
}