void *handle = NULL;
MMPLAYER_FENTER();
- if (!player->video_roi.is_set) {
- LOGE("Video content ROI is not set");
- return;
- }
-
/* check video sinkbin is created */
- if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+ if (__mmplayer_video_param_check_video_sink_bin(player) != MM_ERROR_NONE) {
+ LOGW("There is no video sink");
return;
+ }
attrs = MMPLAYER_GET_ATTRS(player);
MMPLAYER_RETURN_IF_FAIL(attrs);
MMPLAYER_FENTER();
/* check video sinkbin is created */
- if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+ if (__mmplayer_video_param_check_video_sink_bin(player) != MM_ERROR_NONE) {
+ LOGW("There is no video sink");
return;
+ }
attrs = MMPLAYER_GET_ATTRS(player);
MMPLAYER_RETURN_IF_FAIL(attrs);
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);
-
}
}
void
return FALSE;
}
+static void
+__mmplayer_initialize_video_roi(mm_player_t *player)
+{
+ player->video_roi.scale_x = 0.0;
+ player->video_roi.scale_y = 0.0;
+ player->video_roi.scale_width = 1.0;
+ player->video_roi.scale_height = 1.0;
+}
+
int
_mmplayer_create_player(MMHandleType handle)
{
player->video360_horizontal_fov = PLAYER_SPHERICAL_DEFAULT_H_FOV;
player->video360_vertical_fov = PLAYER_SPHERICAL_DEFAULT_V_FOV;
+ __mmplayer_initialize_video_roi(player);
+
/* set player state to null */
MMPLAYER_STATE_CHANGE_TIMEOUT(player) = player->ini.localplayback_state_change_timeout;
MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_NULL);
player->sound.rg_enable = false;
+ __mmplayer_initialize_video_roi(player);
MMPLAYER_FLEAVE();
}
MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
- /* check video sinkbin is created */
- if (ret != __mmplayer_video_param_check_video_sink_bin(player))
- return ret;
-
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);
-
if (!handle) {
LOGE("Display handle is NULL, after setting window handle, set video roi area");
return MM_ERROR_PLAYER_INTERNAL;
player->video_roi.scale_width = scale_width;
player->video_roi.scale_height = scale_height;
- player->video_roi.is_set = gst_video_overlay_set_video_roi_area(
- GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
- scale_x, scale_y, scale_width, scale_height);
+ /* check video sinkbin is created */
+ if (__mmplayer_video_param_check_video_sink_bin(player) != MM_ERROR_NONE)
+ return MM_ERROR_NONE;
- if (player->video_roi.is_set) {
+ if (!gst_video_overlay_set_video_roi_area(
+ GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
+ scale_x, scale_y, scale_width, scale_height))
+ ret = MM_ERROR_PLAYER_INTERNAL;
+ else
LOGD("set video param : video roi area scale value: x(%f) y(%f) width(%f) height(%f)",
scale_x, scale_y, scale_width, scale_height);
- }
+
+ MMPLAYER_FLEAVE();
return ret;
}
MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
MMPLAYER_RETURN_VAL_IF_FAIL(scale_x && scale_y && scale_width && scale_height, MM_ERROR_INVALID_ARGUMENT);
- /* check video sinkbin is created */
- if (ret != __mmplayer_video_param_check_video_sink_bin(player))
- return ret;
+ *scale_x = player->video_roi.scale_x;
+ *scale_y = player->video_roi.scale_y;
+ *scale_width = player->video_roi.scale_width;
+ *scale_height = player->video_roi.scale_height;
- if (player->video_roi.is_set) {
- *scale_x = player->video_roi.scale_x;
- *scale_y = player->video_roi.scale_y;
- *scale_width = player->video_roi.scale_width;
- *scale_height = player->video_roi.scale_height;
- } else {
- LOGE("Video content ROI is not set");
- *scale_x = 0.0;
- *scale_y = 0.0;
- *scale_width = 1.0;
- *scale_height = 1.0;
- }
+ LOGD("get video param : video roi area scale value: x(%f) y(%f) width(%f) height(%f)",
+ *scale_x, *scale_y, *scale_width, *scale_height);
return ret;
}