X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-extension%2Fvideo-player%2Fecore-wl2%2Ftizen-video-player.h;h=03a70b8612848e37146c19173b9a66577017b617;hb=87182f204160ea287bf7893b248271eea80e2fe0;hp=1d34778e00b4a334d9ed5d660c0ab6713009ea81;hpb=43fce20630f8b8b96803715c08ab87bfea16357d;p=platform%2Fcore%2Fuifw%2Fdali-extension.git diff --git a/dali-extension/video-player/ecore-wl2/tizen-video-player.h b/dali-extension/video-player/ecore-wl2/tizen-video-player.h index 1d34778..03a70b8 100755 --- a/dali-extension/video-player/ecore-wl2/tizen-video-player.h +++ b/dali-extension/video-player/ecore-wl2/tizen-video-player.h @@ -19,25 +19,27 @@ */ // EXTERNAL INCLUDES +#include +#include #include -#include #include -#include +#include +#include +#include #include #include +#include #ifndef HAVE_WAYLAND #define HAVE_WAYLAND #endif -#include #include +#include namespace Dali { - namespace Plugin { - /** * @brief Implementation of the Tizen video player class which has Tizen platform dependency. * @SINCE_1_1.38 @@ -45,22 +47,20 @@ namespace Plugin class TizenVideoPlayer : public Dali::VideoPlayerPlugin, public Dali::ConnectionTracker { public: - /** * @brief Video rendering target type * @SINCE_1_1.38 */ enum RenderingTargetType { - WindowSurface, ///< HW underlay - NativeImage ///< texture stream + WINDOW_SURFACE, ///< HW underlay @SINCE_1_9.28 + NATIVE_IMAGE ///< texture stream @SINCE_1_9.28 }; /** * @brief Constructor. - * @SINCE_1_1.38 */ - TizenVideoPlayer(); + TizenVideoPlayer(Dali::Actor actor, Dali::VideoSyncMode syncMode); /** * @brief Destructor. @@ -71,7 +71,7 @@ public: /** * @copydoc Dali::VideoPlayerPlugin::SetUrl() */ - virtual void SetUrl( const std::string& url ); + virtual void SetUrl(const std::string& url); /** * @copydoc Dali::VideoPlayerPlugin::GetUrl() @@ -106,7 +106,7 @@ public: /** * @copydoc Dali::VideoPlayerPlugin::SetMute() */ - virtual void SetMute( bool mute ); + virtual void SetMute(bool mute); /** * @copydoc Dali::VideoPlayerPlugin::IsMute() @@ -116,22 +116,22 @@ public: /** * @copydoc Dali::VideoPlayerPlugin::SetVolume() */ - virtual void SetVolume( float left, float right ); + virtual void SetVolume(float left, float right); /** * @copydoc Dali::VideoPlayerPlugin::GetVolume() */ - virtual void GetVolume( float& left, float& right ); + virtual void GetVolume(float& left, float& right); /** * @copydoc Dali::VideoPlayerPlugin::SetRenderingTarget() */ - void SetRenderingTarget( Any target ); + void SetRenderingTarget(Any target); /** * @copydoc Dali::VideoPlayerPlugin::SetPlayPosition() */ - virtual void SetPlayPosition( int millisecond ); + virtual void SetPlayPosition(int millisecond); /** * @copydoc Dali::VideoPlayerPlugin::GetPlayPosition() @@ -141,12 +141,12 @@ public: /** * @copydoc Dali::VideoPlayerPlugin::SetDisplayArea() */ - virtual void SetDisplayArea( DisplayArea area ); + virtual void SetDisplayArea(DisplayArea area); /** * @copydoc Dali::VideoPlayerPlugin::SetDisplayRotation() */ - virtual void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation ); + virtual void SetDisplayRotation(Dali::VideoPlayerPlugin::DisplayRotation rotation); /** * @copydoc Dali::VideoPlayerPlugin::GetDisplayRotation() @@ -161,17 +161,17 @@ public: /** * @brief Push media packet with video frame image */ - void PushPacket( media_packet_h packet ); + void PushPacket(media_packet_h packet); /** * @brief Dali::VideoPlayer::Forward() */ - void Forward( int millisecond ); + void Forward(int millisecond); /** * @brief Dali::VideoPlayer::Backward() */ - void Backward( int millisecond ); + void Backward(int millisecond); /** * @brief Dali::VideoPlayer::IsVideoTextureSupported() @@ -181,7 +181,7 @@ public: /** * @brief Dali::VideoPlayer::SetCodecType() */ - void SetCodecType( Dali::VideoPlayerPlugin::CodecType type ); + void SetCodecType(Dali::VideoPlayerPlugin::CodecType type); /** * @brief Dali::VideoPlayer::GetCodecType() @@ -191,16 +191,55 @@ public: /** * @copydoc Dali::VideoPlayerPlugin::SetDisplayMode() */ - void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode ); + void SetDisplayMode(Dali::VideoPlayerPlugin::DisplayMode::Type mode); /** * @copydoc Dali::VideoPlayerPlugin::GetDisplayMode() */ Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const; -private: + /** + * @copydoc Dali::VideoPlayerPlugin::GetMediaPlayer() + */ + Any GetMediaPlayer(); + + /** + * @copydoc Dali::VideoPlayerPlugin::StartSynchronization() + */ + void StartSynchronization(); + + /** + * @copydoc Dali::VideoPlayerPlugin::FinishSynchronization() + */ + void FinishSynchronization(); + + /** + * @copydoc Dali::VideoPlayerPlugin::RaiseAbove() + */ + void RaiseAbove(Any videoSurface); + + /** + * @copydoc Dali::VideoPlayerPlugin::LowerBelow() + */ + void LowerBelow(Any videoSurface); + + /** + * @copydoc Dali::VideoPlayerPlugin::RaiseToTop() + */ + void RaiseToTop(); /** + * @copydoc Dali::VideoPlayerPlugin::LowerToBottom() + */ + void LowerToBottom(); + + /** + * @copydoc Dali::VideoPlayerPlugin::GetVideoPlayerSurface() + */ + Any GetVideoPlayerSurface(); + +private: + /** * @brief Updates video frame image by timer if rendering targe is native image source */ bool Update(); @@ -208,7 +247,7 @@ private: /** * @brief Gets current player state */ - void GetPlayerState( player_state_e* state ) const; + void GetPlayerState(player_state_e* state) const; /** * @brief Destroy all packests, which this plugin stores @@ -218,45 +257,69 @@ private: /** * @brief Initializes player for video rendering using native image source */ - void InitializeTextureStreamMode( Dali::NativeImageSourcePtr nativeImageSourcePtr ); + void InitializeTextureStreamMode(Dali::NativeImageSourcePtr nativeImageSourcePtr); /** * @brief Initializes player for video rendering using wayland window surface */ - void InitializeUnderlayMode( Ecore_Wl2_Window* ecoreWlWindow ); + void InitializeUnderlayMode(Ecore_Wl2_Window* ecoreWlWindow); + + /** + * @brief Initializes player for video rendering with synchronization mode. + * + * @param[in] ecoreWlWindow The window for synchronization mode. + */ + void InitializeEnableSyncMode(Ecore_Wl2_Window* ecoreWlWindow); /** * @brief Destroys player handle */ void DestroyPlayer(); -private: - - std::string mUrl; ///< The video file path - player_h mPlayer; ///< Tizen player handle - player_state_e mPlayerState; ///< Tizen player state - tbm_surface_h mTbmSurface; ///< tbm surface handle - media_packet_h mPacket; ///< Media packet handle with tbm surface of current video frame image - Dali::NativeImageSourcePtr mNativeImageSourcePtr; ///< native image source for video rendering - Dali::Timer mTimer; ///< Timer for texture streaming rendering - Dali::Vector4 mBackgroundColor; ///< Current background color, which texturestream mode needs. - RenderingTargetType mTargetType; ///< Current rendering target type + /** + * @brief Create Constraint for synchronization + */ + void CreateConstraint(); - Dali::Mutex mPacketMutex; - Dali::Vector< media_packet_h > mPacketVector; ///< Container for media packet handle from Tizen player callback + /** + * @brief Destroy Constraint for synchronization + */ + void DestroyConstraint(); - Ecore_Wl2_Window* mEcoreWlWindow; +private: + std::string mUrl; ///< The video file path + player_h mPlayer; ///< Tizen player handle + player_state_e mPlayerState; ///< Tizen player state + tbm_surface_h mTbmSurface; ///< tbm surface handle + media_packet_h mPacket; ///< Media packet handle with tbm surface of current video frame image + Dali::NativeImageSourcePtr mNativeImageSourcePtr; ///< native image source for video rendering + Dali::Timer mTimer; ///< Timer for texture streaming rendering + Dali::Vector4 mBackgroundColor; ///< Current background color, which texturestream mode needs. + RenderingTargetType mTargetType; ///< Current rendering target type - bool mAlphaBitChanged; ///< True if underlay rendering initialization changes window alpha + Dali::Mutex mPacketMutex; + std::list mPacketList; ///< Container for media packet handle from Tizen player callback sound_stream_info_h mStreamInfo; sound_stream_type_e mStreamType; -public: + player_video_codec_type_ex_e mCodecType; + + Ecore_Wl2_Window* mEcoreWlWindow; ///< ecore native window handle + Ecore_Wl2_Subsurface* mEcoreSubVideoWindow; ///< ecore native subsurface for synchronization with video player + Dali::WeakHandle mSyncActor; + Constraint mVideoSizePropertyConstraint; + Property::Index mVideoSizePropertyIndex; + Dali::VideoSyncMode mSyncMode; + + bool mIsInitForSyncMode; ///< the flag for synchronization with video player + bool mIsMovedHandle; ///< the flag for moved the handle + +public: Dali::VideoPlayerPlugin::VideoPlayerSignalType mFinishedSignal; }; } // namespace Plugin -} // namespace Dali; +} // namespace Dali #endif