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));
- }
}
}
}
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) {
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;
{
/*MiracastServer *server = (MiracastServer *)userdata; */
- if (is_error) {
+ if (is_error)
scmirroring_error("Error occured");
- }
}
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;
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");
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
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;
}
_scmirroring->connect_mode = connect_mode;
- if (_scmirroring->connected) {
+ if (_scmirroring->connected)
ret = __scmirroring_src_send_set_cm(_scmirroring);
- }
scmirroring_debug_fleave();
return SCMIRRORING_ERROR_OUT_OF_MEMORY;
}
- if (_scmirroring->connected) {
+ if (_scmirroring->connected)
ret = __scmirroring_src_send_set_ip(_scmirroring);
- }
scmirroring_debug_fleave();
_scmirroring->resolution = resolution;
- if (_scmirroring->connected) {
+ if (_scmirroring->connected)
ret = __scmirroring_src_send_set_reso(_scmirroring);
- }
scmirroring_debug_fleave();
_scmirroring->multisink = multisink;
- if (_scmirroring->connected) {
+ if (_scmirroring->connected)
ret = __scmirroring_src_send_set_multisink(_scmirroring);
- }
scmirroring_debug_fleave();
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();
}
/* free dict as we got our own structure */
- if(dict)
+ if (dict)
iniparser_freedict(dict);
loaded = TRUE;
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);
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);
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");
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");
} 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) {
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;
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");
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;
} 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");
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);
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");
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);
{
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:
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");
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);
} 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) {
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) {