[Tizen] Add AutoRotation, LetterBox 29/319429/1 accepted/tizen/7.0/unified/20250212.163955
authorjoogab.yun <joogab.yun@samsung.com>
Thu, 9 Jan 2025 07:42:04 +0000 (16:42 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Tue, 11 Feb 2025 04:21:44 +0000 (13:21 +0900)
Change-Id: If8b6a28a0249133f42dc28c3575c44f35097960c

dali/devel-api/adaptor-framework/video-player-plugin.h
dali/devel-api/adaptor-framework/video-player.cpp
dali/devel-api/adaptor-framework/video-player.h
dali/internal/video/common/video-player-impl.cpp
dali/internal/video/common/video-player-impl.h

index d1d4c129ba1ddecb4e911af7493ae3fdb28a8d83..046eb4702e2d976251a33a63686cd2af7c39ad25 100644 (file)
@@ -320,6 +320,30 @@ public:
    * @return The return of native surface pointer of video player
    */
   virtual Any GetVideoPlayerSurface() = 0;
+
+  /**
+   * @brief Sets auto rotation feature. If enabled, video will rotate automatically according to the video orientation.
+   * @param[in] enable Whether to enable auto rotation feature. Default value is false.
+   */
+  virtual void SetAutoRotationEnabled(bool enable) = 0;
+
+  /**
+   * @brief Checks whether auto rotation feature is enabled.
+   * @return True if auto rotation feature is enabled, otherwise false. Default value is false.
+   */
+  virtual bool IsAutoRotationEnabled() const = 0;
+
+  /**
+   * @brief Sets letter box feature. If enabled, the video will play in the video player's aspect ratio.
+   * @param[in] enable Whether to enable letter box feature. Default value is false.
+   */
+  virtual void SetLetterBoxEnabled(bool enable) = 0;
+
+  /**
+   * @brief Checks whether letter box feature is enabled.
+   * @return True if letter box feature is enabled, otherwise false. Default value is false.
+   */
+  virtual bool IsLetterBoxEnabled() const = 0;
 };
 
 } // namespace Dali
index 597ad02cddc318a8a0ccfce904c2c829dcf9c742..19d5c72ad26a993af3df47da7dcc2877ff50bf77 100644 (file)
@@ -237,4 +237,24 @@ void VideoPlayer::LowerToBottom()
   GetImplementation(*this).LowerToBottom();
 }
 
+void VideoPlayer::SetAutoRotationEnabled(bool enable)
+{
+  GetImplementation(*this).SetAutoRotationEnabled(enable);
+}
+
+bool VideoPlayer::IsAutoRotationEnabled() const
+{
+  return GetImplementation(*this).IsAutoRotationEnabled();
+}
+
+void VideoPlayer::SetLetterBoxEnabled(bool enable)
+{
+  GetImplementation(*this).SetLetterBoxEnabled(enable);
+}
+
+bool VideoPlayer::IsLetterBoxEnabled() const
+{
+  return GetImplementation(*this).IsLetterBoxEnabled();
+}
+
 } // namespace Dali
index 8af206e9819b90fb318f00932ebdbc70a8cf768a..fd99b31539328b41e3641873d7fd1f6567ca59a4 100644 (file)
@@ -340,6 +340,26 @@ public:
    */
   void LowerToBottom();
 
+  /**
+   * @brief Sets auto rotation feature. If enabled, video will rotate automatically according to the video orientation.
+   */
+  void SetAutoRotationEnabled(bool enable);
+
+  /**
+   * @brief Checks whether auto rotation feature is enabled.
+   */
+  bool IsAutoRotationEnabled() const;
+
+  /**
+   * @brief Sets letter box feature. If enabled, the video will play in the video player's aspect ratio.
+   */
+  void SetLetterBoxEnabled(bool enable);
+
+  /**
+   * @brief Checks whether letter box feature is enabled.
+   */
+  bool IsLetterBoxEnabled() const;
+
 private: // Not intended for application developers
   /**
    * @brief Internal constructor
index 0e2afc478e90c5c5d87e017abf2c379dd2916b80..f85937973b6c95a2244fb48612aa7c7fe3bebe76 100644 (file)
@@ -388,6 +388,42 @@ void VideoPlayer::LowerToBottom()
     mPlugin->LowerToBottom();
   }
 }
+
+void VideoPlayer::SetAutoRotationEnabled(bool enable)
+{
+  if(mPlugin != nullptr)
+  {
+    mPlugin->SetAutoRotationEnabled(enable);
+  }
+}
+
+bool VideoPlayer::IsAutoRotationEnabled() const
+{
+  if(mPlugin != nullptr)
+  {
+    return mPlugin->IsAutoRotationEnabled();
+  }
+  return false;
+}
+
+void VideoPlayer::SetLetterBoxEnabled(bool enable)
+{
+  if(mPlugin != nullptr)
+  {
+    mPlugin->SetLetterBoxEnabled(enable);
+  }
+}
+
+bool VideoPlayer::IsLetterBoxEnabled() const
+{
+  if(mPlugin != nullptr)
+  {
+    return mPlugin->IsLetterBoxEnabled();
+  }
+  return false;
+}
+
+
 VideoPlayerPlugin* VideoPlayer::GetVideoPlayerPlugin()
 {
   return mPlugin;
index c5da3e3b8361f0d7b41d206cfe389b0be4b18ebe..c268d63038f5d118e6d65b725dd49bda6472a06e 100644 (file)
@@ -217,6 +217,26 @@ public:
    */
   void LowerToBottom();
 
+  /**
+   * @copydoc Dali::VideoPlayer::SetAutoRotationEnabled()
+   */
+  void SetAutoRotationEnabled(bool enable);
+
+  /**
+   * @copydoc Dali::VideoPlayer::IsAutoRotationEnabled() const
+   */
+  bool IsAutoRotationEnabled() const;
+
+  /**
+   * @copydoc Dali::VideoPlayer::SetLetterBoxEnabled()
+   */
+  void SetLetterBoxEnabled(bool enable);
+
+  /**
+   * @copydoc Dali::VideoPlayer::IsLetterBoxEnabled() const
+   */
+  bool IsLetterBoxEnabled() const;
+
   /**
    * @brief Gets Video Player plugin
    * @SINCE_2_0.14