g_print("=====================================================================\n");
g_print(" SCMIRRORING Testsuite(press q to quit) \n");
g_print("=====================================================================\n");
+ g_print("m : Make mirroring source handle(create handle)\n");
g_print("a : set ip & port(ex. a 192.168.49.1 2022)\n");
g_print("c : set resolution(ex. c 0 (0 : 1920x1080_P30, 1 : 1280x720_P30, 2 : 960x540_P30, 3: 640x360_P30)\n");
g_print("f : set connection mode(ex. f 0 (0 : wifi_direct, 1 : Other)\n");
return FALSE;
}
+int _scmirroring_src_create(void)
+{
+ int ret = SCMIRRORING_ERROR_NONE;
+
+ g_print("Create source handle\n");
+ ret = scmirroring_src_create(&g_scmirroring);
+ if (ret != SCMIRRORING_ERROR_NONE) {
+ g_print("Failed to create source handle\n");
+ return ret;
+ }
+
+ g_print("Set state Changed callback function\n");
+ ret = scmirroring_src_set_state_changed_cb(g_scmirroring, scmirroring_state_callback, NULL);
+ if (ret != SCMIRRORING_ERROR_NONE) {
+ g_print("Failed to set state changed callback\n");
+ }
+
+ return ret;
+}
+
static void __interpret(char *cmd)
{
int ret = SCMIRRORING_ERROR_NONE;
gchar **value;
value = g_strsplit(cmd, " ", 0);
- if (strncmp(cmd, "a", 1) == 0) {
+ if (strncmp(cmd, "m", 1) == 0) {
+ ret = _scmirroring_src_create();
+ } else if (strncmp(cmd, "a", 1) == 0) {
ret = scmirroring_src_set_ip_and_port(g_scmirroring, value[1], value[2]);
g_print("Input server IP and port number IP[%s] Port[%s]\n", value[1], value[2]);
} else if (strncmp(cmd, "c", 1) == 0) {
g_io_channel_set_flags(stdin_channel, G_IO_FLAG_NONBLOCK, NULL);
g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc)__input, NULL);
- ret = scmirroring_src_create(&g_scmirroring);
- if (ret != SCMIRRORING_ERROR_NONE) {
- g_print("scmirroring_src_create fail [%d]", ret);
- return 0;
- }
-
- ret = scmirroring_src_set_state_changed_cb(g_scmirroring, scmirroring_state_callback, NULL);
- if (ret != SCMIRRORING_ERROR_NONE) {
- g_print("scmirroring_src_create fail [%d]", ret);
- return 0;
- }
-
__displaymenu();
g_loop = g_main_loop_new(NULL, FALSE);