Add AutoRotation, LetterBox 00/317900/3
authorjoogab.yun <joogab.yun@samsung.com>
Thu, 9 Jan 2025 07:42:04 +0000 (16:42 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Mon, 13 Jan 2025 04:33:17 +0000 (13:33 +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 6783e75ffe98764d42e51d3e393d39f9bc78f934..cc5d987770f696f0b1f60071f39a775d3593a9ee 100644 (file)
@@ -332,6 +332,30 @@ public:
    *
    */
   virtual void SceneDisconnection() = 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 018eb958a375ec589eeea68938ee77c3b78b7d70..55370473e2b6bec27b81c3315d68d1f4b82f195e 100644 (file)
@@ -247,4 +247,24 @@ void VideoPlayer::SceneDisconnection()
   GetImplementation(*this).SceneDisconnection();
 }
 
+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 91eee48e9985abe4f580d04338b81658568da337..5a200479fa2c0550eca3b5a20bb1da02dea32862 100644 (file)
@@ -350,6 +350,26 @@ public:
    */
   void SceneDisconnection();
 
+  /**
+   * @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 4166c174e9005805a0108158f07c5f8d98a27bf2..cc88ffaf181ce9e60ea916fbd1d302ad556c6208 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 eeee4e9290bdc998cffb74fe150a439f9ec78c5e..6001a7aa5b07a2c19e09f840fbbf6e15b6057837 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