return ret;
}
+static bool _player_video_roi_area_is_valid(double x_scale, double y_scale,
+ double w_scale, double h_scale)
+{
+ if (x_scale >= 0.0 && x_scale <= 1.0 && y_scale >= 0.0 && y_scale <= 1.0
+ && w_scale > 0.0 && w_scale <= 1.0 && h_scale > 0.0 && h_scale <= 1.0)
+ return true;
+
+ LOGE("Video roi area is not valid");
+ return false;
+}
+
static bool _player_check_network_availability(void)
{
#define _FEATURE_NAME_WIFI "http://tizen.org/feature/network.wifi"
return ret;
}
+int player_set_video_roi_area(player_h player, double x_scale, double y_scale,
+ double w_scale, double h_scale)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_VIDEO_ROI_AREA;
+ player_cli_s *pc = (player_cli_s *) player;
+ char *ret_buf = NULL;
+
+ LOGD("ENTER");
+ PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
+ PLAYER_CHECK_CONDITION(CALLBACK_INFO(pc) != NULL && EVAS_HANDLE(pc) == NULL,
+ PLAYER_ERROR_INVALID_OPERATION, "Display type is EVAS, video display interface is not supported");
+
+ if (!_player_video_roi_area_is_valid(x_scale, y_scale, w_scale, h_scale))
+ return PLAYER_ERROR_INVALID_PARAMETER;
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret,
+ MUSE_TYPE_DOUBLE, "x_scale", x_scale,
+ MUSE_TYPE_DOUBLE, "y_scale", y_scale,
+ MUSE_TYPE_DOUBLE, "w_scale", w_scale,
+ MUSE_TYPE_DOUBLE, "h_scale", h_scale);
+
+ g_free(ret_buf);
+
+ return ret;
+}
+
+
+int player_get_video_roi_area(player_h player, double *x_scale, double *y_scale,
+ double *w_scale, double *h_scale)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(x_scale && y_scale && w_scale && h_scale);
+
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_ROI_AREA;
+ player_cli_s *pc = (player_cli_s *) player;
+ char *ret_buf = NULL;
+ double scale_x = 0, scale_y = 0, scale_w = 0, scale_h = 0;
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
+ if (ret == PLAYER_ERROR_NONE) {
+ if (player_msg_get_type(scale_x, ret_buf, DOUBLE))
+ *x_scale = scale_x;
+ else
+ LOGE("failed to get value from msg");
+ if (player_msg_get_type(scale_y, ret_buf, DOUBLE))
+ *y_scale = scale_y;
+ else
+ LOGE("failed to get value from msg");
+ if (player_msg_get_type(scale_w, ret_buf, DOUBLE))
+ *w_scale = scale_w;
+ else
+ LOGE("failed to get value from msg");
+ if (player_msg_get_type(scale_h, ret_buf, DOUBLE))
+ *h_scale = scale_h;
+ else
+ LOGE("failed to get value from msg");
+ }
+
+ g_free(ret_buf);
+
+ return ret;
+}
+
int player_set_display_roi_area(player_h player, int x, int y, int width, int height)
{