From: taeyoon0.lee Date: Mon, 22 Jan 2018 09:31:38 +0000 (+0900) Subject: [4.0] Added APIs for codec in video-player X-Git-Tag: accepted/tizen/4.0/unified/20180223.062019~4^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=fead3214e77c51a3d92666b1a966cd13d218bbb4 [4.0] Added APIs for codec in video-player Change-Id: I76c7dacc1bc55e6c06552bf136bc3edba4081158 --- diff --git a/adaptors/common/video-player-impl.cpp b/adaptors/common/video-player-impl.cpp index 0807e2a..0a95230 100644 --- a/adaptors/common/video-player-impl.cpp +++ b/adaptors/common/video-player-impl.cpp @@ -299,6 +299,24 @@ bool VideoPlayer::IsVideoTextureSupported() 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/adaptors/common/video-player-impl.h b/adaptors/common/video-player-impl.h index 498a761..76bdfbb 100644 --- a/adaptors/common/video-player-impl.h +++ b/adaptors/common/video-player-impl.h @@ -164,6 +164,16 @@ public: */ bool IsVideoTextureSupported(); + /** + * @brief Dali::VideoPlayer::SetCodecType() + */ + void SetCodecType( Dali::VideoPlayerPlugin::CodecType type ); + + /** + * @brief Dali::VideoPlayer::GetCodecType() + */ + Dali::VideoPlayerPlugin::CodecType GetCodecType() const; + private: /** diff --git a/adaptors/devel-api/adaptor-framework/video-player-plugin.h b/adaptors/devel-api/adaptor-framework/video-player-plugin.h index 10a6d5d..524200a 100644 --- a/adaptors/devel-api/adaptor-framework/video-player-plugin.h +++ b/adaptors/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 */ @@ -217,6 +227,17 @@ public: */ 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/adaptors/devel-api/adaptor-framework/video-player.cpp b/adaptors/devel-api/adaptor-framework/video-player.cpp index 048a9f0..18a0731 100644 --- a/adaptors/devel-api/adaptor-framework/video-player.cpp +++ b/adaptors/devel-api/adaptor-framework/video-player.cpp @@ -176,5 +176,15 @@ 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/adaptors/devel-api/adaptor-framework/video-player.h b/adaptors/devel-api/adaptor-framework/video-player.h index c630c72..83a3dbd 100644 --- a/adaptors/devel-api/adaptor-framework/video-player.h +++ b/adaptors/devel-api/adaptor-framework/video-player.h @@ -247,6 +247,18 @@ public: */ 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 /**