Support the synchronization of changing the video player's z-order 75/254375/6
authorWonsik Jung <sidein@samsung.com>
Mon, 1 Mar 2021 21:07:16 +0000 (06:07 +0900)
committerWonsik Jung <sidein@samsung.com>
Thu, 11 Mar 2021 10:17:31 +0000 (19:17 +0900)
If one video view moves the other above or below,
video player's z-order should be changed.
This patch is for supporting that.

Change-Id: I55d681b3eacb1f74bb9a683b8e1b5345a6d1f3d4

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 3679e63..d1d4c12 100644 (file)
@@ -287,6 +287,39 @@ public:
    * This function is called, the synchronization is finished between UI(transparent hole) and video player.
    */
   virtual void FinishSynchronization() = 0;
+
+  /**
+   * @brief Raise the video player above the target video plaer.
+   *
+   * @param[in] target The target video player
+   */
+  virtual void RaiseAbove(Any target) = 0;
+
+  /**
+   * @brief Lower the video player to below the target video player.
+   *
+   * @param[in] target The target video player
+   */
+  virtual void LowerBelow(Any target) = 0;
+
+  /**
+   * @brief Raise video player above all other sibling video players.
+   *
+   */
+  virtual void RaiseToTop() = 0;
+
+  /**
+   * @brief Lower video player to the bottom of all other sibling video players.
+   *
+   */
+  virtual void LowerToBottom() = 0;
+
+  /**
+   * @brief Gets Video Player's native surface.
+   *
+   * @return The return of native surface pointer of video player
+   */
+  virtual Any GetVideoPlayerSurface() = 0;
 };
 
 } // namespace Dali
index 668aa9c..f98b50a 100644 (file)
@@ -223,4 +223,24 @@ void VideoPlayer::FinishSynchronization()
   GetImplementation(*this).FinishSynchronization();
 }
 
+void VideoPlayer::RaiseAbove(Dali::VideoPlayer target)
+{
+  GetImplementation(*this).RaiseAbove(target);
+}
+
+void VideoPlayer::LowerBelow(Dali::VideoPlayer target)
+{
+  GetImplementation(*this).LowerBelow(target);
+}
+
+void VideoPlayer::RaiseToTop()
+{
+  GetImplementation(*this).RaiseToTop();
+}
+
+void VideoPlayer::LowerToBottom()
+{
+  GetImplementation(*this).LowerToBottom();
+}
+
 } // namespace Dali
index 4da6b67..6daae85 100644 (file)
@@ -299,6 +299,30 @@ public:
    */
   void FinishSynchronization();
 
+  /**
+   * @brief Raise the video player above the target video plaer.
+   *
+   * @param[in] target The target video player
+   */
+  void RaiseAbove(Dali::VideoPlayer target);
+
+  /**
+   * @brief Lower the video player to below the target video player.
+   *
+   * @param[in] target The target video player
+   */
+  void LowerBelow(Dali::VideoPlayer target);
+
+  /**
+   * @brief Raise video player above all other sibling video players.
+   */
+  void RaiseToTop();
+
+  /**
+   * @brief Lower video player to the bottom of all other sibling video players.
+   */
+  void LowerToBottom();
+
 private: // Not intended for application developers
   /**
    * @brief Internal constructor
index ef46f90..0e2afc4 100644 (file)
@@ -355,6 +355,44 @@ void VideoPlayer::FinishSynchronization()
   }
 }
 
+void VideoPlayer::RaiseAbove(Dali::VideoPlayer target)
+{
+  VideoPlayerPlugin* targetPlugin = GetImplementation(target).GetVideoPlayerPlugin();
+  if(mPlugin != nullptr && targetPlugin != nullptr)
+  {
+    mPlugin->RaiseAbove(targetPlugin->GetVideoPlayerSurface());
+  }
+}
+
+void VideoPlayer::LowerBelow(Dali::VideoPlayer target)
+{
+  VideoPlayerPlugin* targetPlugin = GetImplementation(target).GetVideoPlayerPlugin();
+  if(mPlugin != nullptr && targetPlugin != nullptr)
+  {
+    mPlugin->LowerBelow(targetPlugin->GetVideoPlayerSurface());
+  }
+}
+
+void VideoPlayer::RaiseToTop()
+{
+  if(mPlugin != nullptr)
+  {
+    mPlugin->RaiseToTop();
+  }
+}
+
+void VideoPlayer::LowerToBottom()
+{
+  if(mPlugin != nullptr)
+  {
+    mPlugin->LowerToBottom();
+  }
+}
+VideoPlayerPlugin* VideoPlayer::GetVideoPlayerPlugin()
+{
+  return mPlugin;
+}
+
 } // namespace Adaptor
 } // namespace Internal
 } // namespace Dali
index 21f9c0e..c5da3e3 100644 (file)
@@ -197,6 +197,33 @@ public:
    */
   void FinishSynchronization();
 
+  /**
+   * @copydoc Dali::VideoPlayer::RaiseAbove()
+   */
+  void RaiseAbove(Dali::VideoPlayer target);
+
+  /**
+   * @copydoc Dali::VideoPlayer::LowerBelow()
+   */
+  void LowerBelow(Dali::VideoPlayer target);
+
+  /**
+   * @copydoc Dali::VideoPlayer::RaiseToTop()
+   */
+  void RaiseToTop();
+
+  /**
+   * @copydoc Dali::VideoPlayer::LowerToBottom()
+   */
+  void LowerToBottom();
+
+  /**
+   * @brief Gets Video Player plugin
+   * @SINCE_2_0.14
+   * @return VideoPlayerPlugin pointer
+   */
+  VideoPlayerPlugin* GetVideoPlayerPlugin();
+
 private:
   /**
    * @brief Constructor.