}
#endif
- if (_wl_window_evas_object_cb_del(player) != MM_ERROR_NONE)
- LOGW("fail to unset evas object callback");
-
if (CALLBACK_INFO(pc)) {
__player_remove_tsurf_list(pc);
_player_event_queue_destroy(CALLBACK_INFO(pc));
struct wl_display *wl_display;
Ecore_Wl_Window *wl_window = NULL;
Evas *e;
+ /* init */
+ wl_win.wl_window_x = 0;
+ wl_win.wl_window_y = 0;
+ wl_win.wl_window_width = 0;
+ wl_win.wl_window_height = 0;
LOGD("ENTER type: %d", type);
e = evas_object_evas_get(obj);
return_val_if_fail(e != NULL, PLAYER_ERROR_INVALID_OPERATION);
- ret = _wl_window_geometry_get(obj, e, &wl_win.wl_window_x, &wl_win.wl_window_y,
- &wl_win.wl_window_width, &wl_win.wl_window_height);
if (ret != MM_ERROR_NONE) {
LOGE("Fail to get window geometry");
return ret;
}
- if (_wl_window_evas_object_cb_add(player, obj) != MM_ERROR_NONE)
- LOGW("fail to set evas object callback");
wl_window = elm_win_wl_window_get(obj);
return_val_if_fail(wl_window != NULL, PLAYER_ERROR_INVALID_OPERATION);
} else { /* PLAYER_DISPLAY_TYPE_NONE */
LOGI("Wayland surface type is NONE");
wl_win.type = type;
- wl_win.wl_window_x = 0;
- wl_win.wl_window_y = 0;
- wl_win.wl_window_width = 0;
- wl_win.wl_window_height = 0;
}
player_msg_send_array(api, pc, ret_buf, ret, wl_win_msg, sizeof(wl_win_msg_type), sizeof(char));
g_free(ret_buf);
wl_registry_destroy(wlclient->registry);
return;
}
-
-static void __evas_resize_cb(void *data, Evas * e, Evas_Object * eo, void *event_info)
-{
- player_cli_s *pc = (player_cli_s *) data;
- wl_win_msg_type wl_win;
- char *wl_win_msg = (char *)&wl_win;
- char *ret_buf = NULL;
- muse_player_api_e api = MUSE_PLAYER_API_RESIZE_VIDEO_RENDER_RECT;
- int ret = PLAYER_ERROR_NONE;
- LOGD("ret =%d", ret);
-
- ret = _wl_window_geometry_get(eo, e, &wl_win.wl_window_x, &wl_win.wl_window_y,
- &wl_win.wl_window_width, &wl_win.wl_window_height);
- if (ret != PLAYER_ERROR_NONE) {
- LOGE("Fail to get window geometry");
- return;
- }
- wl_win.type = 0; /*init but not use */
- wl_win.wl_surface_id = 0; /*init but not use */
-
- player_msg_send_array(api, pc, ret_buf, ret, wl_win_msg, sizeof(wl_win_msg_type), sizeof(char));
-
- g_free(ret_buf);
- return;
-
-}
-
-static void __evas_del_cb(void *data, Evas * e, Evas_Object * eo, void *event_info)
-{
-
- player_cli_s *pc = (player_cli_s *) data;
-
- evas_object_event_callback_del(eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb);
- evas_object_event_callback_del(eo, EVAS_CALLBACK_DEL, __evas_del_cb);
-
- LOGD("evas callback del %p", eo);
- pc->have_evas_callback = FALSE;
-
- return;
-}
-
-int _wl_window_geometry_get(Evas_Object *eo, Evas *e, int *x, int *y, int *width, int *height)
-{
- Ecore_Evas *ecore_evas;
- int rotation;
- return_val_if_fail(eo != NULL || e != NULL || x != NULL || y != NULL || width != NULL || height != NULL,
- PLAYER_ERROR_INVALID_OPERATION);
-
- evas_object_geometry_get(eo, x, y, width, height);
- LOGD("get window geometroy : x(%d) y(%d) width(%d) height(%d)", *x, *y, *width, *height);
- /* get rotaion */
- ecore_evas = ecore_evas_ecore_evas_get(e);
- return_val_if_fail(ecore_evas != NULL, PLAYER_ERROR_INVALID_OPERATION);
- rotation = ecore_evas_rotation_get(ecore_evas);
-
- LOGD("rotation(%d)", rotation);
- /* swap */
- if (rotation == 270 || rotation == 90) {
- LOGD("swap width with height");
- int temp;
- temp = *width;
- *width = *height;
- *height = temp;
- LOGD("get window geometroy : x(%d) y(%d) width(%d) height(%d)", *x, *y, *width, *height);
- }
-
- return MM_ERROR_NONE;
-}
-
-int _wl_window_evas_object_cb_add(player_h player, Evas_Object *eo)
-{
-
- PLAYER_INSTANCE_CHECK(player);
- return_val_if_fail(eo != NULL, MM_ERROR_INVALID_ARGUMENT);
-
- player_cli_s *pc = (player_cli_s *) player;
-
- if (pc->have_evas_callback && pc->eo == eo) {
- LOGW("evas object had callback already %p", pc->eo);
- return MM_ERROR_UNKNOWN;
- }
- pc->eo = eo;
- evas_object_event_callback_add(eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb, player);
- evas_object_event_callback_add(eo, EVAS_CALLBACK_DEL, __evas_del_cb, player);
- LOGD("evas callback add %p", pc->eo);
- pc->have_evas_callback = TRUE;
-
- return MM_ERROR_NONE;
-}
-
-int _wl_window_evas_object_cb_del(player_h player)
-{
- PLAYER_INSTANCE_CHECK(player);
- player_cli_s *pc = (player_cli_s *) player;
- return_val_if_fail(pc->eo != NULL, MM_ERROR_INVALID_ARGUMENT);
-
- evas_object_event_callback_del(pc->eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb);
- evas_object_event_callback_del(pc->eo, EVAS_CALLBACK_DEL, __evas_del_cb);
- LOGD("evas callback del %p", pc->eo);
- pc->eo = NULL;
- pc->have_evas_callback = FALSE;
-
- return MM_ERROR_NONE;
-}
-