From 8003325b3f7a817b554f3fb9442e2b46019da203 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Tue, 13 Feb 2018 15:09:04 +0900 Subject: [PATCH] [4.0] Added APIs for setting display mode in video-player Change-Id: I2a8c0d0b039779fea89d9aa9641328031f650bd6 --- adaptors/common/video-player-impl.cpp | 18 ++++++++++++++ adaptors/common/video-player-impl.h | 10 ++++++++ .../adaptor-framework/video-player-plugin.h | 29 ++++++++++++++++++++++ .../devel-api/adaptor-framework/video-player.cpp | 10 ++++++++ .../devel-api/adaptor-framework/video-player.h | 12 +++++++++ 5 files changed, 79 insertions(+) mode change 100644 => 100755 adaptors/common/video-player-impl.cpp mode change 100644 => 100755 adaptors/common/video-player-impl.h mode change 100644 => 100755 adaptors/devel-api/adaptor-framework/video-player-plugin.h mode change 100644 => 100755 adaptors/devel-api/adaptor-framework/video-player.cpp mode change 100644 => 100755 adaptors/devel-api/adaptor-framework/video-player.h diff --git a/adaptors/common/video-player-impl.cpp b/adaptors/common/video-player-impl.cpp old mode 100644 new mode 100755 index 0a95230..06c4a17 --- a/adaptors/common/video-player-impl.cpp +++ b/adaptors/common/video-player-impl.cpp @@ -317,6 +317,24 @@ Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const return Dali::VideoPlayerPlugin::CodecType::DEFAULT; } +void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode ) +{ + if( mPlugin != NULL ) + { + mPlugin->SetDisplayMode( mode ); + } +} + +Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const +{ + if( mPlugin != NULL ) + { + return mPlugin->GetDisplayMode(); + } + + return Dali::VideoPlayerPlugin::DisplayMode::DST_ROI; +} + } // namespace Adaptor; } // namespace Internal; } // namespace Dali; diff --git a/adaptors/common/video-player-impl.h b/adaptors/common/video-player-impl.h old mode 100644 new mode 100755 index 76bdfbb..41c228f --- a/adaptors/common/video-player-impl.h +++ b/adaptors/common/video-player-impl.h @@ -174,6 +174,16 @@ public: */ Dali::VideoPlayerPlugin::CodecType GetCodecType() const; + /** + * @copydoc Dali::VideoPlayer::SetDisplayMode() + */ + void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode ); + + /** + * @brief Dali::VideoPlayer::GetDisplayMode() + */ + Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const; + private: /** diff --git a/adaptors/devel-api/adaptor-framework/video-player-plugin.h b/adaptors/devel-api/adaptor-framework/video-player-plugin.h old mode 100644 new mode 100755 index 524200a..caf74fb --- a/adaptors/devel-api/adaptor-framework/video-player-plugin.h +++ b/adaptors/devel-api/adaptor-framework/video-player-plugin.h @@ -63,6 +63,22 @@ public: }; /** + * @brief The values of this enum determine how the video should be display mode to the view + */ + struct DisplayMode + { + enum Type + { + LETTER_BOX = 0, /**< Letter box */ + ORIGIN_SIZE, /**< Origin size */ + FULL_SCREEN, /**< Full-screen */ + CROPPED_FULL, /**< Cropped full-screen */ + ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */ + DST_ROI /**< Region of Interest */ + }; + }; + + /** * @brief Constructor. * @SINCE_1_1.38 */ @@ -238,6 +254,19 @@ public: * @return CodecType */ virtual VideoPlayerPlugin::CodecType GetCodecType() const = 0; + + /** + * @brief Sets the display mode for playback. + * @param[in] mode of playback + */ + virtual void SetDisplayMode( VideoPlayerPlugin::DisplayMode::Type mode ) = 0; + + /** + * @brief Returns the current display mode. + * @return The current display mode of playback + */ + virtual VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const = 0; + }; } // namespace Dali; diff --git a/adaptors/devel-api/adaptor-framework/video-player.cpp b/adaptors/devel-api/adaptor-framework/video-player.cpp old mode 100644 new mode 100755 index 18a0731..3b758bd --- a/adaptors/devel-api/adaptor-framework/video-player.cpp +++ b/adaptors/devel-api/adaptor-framework/video-player.cpp @@ -186,5 +186,15 @@ Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const return GetImplementation( *this ).GetCodecType(); } +void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode ) +{ + GetImplementation( *this ).SetDisplayMode( mode ); +} + +Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const +{ + return GetImplementation( *this ).GetDisplayMode(); +} + } // namespace Dali; diff --git a/adaptors/devel-api/adaptor-framework/video-player.h b/adaptors/devel-api/adaptor-framework/video-player.h old mode 100644 new mode 100755 index 83a3dbd..791c2e6 --- a/adaptors/devel-api/adaptor-framework/video-player.h +++ b/adaptors/devel-api/adaptor-framework/video-player.h @@ -259,6 +259,18 @@ public: */ Dali::VideoPlayerPlugin::CodecType GetCodecType() const; + /** + * @brief Sets the display mode for playback. + * @param[in] mode of playback + */ + void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode ); + + /** + * @brief Gets display mode + * @return DisplayMode + */ + Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const; + private: // Not intended for application developers /** -- 2.7.4