}
}
+typedef enum {
+ DISPLAY_ROTATION_0 = 0, /**< 0 degree */
+ DISPLAY_ROTATION_90_CCW, /**< 90 degree counterclockwise */
+ DISPLAY_ROTATION_180_CCW, /**< 180 degree counterclockwise */
+ DISPLAY_ROTATION_270_CCW, /**< 270 degree counterclockwise */
+} display_rotation_e;
+
+/* 'rotate' is clockwise angle which is set by user
+ but the window server rotate window counter-clockwise */
+int ConvertDisplayRotateValue(const DisplayRotation& rotate) {
+ switch (rotate) {
+ case DisplayRotation::kNone: {
+ return DISPLAY_ROTATION_0;
+ }
+ case DisplayRotation::kRotate90: {
+ return DISPLAY_ROTATION_270_CCW;
+ }
+ case DisplayRotation::kRotate180: {
+ return DISPLAY_ROTATION_180_CCW;
+ }
+ case DisplayRotation::kRotate270: {
+ return DISPLAY_ROTATION_90_CCW;
+ }
+ default:
+ assert(0 && "unknown display rotate value");
+ return DISPLAY_ROTATION_0;
+ }
+}
+
mm_display_type_e ConvertDisplayType(const DisplayType& type) {
switch (type) {
case DisplayType::kOverlay:
static_cast<int>(mode_), visible_,
static_cast<int>(rotate_));
int mode_value = internal::ConvertDisplayModeValue(mode_);
- int rotate_value = static_cast<int>(rotate_);
+ int rotate_value = internal::ConvertDisplayRotateValue(rotate_);
g_object_set(G_OBJECT(videosink), "display-geometry-method", mode_value,
"visible", visible_, "rotate", rotate_value, nullptr);
if (ret != MM_ERROR_NONE)
TRACKRENDERER_ERROR("mm_display_interface_evas_set_mode() failed [%x]", ret);
- ret = mm_display_interface_evas_set_rotation(interface_, static_cast<int>(rotate_));
+ int rotate_value = internal::ConvertDisplayRotateValue(rotate_);
+ ret = mm_display_interface_evas_set_rotation(interface_, rotate_value);
if (ret != MM_ERROR_NONE)
TRACKRENDERER_ERROR("mm_display_interface_evas_set_rotation() failed [%x]", ret);