#define MAX_SERVER_TIME_OUT 35000 /* ms */
#define MAX_URL_LEN 2048 /**< Maximum length of the maximum URL */
+/**
+ * @brief Enumeration for private display type
+ */
+typedef enum {
+ PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */
+ PLAYER_PRIVATE_DISPLAY_TYPE_EVAS, /**< Evas image object surface display */
+ PLAYER_PRIVATE_DISPLAY_TYPE_NONE, /**< This disposes off buffers */
+} player_private_display_type_e;
+
typedef struct _ret_msg_s {
gint api;
gchar *msg;
int client_get_api_timeout(player_cli_s * pc, muse_player_api_e api);
int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s * cb_info, char **ret_buf, int time_out);
+int _player_convert_display_type (player_display_type_e type, player_private_display_type_e *out_type);
#ifdef __cplusplus
}
}
}
- packet = fin_data->remote_pkt;
- snd_msg = muse_core_msg_json_factory_new(api, MUSE_TYPE_POINTER, "packet", packet, 0);
- snd_len = muse_core_ipc_send_msg(fin_data->fd, snd_msg);
- muse_core_msg_json_factory_free(snd_msg);
-
- if (snd_len <= 0)
- LOGE("fail to send msg.");
+ if (muse_core_ipc_fd_is_valid(fin_data->fd)) {
+ packet = fin_data->remote_pkt;
+ snd_msg = muse_core_msg_json_factory_new(api, MUSE_TYPE_POINTER, "packet", packet, 0);
+ snd_len = muse_core_ipc_send_msg(fin_data->fd, snd_msg);
+ muse_core_msg_json_factory_free(snd_msg);
+ if (snd_len <= 0)
+ LOGE("fail to send msg.");
+ }
EXIT:
if (fin_data) {
g_free(fin_data);
return ret;
}
+/* The player_display_type_e is different at wearable profile */
+int _player_convert_display_type (player_display_type_e type, player_private_display_type_e *out_type)
+{
+ int ret = PLAYER_ERROR_NONE;
+
+ switch (type) {
+ case PLAYER_DISPLAY_TYPE_OVERLAY:
+ *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY;
+ break;
+ case PLAYER_DISPLAY_TYPE_EVAS:
+ *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS;
+ break;
+ case PLAYER_DISPLAY_TYPE_NONE:
+ *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_NONE;
+ break;
+ default:
+ ret = PLAYER_ERROR_INVALID_PARAMETER;
+ break;
+ }
+
+ LOGD("display type(%d) => (%d)", type, out_type);
+ return ret;
+}
+
int player_set_display(player_h player, player_display_type_e type, player_display_h display)
{
PLAYER_INSTANCE_CHECK(player);
struct wl_display *wl_display;
Ecore_Wl_Window *wl_window = NULL;
Evas *e;
+ player_private_display_type_e conv_type;
+
/* init */
wl_win.wl_window_x = 0;
wl_win.wl_window_y = 0;
LOGD("ENTER type: %d", type);
- if (type != PLAYER_DISPLAY_TYPE_NONE) {
+ ret = _player_convert_display_type(type, &conv_type);
+ if (ret != PLAYER_ERROR_NONE) {
+ return ret;
+ }
+
+ if (conv_type != PLAYER_PRIVATE_DISPLAY_TYPE_NONE) {
obj = (Evas_Object *) display;
if (!obj)
return PLAYER_ERROR_INVALID_PARAMETER;
object_type = evas_object_type_get(obj);
if (object_type) {
- if (type == PLAYER_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
+ if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
/* wayland overlay surface */
LOGI("Wayland overlay surface type");
- wl_win.type = type;
+ wl_win.type = conv_type;
e = evas_object_evas_get(obj);
return_val_if_fail(e != NULL, PLAYER_ERROR_INVALID_OPERATION);
}
#ifdef TIZEN_FEATURE_EVAS_RENDERER
- else if (type == PLAYER_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
+ else if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
/* evas object surface */
LOGI("evas surface type");
- wl_win.type = type;
+ wl_win.type = conv_type;
evas_object_geometry_get(obj, &wl_win.wl_window_x, &wl_win.wl_window_y,
&wl_win.wl_window_width, &wl_win.wl_window_height);
return PLAYER_ERROR_INVALID_PARAMETER;
} else { /* PLAYER_DISPLAY_TYPE_NONE */
LOGI("Wayland surface type is NONE");
- wl_win.type = type;
+ wl_win.type = conv_type;
}
player_msg_send_array(api, pc, ret_buf, ret, wl_win_msg, sizeof(wl_win_msg_type), sizeof(char));
g_free(ret_buf);
struct wl_surface *wl_surface;
struct wl_display *wl_display;
Ecore_Wl_Window *wl_window = NULL;
+ player_private_display_type_e conv_type;
LOGD("ENTER");
- if (type != PLAYER_DISPLAY_TYPE_OVERLAY) {
- LOGE("Display type(%d) is not overlay", type);
+ ret = _player_convert_display_type(type, &conv_type);
+ if (ret != PLAYER_ERROR_NONE) {
+ return ret;
+ }
+
+ if (conv_type != PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY) {
+ LOGE("Display type(%d) is not overlay", conv_type);
return PLAYER_ERROR_INVALID_PARAMETER;
}
if (!ecore_wl_window)
wl_window = ecore_wl_window;
/* set wl_win */
- wl_win.type = type;
+ wl_win.type = conv_type;
wl_win.wl_window_x = x;
wl_win.wl_window_y = y;
wl_win.wl_window_width = width;