Make rotate clockwise 86/319186/1 accepted/tizen_8.0_unified accepted/tizen/8.0/unified/20250207.154819
authorEunhye Choi <eunhae1.choi@samsung.com>
Mon, 3 Feb 2025 06:08:53 +0000 (15:08 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Wed, 5 Feb 2025 06:04:14 +0000 (15:04 +0900)
[Version] 0.0.56

the counter clockwise rotation is changed to roate clockwise
to eunsure API compatibility.

Change-Id: I89cac7e74d11403bcf92a31150fe0b568676cf8a

packaging/libtrackrenderer.spec
src/display.cpp

index a3492c1c3907a22157a9f37e496cd73887f23da8..a11c08223cd6ece4ce0c6e6484ae0aaf4ad35cec 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libtrackrenderer
 Summary:    new multimedia streaming player trackrenderer
-Version:    0.0.55
+Version:    0.0.56
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 29dcfad23c7bd72ad39d18d4077b06589ed1f7ec..a318c165db4053a792e97545274a3ea76a345246 100644 (file)
@@ -228,6 +228,35 @@ int ConvertDisplayModeValue(const DisplayMode& mode) {
   }
 }
 
+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:
@@ -431,7 +460,7 @@ bool Display::Update(GstElement* videosink) {
                         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);
 
@@ -449,7 +478,8 @@ bool Display::Update(GstElement* videosink) {
       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);