} else
goto ERROR;
+ pc->cb_info->evas_info = g_new0(player_evas_info_s, 1);
+ if (pc->cb_info->evas_info == NULL) {
+ ret = PLAYER_ERROR_OUT_OF_MEMORY;
+ goto ERROR;
+ }
+ EVAS_INFO(pc)->visible = -1;
+
pc->cb_info->bufmgr = tbm_bufmgr_init(-1);
pc->push_media_stream = FALSE;
}
#endif
+ if (EVAS_INFO(pc))
+ g_free(pc->cb_info->evas_info);
+
if (CALLBACK_INFO(pc)) {
__player_remove_tsurf_list(pc);
_player_remove_idle_event_all(CALLBACK_INFO(pc));
}
}
#endif
+
player_msg_send(api, pc, ret_buf, ret);
g_free(ret_buf);
LOGW("evas client already exists");
if (mm_evas_renderer_destroy(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
LOGW("fail to unset evas client");
+ /* need to set display information again to new handle */
+ EVAS_INFO(pc)->update_needed = TRUE;
}
if (mm_evas_renderer_create(&EVAS_HANDLE(pc), obj) != MM_ERROR_NONE) {
LOGW("fail to set evas client");
return PLAYER_ERROR_INVALID_OPERATION;
}
- if (player_set_media_packet_video_frame_decoded_cb(player, mm_evas_renderer_write, (void *)EVAS_HANDLE(pc)) != PLAYER_ERROR_NONE)
+ /* before evas handle is created, user could set display information */
+ if (EVAS_INFO(pc)->update_needed) {
+ LOGW("set evas information mode %d, rotation %d, visible %d", EVAS_INFO(pc)->mode,
+ EVAS_INFO(pc)->rotation, EVAS_INFO(pc)->visible);
+ ret = mm_evas_renderer_set_geometry(EVAS_HANDLE(pc), EVAS_INFO(pc)->mode);
+ ret |= mm_evas_renderer_set_rotation(EVAS_HANDLE(pc), EVAS_INFO(pc)->rotation);
+ /* if user didn't set visible, it will be set to true in player_start */
+ if (EVAS_INFO(pc)->visible != -1)
+ ret |= mm_evas_renderer_set_visible(EVAS_HANDLE(pc), (EVAS_INFO(pc)->visible == 1) ? true : false);
+ if (ret != MM_ERROR_NONE) {
+ LOGW("fail to set evas information");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
+
+ if (EVAS_INFO(pc)->mode == PLAYER_DISPLAY_MODE_DST_ROI) {
+ LOGW("set roi (%d, %d) %d*%d", EVAS_INFO(pc)->roi_x, EVAS_INFO(pc)->roi_y,
+ EVAS_INFO(pc)->roi_w, EVAS_INFO(pc)->roi_h);
+ ret = mm_evas_renderer_set_roi_area(EVAS_HANDLE(pc), EVAS_INFO(pc)->roi_x, EVAS_INFO(pc)->roi_y,
+ EVAS_INFO(pc)->roi_w, EVAS_INFO(pc)->roi_h);
+ if (ret != MM_ERROR_NONE)
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
+ EVAS_INFO(pc)->update_needed = FALSE;
+ }
+
+ ret = player_set_media_packet_video_frame_decoded_cb(player, mm_evas_renderer_write, (void *)EVAS_HANDLE(pc));
+ if (ret != PLAYER_ERROR_NONE)
LOGW("fail to set decoded callback");
}
#endif
return PLAYER_ERROR_INVALID_OPERATION;
else
return PLAYER_ERROR_NONE;
+ } else {
+ EVAS_INFO(pc)->mode = mode;
+ EVAS_INFO(pc)->update_needed = TRUE;
}
#endif
player_msg_send1(api, pc, ret_buf, ret, INT, mode);
return PLAYER_ERROR_INVALID_OPERATION;
else
return PLAYER_ERROR_NONE;
+ } else {
+ EVAS_INFO(pc)->roi_x = x;
+ EVAS_INFO(pc)->roi_y = y;
+ EVAS_INFO(pc)->roi_w = width;
+ EVAS_INFO(pc)->roi_h = height;
+ EVAS_INFO(pc)->update_needed = TRUE;
}
#endif
wl_win.wl_window_x = x;
return PLAYER_ERROR_INVALID_OPERATION;
else
return PLAYER_ERROR_NONE;
+ } else {
+ EVAS_INFO(pc)->rotation = rotation;
+ EVAS_INFO(pc)->update_needed = TRUE;
}
#endif
player_msg_send1(api, pc, ret_buf, ret, INT, rotation);
return PLAYER_ERROR_INVALID_OPERATION;
else
return PLAYER_ERROR_NONE;
+ } else {
+ EVAS_INFO(pc)->visible = visible ? 1 : 0;
+ EVAS_INFO(pc)->update_needed = TRUE;
}
#endif