proxy setting is moved to the execution option from menu item.
webrtc_test [OPTION]
-p, --proxy proxy URL to use (e.g. http://123.123.123.123:8080)
-h, --help help
[Version] 0.3.137
[Issue Type] Improvement
Change-Id: I438c0d79a5715562901112199318e8ea2c518fd9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.3.136
+Version: 0.3.137
Release: 0
Group: Multimedia/API
License: Apache-2.0
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include <getopt.h>
#ifdef PACKAGE
#undef PACKAGE
reset_menu_state();
break;
}
- case CURRENT_STATUS_SETTING_PROXY: {
- _setting_uri(g_ad.proxy, cmd);
- reset_menu_state();
- break;
- }
case CURRENT_STATUS_CONNECT_SIGNALING_SERVER: {
_connect_signaling_server();
reset_menu_state();
return TRUE;
}
+static void print_usage()
+{
+ printf("Usage : ");
+ printf("webrtc_test [option]\n\n"
+ " -p, --proxy proxy URL to use (e.g. http://123.123.123.123:8080)\n"
+ " -h, --help help\n");
+}
+
int main(int argc, char *argv[])
{
GIOChannel *stdin_channel = g_io_channel_unix_new(0);
g_io_channel_set_flags(stdin_channel, G_IO_FLAG_NONBLOCK, NULL);
g_io_add_watch(stdin_channel, G_IO_IN, input_watch_cb, NULL);
- displaymenu();
memset(&g_ad, 0x0, sizeof(appdata_s));
ops.data = &g_ad;
+ while (1) {
+ int opt;
+ int opt_idx = 0;
+
+ static struct option long_options[] = {
+ { "proxy", required_argument, 0, 'p' },
+ { "help", no_argument, 0, 'h' },
+ { 0, 0, 0, 0 }
+ };
+
+ if ((opt = getopt_long(argc, argv, "p:h", long_options, &opt_idx)) == -1)
+ break;
+
+ switch (opt) {
+ case 'p':
+ strncpy(g_ad.proxy, optarg, sizeof(g_ad.proxy) - 1);
+ break;
+ case 'h':
+ default:
+ print_usage();
+ return 0;
+ }
+ }
+
+ displaymenu();
+
return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
}
/* app. setting & signaling */
{ "ss", CURRENT_STATUS_SETTING_SIGNALING_SERVER, true },
{ "cs", CURRENT_STATUS_CONNECT_SIGNALING_SERVER, false },
- { "px", CURRENT_STATUS_SETTING_PROXY, true },
{ "rs", CURRENT_STATUS_REQUEST_SESSION, true },
{ "rj", CURRENT_STATUS_REQUEST_JOIN_ROOM, true },
{ "sd", CURRENT_STATUS_SEND_LOCAL_DESCRIPTION, true },
g_print("sts. Get stats\n");
g_print("------------------------------- App. Setting & Signaling --------------------------------\n");
display_setting_status();
- g_print("px. Set proxy URL\n");
g_print("ss. Set signaling server URL\n");
g_print("cs. Connect to the signaling server\n");
g_print("rs. Request session of remote peer id\n");
case CURRENT_STATUS_SETTING_SIGNALING_SERVER:
g_print("*** input signaling server URL.\n");
break;
- case CURRENT_STATUS_SETTING_PROXY:
- g_print("*** input proxy URL.\n");
- break;
case CURRENT_STATUS_REQUEST_SESSION:
g_print("*** input remote peer id.\n");
break;
/* app. setting & signaling */
CURRENT_STATUS_SETTING_SIGNALING_SERVER = TEST_MENU_APP_SIGNALING | 0x01,
CURRENT_STATUS_CONNECT_SIGNALING_SERVER = TEST_MENU_APP_SIGNALING | 0x02,
- CURRENT_STATUS_SETTING_PROXY = TEST_MENU_APP_SIGNALING | 0x03,
- CURRENT_STATUS_REQUEST_SESSION = TEST_MENU_APP_SIGNALING | 0x04,
- CURRENT_STATUS_REQUEST_JOIN_ROOM = TEST_MENU_APP_SIGNALING | 0x05,
- CURRENT_STATUS_SEND_LOCAL_DESCRIPTION = TEST_MENU_APP_SIGNALING | 0x06,
- CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_CREATE = TEST_MENU_APP_SIGNALING | 0x07,
- CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_DESTROY = TEST_MENU_APP_SIGNALING | 0x08,
- CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_START = TEST_MENU_APP_SIGNALING | 0x09,
- CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_STOP = TEST_MENU_APP_SIGNALING | 0x0A,
- CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_CONNECT = TEST_MENU_APP_SIGNALING | 0x0B,
- CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_DISCONNECT = TEST_MENU_APP_SIGNALING | 0x0C,
+ CURRENT_STATUS_REQUEST_SESSION = TEST_MENU_APP_SIGNALING | 0x03,
+ CURRENT_STATUS_REQUEST_JOIN_ROOM = TEST_MENU_APP_SIGNALING | 0x04,
+ CURRENT_STATUS_SEND_LOCAL_DESCRIPTION = TEST_MENU_APP_SIGNALING | 0x05,
+ CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_CREATE = TEST_MENU_APP_SIGNALING | 0x06,
+ CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_DESTROY = TEST_MENU_APP_SIGNALING | 0x07,
+ CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_START = TEST_MENU_APP_SIGNALING | 0x08,
+ CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_STOP = TEST_MENU_APP_SIGNALING | 0x09,
+ CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_CONNECT = TEST_MENU_APP_SIGNALING | 0x0A,
+ CURRENT_STATUS_PRIVATE_SIGNALING_SERVER_DISCONNECT = TEST_MENU_APP_SIGNALING | 0x0B,
};
enum {