From 57d0d4b526164fcac412576d3c1304c75f6a0753 Mon Sep 17 00:00:00 2001 From: "taeyoon0.lee" Date: Mon, 22 Jan 2018 18:31:38 +0900 Subject: [PATCH] Added APIs for codec in video-player Change-Id: I76c7dacc1bc55e6c06552bf136bc3edba4081158 --- .../adaptor-framework/video-player-plugin.h | 23 +++++++++++++++++++++- dali/devel-api/adaptor-framework/video-player.cpp | 12 ++++++++++- dali/devel-api/adaptor-framework/video-player.h | 14 ++++++++++++- dali/internal/video/common/video-player-impl.cpp | 20 ++++++++++++++++++- dali/internal/video/common/video-player-impl.h | 12 ++++++++++- 5 files changed, 76 insertions(+), 5 deletions(-) diff --git a/dali/devel-api/adaptor-framework/video-player-plugin.h b/dali/devel-api/adaptor-framework/video-player-plugin.h index f1c309b..524200a 100644 --- a/dali/devel-api/adaptor-framework/video-player-plugin.h +++ b/dali/devel-api/adaptor-framework/video-player-plugin.h @@ -53,6 +53,16 @@ public: }; /** + * @brief Enumeration for video codec type + */ + enum class CodecType + { + DEFAULT, ///< Codec which has higher priority as default. Platform selects it. Usually the H/W codec has higher priority than S/W codec if it exist. + HW, ///< H/W codec + SW ///< S/W codec + }; + + /** * @brief Constructor. * @SINCE_1_1.38 */ @@ -215,8 +225,19 @@ public: * @brief Checks whether the video texture is supported * @return True if supported, otherwise false. */ - virtual bool IsVideoTextureSupported() const = 0; + virtual bool IsVideoTextureSupported() = 0; + /** + * @brief Sets codec type + * @param[in] type The CodecType + */ + virtual void SetCodecType( VideoPlayerPlugin::CodecType type ) = 0; + + /** + * @brief Gets codec type + * @return CodecType + */ + virtual VideoPlayerPlugin::CodecType GetCodecType() const = 0; }; } // namespace Dali; diff --git a/dali/devel-api/adaptor-framework/video-player.cpp b/dali/devel-api/adaptor-framework/video-player.cpp index 4668f21..768c7e4 100644 --- a/dali/devel-api/adaptor-framework/video-player.cpp +++ b/dali/devel-api/adaptor-framework/video-player.cpp @@ -171,10 +171,20 @@ void VideoPlayer::Backward( int millisecond ) GetImplementation( *this ).Backward( millisecond ); } -bool VideoPlayer::IsVideoTextureSupported() const +bool VideoPlayer::IsVideoTextureSupported() { return GetImplementation( *this ).IsVideoTextureSupported(); } +void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type ) +{ + GetImplementation( *this ).SetCodecType( type ); +} + +Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const +{ + return GetImplementation( *this ).GetCodecType(); +} + } // namespace Dali; diff --git a/dali/devel-api/adaptor-framework/video-player.h b/dali/devel-api/adaptor-framework/video-player.h index 79efe22..b809038 100644 --- a/dali/devel-api/adaptor-framework/video-player.h +++ b/dali/devel-api/adaptor-framework/video-player.h @@ -245,7 +245,19 @@ public: * @brief Checks whether the video texture is supported * @return True if supported, otherwise false. */ - bool IsVideoTextureSupported() const; + bool IsVideoTextureSupported(); + + /** + * @brief Sets codec type + * @param[in] type The VideoCodec::Type + */ + void SetCodecType( Dali::VideoPlayerPlugin::CodecType type ); + + /** + * @brief Gets codec type + * @return VideoCodec::Type + */ + Dali::VideoPlayerPlugin::CodecType GetCodecType() const; private: // Not intended for application developers diff --git a/dali/internal/video/common/video-player-impl.cpp b/dali/internal/video/common/video-player-impl.cpp index 8c1a279..c2e911f 100644 --- a/dali/internal/video/common/video-player-impl.cpp +++ b/dali/internal/video/common/video-player-impl.cpp @@ -289,7 +289,7 @@ void VideoPlayer::Backward( int millisecond ) } } -bool VideoPlayer::IsVideoTextureSupported() const +bool VideoPlayer::IsVideoTextureSupported() { if( mPlugin != NULL ) { @@ -299,6 +299,24 @@ bool VideoPlayer::IsVideoTextureSupported() const return false; } +void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type ) +{ + if( mPlugin != NULL ) + { + mPlugin->SetCodecType( type ); + } +} + +Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const +{ + if( mPlugin != NULL ) + { + return mPlugin->GetCodecType(); + } + + return Dali::VideoPlayerPlugin::CodecType::DEFAULT; +} + } // 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 273adcd..c73e00d 100644 --- a/dali/internal/video/common/video-player-impl.h +++ b/dali/internal/video/common/video-player-impl.h @@ -162,7 +162,17 @@ public: /** * @brief Dali::VideoPlayer::IsVideoTextureSupported() */ - bool IsVideoTextureSupported() const; + bool IsVideoTextureSupported(); + + /** + * @brief Dali::VideoPlayer::SetCodecType() + */ + void SetCodecType( Dali::VideoPlayerPlugin::CodecType type ); + + /** + * @brief Dali::VideoPlayer::GetCodecType() + */ + Dali::VideoPlayerPlugin::CodecType GetCodecType() const; private: -- 2.7.4