From 3099f63090c7a4eec283ca4fe4e76ec0e000ae60 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Tue, 2 Mar 2021 06:07:16 +0900 Subject: [PATCH] Support the synchronization of changing the video player's z-order 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 --- .../adaptor-framework/video-player-plugin.h | 33 +++++++++++++++++++ dali/devel-api/adaptor-framework/video-player.cpp | 20 ++++++++++++ dali/devel-api/adaptor-framework/video-player.h | 24 ++++++++++++++ dali/internal/video/common/video-player-impl.cpp | 38 ++++++++++++++++++++++ dali/internal/video/common/video-player-impl.h | 27 +++++++++++++++ 5 files changed, 142 insertions(+) diff --git a/dali/devel-api/adaptor-framework/video-player-plugin.h b/dali/devel-api/adaptor-framework/video-player-plugin.h index 3679e63..d1d4c12 100644 --- a/dali/devel-api/adaptor-framework/video-player-plugin.h +++ b/dali/devel-api/adaptor-framework/video-player-plugin.h @@ -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 diff --git a/dali/devel-api/adaptor-framework/video-player.cpp b/dali/devel-api/adaptor-framework/video-player.cpp index 668aa9c..f98b50a 100644 --- a/dali/devel-api/adaptor-framework/video-player.cpp +++ b/dali/devel-api/adaptor-framework/video-player.cpp @@ -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 diff --git a/dali/devel-api/adaptor-framework/video-player.h b/dali/devel-api/adaptor-framework/video-player.h index 4da6b67..6daae85 100644 --- a/dali/devel-api/adaptor-framework/video-player.h +++ b/dali/devel-api/adaptor-framework/video-player.h @@ -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 diff --git a/dali/internal/video/common/video-player-impl.cpp b/dali/internal/video/common/video-player-impl.cpp index ef46f90..0e2afc4 100644 --- a/dali/internal/video/common/video-player-impl.cpp +++ b/dali/internal/video/common/video-player-impl.cpp @@ -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 diff --git a/dali/internal/video/common/video-player-impl.h b/dali/internal/video/common/video-player-impl.h index 21f9c0e..c5da3e3 100644 --- a/dali/internal/video/common/video-player-impl.h +++ b/dali/internal/video/common/video-player-impl.h @@ -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. -- 2.7.4