Apply the tizen coding rule 47/84047/1
authorSeokHoon Lee <andy.shlee@samsung.com>
Tue, 16 Aug 2016 09:26:16 +0000 (18:26 +0900)
committerSeokHoon Lee <andy.shlee@samsung.com>
Tue, 16 Aug 2016 09:26:44 +0000 (18:26 +0900)
Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: I4a1007968b8afc37f4b4426823f480bafa7640fc

miracast_server/miracast_server_impl.c [changed mode: 0755->0644]
packaging/capi-media-screen-mirroring.spec [changed mode: 0755->0644]
src/scmirroring_src.c [changed mode: 0755->0644]
src/scmirroring_src_ini.c
test/scmirroring_test.c [changed mode: 0755->0644]
test/scmirroring_wifi_direct_test.c [changed mode: 0755->0644]
test_sink/scmirroring_sink_test.c

old mode 100755 (executable)
new mode 100644 (file)
index 396e728..bbc2669
@@ -99,11 +99,10 @@ handle_method_call(GDBusConnection       *connection,
        if (method_name != NULL) {
                scmirroring_debug("method_name is %s\n", method_name);
 
-               if (g_strcmp0(method_name, "launch_method") == 0) {
+               if (g_strcmp0(method_name, "launch_method") == 0)
                        g_dbus_method_invocation_return_value(invocation, NULL);
-               } else if (g_strcmp0(method_name, "get_miracast_wfd_source_status") == 0) {
+               else if (g_strcmp0(method_name, "get_miracast_wfd_source_status") == 0)
                        g_dbus_method_invocation_return_value(invocation, g_variant_new("(i)", g_server_status));
-               }
        }
 }
 
@@ -229,9 +228,8 @@ void __miracast_server_quit_program(MiracastServer *server)
        }
 
        ret = __miracast_server_emit_status_signal(MIRACAST_WFD_SOURCE_OFF);
-       if (ret != SCMIRRORING_ERROR_NONE) {
+       if (ret != SCMIRRORING_ERROR_NONE)
                scmirroring_error("Failed to emit miracast server off signal");
-       }
 
        pool = (void *)gst_rtsp_server_get_session_pool(server->server);
        if (pool) {
@@ -260,9 +258,8 @@ static void __miracast_server_signal_handler(int signo)
        case SIGQUIT:
        case SIGTERM:
                ret = __miracast_server_emit_status_signal(MIRACAST_WFD_SOURCE_OFF);
-               if (ret != SCMIRRORING_ERROR_NONE) {
+               if (ret != SCMIRRORING_ERROR_NONE)
                        scmirroring_error("Failed to emit miracast server off signal");
-               }
                break;
        default:
                break;
@@ -411,9 +408,8 @@ void __miracast_server_msg_cb(gboolean is_error, void *userdata)
 {
        /*MiracastServer *server = (MiracastServer *)userdata; */
 
-       if (is_error) {
+       if (is_error)
                scmirroring_error("Error occured");
-       }
 }
 
 gint miracast_server_gst_init()
@@ -464,32 +460,31 @@ gint miracast_server_gst_init()
                }
        }
 
-       for (i = 0; i < *argc; i++) {
+       for (i = 0; i < *argc; i++)
                scmirroring_debug("argv[%d] : %s\n", i, argv[i]);
-       }
 
        /* initializing gstreamer */
        if (!gst_init_check(argc, &argv, &err)) {
                scmirroring_error("Could not initialize GStreamer: %s\n", err ? err->message : "unknown error occurred");
-               if (err) {
+               if (err)
                        g_error_free(err);
-               }
+
                goto ERROR;
        }
 
        /* release */
-       for (i = 0; i < *argc; i++) {
+       for (i = 0; i < *argc; i++)
                SCMIRRORING_SAFE_FREE(argv[i]);
-       }
+
        SCMIRRORING_SAFE_FREE(argv);
        SCMIRRORING_SAFE_FREE(argc);
 
        return SCMIRRORING_ERROR_NONE;
 
 ERROR:
-       for (i = 0; i < *argc; i++) {
+       for (i = 0; i < *argc; i++)
                SCMIRRORING_SAFE_FREE(argv[i]);
-       }
+
        SCMIRRORING_SAFE_FREE(argv);
        SCMIRRORING_SAFE_FREE(argc);
        return SCMIRRORING_ERROR_INVALID_OPERATION;
@@ -747,9 +742,8 @@ void __miracast_server_interpret(MiracastServer *server, gchar *buf)
                        klass->send_response(server, "OK:LISTENING");
 
                        ret = __miracast_server_emit_status_signal(MIRACAST_WFD_SOURCE_ON);
-                       if (ret != SCMIRRORING_ERROR_NONE) {
+                       if (ret != SCMIRRORING_ERROR_NONE)
                                scmirroring_error("Failed to emit miracast server on signal");
-                       }
 
                } else {
                        klass->send_response(server, "FAIL:LISTENING");
old mode 100755 (executable)
new mode 100644 (file)
index 9eaf5f3..c3a5b9f
@@ -1,6 +1,6 @@
 Name:       capi-media-screen-mirroring
 Summary:    A screen mirroring library in Tizen C API
-Version:    0.1.49
+Version:    0.1.50
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
old mode 100755 (executable)
new mode 100644 (file)
index bcbf098..3aff34f
@@ -168,34 +168,32 @@ static int __miracast_server_launch(scmirroring_src_s *scmirroring)
 
 static int __scmirroring_src_get_error(gchar *str)
 {
-       if (g_strrstr(str, "OK")) {
+       if (g_strrstr(str, "OK"))
                return SCMIRRORING_ERROR_NONE;
-       } else if (g_strrstr(str, "FAIL")) {
+       else if (g_strrstr(str, "FAIL"))
                return SCMIRRORING_ERROR_INVALID_OPERATION;
-       }
 
        return SCMIRRORING_ERROR_NONE;
 }
 
 static int __scmirroring_src_get_status(gchar *str)
 {
-       if (g_strrstr(str, "LISTENING")) {
+       if (g_strrstr(str, "LISTENING"))
                return SCMIRRORING_STATE_CONNECTION_WAIT;
-       } else if (g_strrstr(str, "CONNECTED")) {
+       else if (g_strrstr(str, "CONNECTED"))
                return SCMIRRORING_STATE_CONNECTED;
-       } else if (g_strrstr(str, "PLAYING")) {
+       else if (g_strrstr(str, "PLAYING"))
                return SCMIRRORING_STATE_PLAYING;
-       } else if (g_strrstr(str, "SET")) {
+       else if (g_strrstr(str, "SET"))
                return SCMIRRORING_STATE_READY;
-       } else if (g_strrstr(str, SCMIRRORING_STATE_CMD_PAUSE)) {
+       else if (g_strrstr(str, SCMIRRORING_STATE_CMD_PAUSE))
                return SCMIRRORING_STATE_PAUSED;
-       } else if (g_strrstr(str, SCMIRRORING_STATE_CMD_RESUME)) {
+       else if (g_strrstr(str, SCMIRRORING_STATE_CMD_RESUME))
                return SCMIRRORING_STATE_PLAYING;
-       } else if (g_strrstr(str, SCMIRRORING_STATE_CMD_STOP)) {
+       else if (g_strrstr(str, SCMIRRORING_STATE_CMD_STOP))
                return SCMIRRORING_STATE_TEARDOWN;
-       } else if (g_strrstr(str, SCMIRRORING_STATE_CMD_DESTROY)) {
+       else if (g_strrstr(str, SCMIRRORING_STATE_CMD_DESTROY))
                return SCMIRRORING_STATE_NULL;
-       }
 
        return SCMIRRORING_STATE_NONE;
 }
@@ -420,9 +418,8 @@ int scmirroring_src_set_connection_mode(scmirroring_src_h scmirroring, scmirrori
 
        _scmirroring->connect_mode = connect_mode;
 
-       if (_scmirroring->connected) {
+       if (_scmirroring->connected)
                ret = __scmirroring_src_send_set_cm(_scmirroring);
-       }
 
        scmirroring_debug_fleave();
 
@@ -503,9 +500,8 @@ int scmirroring_src_set_ip_and_port(scmirroring_src_h scmirroring, const char *i
                return SCMIRRORING_ERROR_OUT_OF_MEMORY;
        }
 
-       if (_scmirroring->connected) {
+       if (_scmirroring->connected)
                ret = __scmirroring_src_send_set_ip(_scmirroring);
-       }
 
        scmirroring_debug_fleave();
 
@@ -531,9 +527,8 @@ int scmirroring_src_set_resolution(scmirroring_src_h scmirroring, scmirroring_re
 
        _scmirroring->resolution = resolution;
 
-       if (_scmirroring->connected) {
+       if (_scmirroring->connected)
                ret = __scmirroring_src_send_set_reso(_scmirroring);
-       }
 
        scmirroring_debug_fleave();
 
@@ -574,9 +569,8 @@ int scmirroring_src_set_multisink_ability(scmirroring_src_h scmirroring, scmirro
 
        _scmirroring->multisink = multisink;
 
-       if (_scmirroring->connected) {
+       if (_scmirroring->connected)
                ret = __scmirroring_src_send_set_multisink(_scmirroring);
-       }
 
        scmirroring_debug_fleave();
 
@@ -687,9 +681,8 @@ try:
                ret = __scmirroring_src_send_set_reso(_scmirroring);
        }
 
-       if (_scmirroring->multisink == SCMIRRORING_MULTISINK_ENABLE) {
+       if (_scmirroring->multisink == SCMIRRORING_MULTISINK_ENABLE)
                ret = __scmirroring_src_send_set_multisink(_scmirroring);
-       }
 
        scmirroring_debug_fleave();
 
index a54e81c8d356ff0ca22737a186ea90e0f3238bad..86a227dac0261975aa5c29759c0774de768aa94c 100644 (file)
@@ -197,7 +197,7 @@ scmirroring_src_ini_load(void)
        }
 
        /* free dict as we got our own structure */
-       if(dict)
+       if (dict)
                iniparser_freedict(dict);
 
        loaded = TRUE;
old mode 100755 (executable)
new mode 100644 (file)
index 3638a28..770d331
@@ -107,9 +107,8 @@ static void __interpret(char *cmd)
                g_print("unknown menu \n");
        }
 
-       if (ret != SCMIRRORING_ERROR_NONE) {
+       if (ret != SCMIRRORING_ERROR_NONE)
                g_print("Error Occured [%d]\n", ret);
-       }
 
        g_timeout_add(100, __timeout_menu_display, 0);
 
old mode 100755 (executable)
new mode 100644 (file)
index 4f54311..dbc6fbb
@@ -152,9 +152,8 @@ static void __interpret(char *cmd)
                g_print("unknown menu \n");
        }
 
-       if (ret != SCMIRRORING_ERROR_NONE) {
+       if (ret != SCMIRRORING_ERROR_NONE)
                g_print("Error Occured [%d]\n", ret);
-       }
 
        g_timeout_add(100, __timeout_menu_display, 0);
 
@@ -182,11 +181,10 @@ static gboolean __disconnect_p2p_connection(void)
        int ret = WIFI_DIRECT_ERROR_NONE;
 
        ret = wifi_direct_disconnect_all();
-       if (!ret) {
+       if (!ret)
                g_print("wifi_direct_disconnect_all success\n");
-       } else {
+       else
                g_print("wifi_direct_disconnect_all fail\n");
-       }
 
        g_print("------p2p connection disconnected------\n");
 
@@ -268,9 +266,8 @@ void _discover_cb(int error_code, wifi_direct_discovery_state_e discovery_state,
        case WIFI_DIRECT_DISCOVERY_FOUND:
                g_print("discovery_state : WIFI_DIRECT_DISCOVERY_FOUND \n");
                ret = wifi_direct_foreach_discovered_peers(_discovered_peer_cb, (void *)NULL);
-               if (ret != WIFI_DIRECT_ERROR_NONE) {
+               if (ret != WIFI_DIRECT_ERROR_NONE)
                        g_print("Error : wifi_direct_foreach_discovered_peers failed : %d\n", ret);
-               }
                break;
        case WIFI_DIRECT_DISCOVERY_FINISHED:
                g_print("discovery_state : WIFI_DIRECT_DISCOVERY_FINISHED \n");
@@ -453,11 +450,10 @@ static gboolean __start_p2p_connection(gpointer data)
        } else {
                g_print("wifi direct status >= WIFI_DIRECT_STATE_ACTIVATED.. Disconnect all first\n");
                ret = wifi_direct_disconnect_all();
-               if (!ret) {
+               if (!ret)
                        g_print("wifi_direct_disconnect_all success\n");
-               } else {
+               else
                        g_print("wifi_direct_disconnect_all fail\n");
-               }
 
                ret = __start_wifi_display_connection();
                if (ret == TRUE) {
index 7191f93febf1a89fd4d9901b2aa164964f8ee560..eaeea8cdcbb9e26c74531558f1f9639a116a3d1b 100644 (file)
@@ -154,9 +154,9 @@ static Evas_Object* _create_win(const char *name)
 
 static Evas_Object *create_evas_image_object(Evas_Object *eo_parent)
 {
-       if (!eo_parent) {
+       if (!eo_parent)
                return NULL;
-       }
+
        Evas *evas = evas_object_evas_get(eo_parent);
        Evas_Object *eo = NULL;
 
@@ -184,9 +184,8 @@ static int app_create(void *data)
        evas_object_show(win);
 
        result = _scmirroring_start_jobs((void *)NULL);
-       if (result != TRUE) {
+       if (result != TRUE)
                g_print("failed _scmirroring_start_jobs ");
-       }
 
        g_print("app_create leave");
 
@@ -358,21 +357,19 @@ static void __interpret_stream_info_submenu(char *cmd)
 
                int width, height;
                ret = scmirroring_sink_get_negotiated_video_resolution(g_scmirroring, &width, &height);
-               if (ret != SCMIRRORING_ERROR_NONE) {
+               if (ret != SCMIRRORING_ERROR_NONE)
                        g_print("Error : scmirroring_sink_get_negotiated_video_resolution fail[%d]\n", ret);
-               } else {
+               else
                        g_print("video resoltuion : width[%d], height[%d]\n", width, height);
-               }
 
        } else if (strncmp(cmd, "3", 1) == 0) {
 
                int frame_rate;
                ret = scmirroring_sink_get_negotiated_video_frame_rate(g_scmirroring, &frame_rate);
-               if (ret != SCMIRRORING_ERROR_NONE) {
+               if (ret != SCMIRRORING_ERROR_NONE)
                        g_print("Error : scmirroring_sink_get_negotiated_video_frame_rate fail[%d]\n", ret);
-               } else {
+               else
                        g_print("video frame rate[%d]\n", frame_rate);
-               }
 
        } else if (strncmp(cmd, "4", 1) == 0) {
                scmirroring_audio_codec_e codec;
@@ -399,29 +396,26 @@ static void __interpret_stream_info_submenu(char *cmd)
        } else if (strncmp(cmd, "5", 1) == 0) {
                int channel;
                ret = scmirroring_sink_get_negotiated_audio_channel(g_scmirroring, &channel);
-               if (ret != SCMIRRORING_ERROR_NONE) {
+               if (ret != SCMIRRORING_ERROR_NONE)
                        g_print("Error : scmirroring_sink_get_negotiated_audio_channel fail[%d]\n", ret);
-               } else {
+               else
                        g_print("audio channel[%d]\n", channel);
-               }
 
        } else if (strncmp(cmd, "6", 1) == 0) {
                int sample_rate;
                ret = scmirroring_sink_get_negotiated_audio_sample_rate(g_scmirroring, &sample_rate);
-               if (ret != SCMIRRORING_ERROR_NONE) {
+               if (ret != SCMIRRORING_ERROR_NONE)
                        g_print("Error : scmirroring_sink_get_negotiated_audio_sample_rate fail[%d]\n", ret);
-               } else {
+               else
                        g_print("audio sample rate[%d]\n", sample_rate);
-               }
 
        } else if (strncmp(cmd, "7", 1) == 0) {
                int bitwidth;
                ret = scmirroring_sink_get_negotiated_audio_bitwidth(g_scmirroring, &bitwidth);
-               if (ret != SCMIRRORING_ERROR_NONE) {
+               if (ret != SCMIRRORING_ERROR_NONE)
                        g_print("Error : scmirroring_sink_get_negotiated_audio_bitwidth fail[%d]\n", ret);
-               } else {
+               else
                        g_print("audio bitwidth[%d]\n", bitwidth);
-               }
 
        } else if (strncmp(cmd, "g", 1) == 0) {
                g_print("go back to main menu\n");
@@ -512,12 +506,10 @@ static void scmirroring_sink_state_callback(scmirroring_error_e error_code, scmi
                g_print(" state[%d] SCMIRRORING_SINK_STATE_PAUSED\n", state);
        else if (state == SCMIRRORING_SINK_STATE_DISCONNECTED) {
                g_print(" state[%d] SCMIRRORING_SINK_STATE_DISCONNECTED\n", state);
-               if (scmirroring_sink_unprepare(g_scmirroring) != SCMIRRORING_ERROR_NONE) {
+               if (scmirroring_sink_unprepare(g_scmirroring) != SCMIRRORING_ERROR_NONE)
                        g_print("scmirroring_sink_unprepare fail\n");
-               }
-               if (scmirroring_sink_destroy(g_scmirroring) != SCMIRRORING_ERROR_NONE) {
+               if (scmirroring_sink_destroy(g_scmirroring) != SCMIRRORING_ERROR_NONE)
                        g_print("scmirroring_sink_destroy fail\n");
-               }
                __quit_program();
        } else
                g_print(" state[%d] Invalid State", state);
@@ -652,9 +644,8 @@ void _discover_cb(int error_code, wifi_direct_discovery_state_e discovery_state,
        case WIFI_DIRECT_DISCOVERY_FOUND:
                g_print("discovery_state : WIFI_DIRECT_DISCOVERY_FOUND \n");
                ret = wifi_direct_foreach_discovered_peers(_discovered_peer_cb, (void *)NULL);
-               if (ret != WIFI_DIRECT_ERROR_NONE) {
+               if (ret != WIFI_DIRECT_ERROR_NONE)
                        g_print("Error : wifi_direct_foreach_discovered_peers failed : %d\n", ret);
-               }
                break;
        case WIFI_DIRECT_DISCOVERY_FINISHED:
                g_print("discovery_state : WIFI_DIRECT_DISCOVERY_FINISHED \n");
@@ -682,13 +673,11 @@ void _ip_assigned_cb(const char *mac_address, const char *ip_address, const char
                g_print("Can not get port info\n Use default(2022)\n");
                peer_port = DEFAULT_SCREEN_MIRRORING_PORT;
        }
-       if (wifi_direct_get_peer_info((char *)mac_address, &peer_info) != WIFI_DIRECT_ERROR_NONE) {
+       if (wifi_direct_get_peer_info((char *)mac_address, &peer_info) != WIFI_DIRECT_ERROR_NONE)
                g_print("Can not get peer info and device name\n");
-       }
 
-       if (peer_info != NULL && peer_info->device_name != NULL) {
+       if (peer_info != NULL && peer_info->device_name != NULL)
                g_print("[_ip_assigned_cb] Connected to device_name [%s]\n", peer_info->device_name);
-       }
 
        g_print("[_ip_assigned_cb] Connected to IP [%s]\n", ip_address);
        g_print("[_ip_assigned_cb] Connected to Port [%d]\n", peer_port);
@@ -715,9 +704,8 @@ void _connection_cb(int error_code, wifi_direct_connection_state_e connection_st
        {
                g_print("WIFI_DIRECT_CONNECTION_REQ : Connection is requested\n");
                ret = wifi_direct_accept_connection((char *)mac_address);
-               if (ret != WIFI_DIRECT_ERROR_NONE) {
-               g_print("Error : wifi_direct_accept_connection failed : %d\n", ret);
-               }
+               if (ret != WIFI_DIRECT_ERROR_NONE)
+                       g_print("Error : wifi_direct_accept_connection failed : %d\n", ret);
                break;
                }
        case WIFI_DIRECT_CONNECTION_WPS_REQ:
@@ -731,9 +719,8 @@ void _connection_cb(int error_code, wifi_direct_connection_state_e connection_st
                bool is_go = FALSE;
                g_print("WIFI_DIRECT_CONNECTION_RSP : Connected\n");
                ret = wifi_direct_is_group_owner(&is_go);
-               if (ret != WIFI_DIRECT_ERROR_NONE) {
+               if (ret != WIFI_DIRECT_ERROR_NONE)
                        g_print("Error : wifi_direct_is_group_owner failed : %d\n", ret);
-               }
 
                if (is_go) {
                        g_print("Connected as Group Owner\n");
@@ -847,9 +834,8 @@ static void __interpret(char *cmd)
                g_print("unknown menu \n");
        }
 
-       if (ret != SCMIRRORING_ERROR_NONE) {
+       if (ret != SCMIRRORING_ERROR_NONE)
                g_print("Error Occured [%d]", ret);
-       }
 
        g_timeout_add(100, __timeout_menu_display, 0);
 
@@ -1028,11 +1014,10 @@ static gboolean __start_p2p_connection(gpointer data)
        } else {
                g_print("wifi direct status >= WIFI_DIRECT_STATE_ACTIVATED.. Disconnect all first\n");
                ret = wifi_direct_disconnect_all();
-               if (!ret) {
+               if (!ret)
                        g_print("wifi_direct_disconnect_all success\n");
-               } else {
+               else
                        g_print("wifi_direct_disconnect_all fail\n");
-               }
 
                ret = __start_wifi_display_connection();
                if (ret == TRUE) {
@@ -1126,9 +1111,8 @@ gboolean __scmirroring_sink_start(gpointer data)
 
        if (g_resolution != 0) {
                ret = scmirroring_sink_set_resolution(g_scmirroring, g_resolution);
-               if (ret != SCMIRRORING_ERROR_NONE) {
+               if (ret != SCMIRRORING_ERROR_NONE)
                        g_print("Failed to set resolution, error[%d]\n", ret);
-               }
        }
 
        if (g_sinktype != -1) {