static void __mmplayer_video_param_set_video_roi_area(mmplayer_t *player)
{
MMHandleType attrs = 0;
- void *handle = NULL;
+ int handle = 0;
MMPLAYER_FENTER();
/* check video sinkbin is created */
attrs = MMPLAYER_GET_ATTRS(player);
MMPLAYER_RETURN_IF_FAIL(attrs);
- mm_attrs_get_data_by_name(attrs, "display_overlay", &handle);
- if (handle) {
- gst_video_overlay_set_video_roi_area(
- GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
- player->video_roi.scale_x, player->video_roi.scale_y, player->video_roi.scale_width, player->video_roi.scale_height);
- LOGD("set video param : video roi area scale value: x(%f) y(%f) width(%f) height(%f)",
- player->video_roi.scale_x, player->video_roi.scale_y, player->video_roi.scale_width, player->video_roi.scale_height);
- }
+
+ mm_attrs_get_int_by_name(attrs, "display_overlay", &handle);
+ MMPLAYER_RETURN_IF_FAIL(handle);
+
+ gst_video_overlay_set_video_roi_area(
+ GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
+ player->video_roi.scale_x, player->video_roi.scale_y, player->video_roi.scale_width, player->video_roi.scale_height);
+ LOGD("set video param : video roi area scale value: x(%f) y(%f) width(%f) height(%f)",
+ player->video_roi.scale_x, player->video_roi.scale_y, player->video_roi.scale_width, player->video_roi.scale_height);
}
static void __mmplayer_video_param_set_roi_area(mmplayer_t *player)
{
MMHandleType attrs = 0;
- void *handle = NULL;
+ int handle = 0;
/*set wl_display*/
int win_roi_x = 0;
int win_roi_y = 0;
attrs = MMPLAYER_GET_ATTRS(player);
MMPLAYER_RETURN_IF_FAIL(attrs);
- mm_attrs_get_data_by_name(attrs, "display_overlay", &handle);
+ mm_attrs_get_int_by_name(attrs, "display_overlay", &handle);
+ MMPLAYER_RETURN_IF_FAIL(handle);
- if (handle) {
- /* It should be set after setting window */
- mm_attrs_multiple_get(attrs, NULL,
- "display_win_roi_x", &win_roi_x,
- "display_win_roi_y", &win_roi_y,
- "display_win_roi_width", &win_roi_width,
- "display_win_roi_height", &win_roi_height, NULL);
+ /* It should be set after setting window */
+ mm_attrs_multiple_get(attrs, NULL,
+ "display_win_roi_x", &win_roi_x,
+ "display_win_roi_y", &win_roi_y,
+ "display_win_roi_width", &win_roi_width,
+ "display_win_roi_height", &win_roi_height, NULL);
- /* After setting window handle, set display roi area */
- gst_video_overlay_set_display_roi_area(
- GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
- win_roi_x, win_roi_y, win_roi_width, win_roi_height);
- LOGD("set video param : roi area : x(%d) y(%d) width(%d) height(%d)",
- win_roi_x, win_roi_y, win_roi_width, win_roi_height);
- }
+ /* After setting window handle, set display roi area */
+ gst_video_overlay_set_display_roi_area(
+ GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
+ win_roi_x, win_roi_y, win_roi_width, win_roi_height);
+ LOGD("set video param : roi area : x(%d) y(%d) width(%d) height(%d)",
+ win_roi_x, win_roi_y, win_roi_width, win_roi_height);
}
static void __mmplayer_video_param_set_display_overlay(mmplayer_t *player)
{
MMHandleType attrs = 0;
- void *handle = NULL;
+ int handle = 0;
/* check video sinkbin is created */
if (!_mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_OVERLAY))
MMPLAYER_RETURN_IF_FAIL(attrs);
/* common case if using overlay surface */
- mm_attrs_get_data_by_name(attrs, "display_overlay", &handle);
-
- if (handle) {
- /* default is using wl_surface_id */
- unsigned int wl_surface_id = 0;
- wl_surface_id = *(int *)handle;
- LOGD("set video param : wl_surface_id %d", wl_surface_id);
- gst_video_overlay_set_wl_window_wl_surface_id(
- GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
- *(int *)handle);
- } else {
- /* FIXIT : is it error case? */
- LOGW("still we don't have a window handle on player attribute. create it's own surface.");
- }
+ mm_attrs_get_int_by_name(attrs, "display_overlay", &handle);
+ MMPLAYER_RETURN_IF_FAIL(handle);
+
+ /* default is using wl_surface_id */
+ LOGD("set video param : wl_surface_id %d", handle);
+ gst_video_overlay_set_wl_window_wl_surface_id(
+ GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
+ (guintptr)handle);
}
int
}
int
-_mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay)
+_mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, unsigned int wl_surface_id)
{
mmplayer_t *player = 0;
int prev_display_surface_type = 0;
- void *prev_display_overlay = NULL;
MMPLAYER_FENTER();
MMPLAYER_RETURN_VAL_IF_FAIL(handle, MM_ERROR_COMMON_INVALID_ARGUMENT);
- MMPLAYER_RETURN_VAL_IF_FAIL(display_overlay, MM_ERROR_COMMON_INVALID_ARGUMENT);
player = MM_PLAYER_CAST(handle);
/* load previous attributes */
if (player->attrs) {
mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &prev_display_surface_type);
- mm_attrs_get_data_by_name(player->attrs, "display_overlay", &prev_display_overlay);
LOGD("[0: Video surface, 4: EVAS surface] previous surface type(%d), new surface type(%d)", prev_display_surface_type, surface_type);
if (prev_display_surface_type == surface_type) {
LOGD("incoming display surface type is same as previous one, do nothing..");
/* videobin is not created yet, so we just set attributes related to display surface */
LOGD("store display attribute for given surface type(%d)", surface_type);
mm_player_set_attribute(handle, NULL, "display_surface_type", surface_type,
- "display_overlay", display_overlay, sizeof(display_overlay), NULL);
+ "display_overlay", (int)wl_surface_id, NULL);
MMPLAYER_FLEAVE();
return MM_ERROR_NONE;
{
mmplayer_t *player = (mmplayer_t *)hplayer;
MMHandleType attrs = 0;
- void *handle = NULL;
+ int handle = 0;
int ret = MM_ERROR_NONE;
MMPLAYER_FENTER();
attrs = MMPLAYER_GET_ATTRS(player);
MMPLAYER_RETURN_VAL_IF_FAIL(attrs, MM_ERROR_PLAYER_INTERNAL);
- mm_attrs_get_data_by_name(attrs, "display_overlay", &handle);
+ mm_attrs_get_int_by_name(attrs, "display_overlay", &handle);
if (!handle) {
LOGE("Display handle is NULL, after setting window handle, set video roi area");
return MM_ERROR_PLAYER_INTERNAL;