X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fvideo-view%2Fvideo-view-impl.h;h=d1605cee7a24a445766ee3b8202df8dc73e1729e;hp=f10c1c0786fa049eae8918d85cbb1b703b766a40;hb=HEAD;hpb=1729f0da8849880dd20db5c6f045636e591a5b98 diff --git a/dali-toolkit/internal/controls/video-view/video-view-impl.h b/dali-toolkit/internal/controls/video-view/video-view-impl.h old mode 100755 new mode 100644 index f10c1c0..c8b2a83 --- a/dali-toolkit/internal/controls/video-view/video-view-impl.h +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_VIDEO_VIEW_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,15 +19,16 @@ */ // EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include #include #include -#include #include -#include #include -#include -#include -#include // INTERNAL INCLUDES #include @@ -35,29 +36,24 @@ namespace Dali { - namespace Toolkit { - class VideoView; namespace Internal { - -class VideoView: public Control +class VideoView : public Control { protected: - - VideoView( Dali::VideoSyncMode syncMode ); + VideoView(Dali::VideoSyncMode syncMode); virtual ~VideoView(); public: - /** * @copydoc Toolkit::DevelVideoView::New() */ - static Toolkit::VideoView New( VideoSyncMode syncMode ); + static Toolkit::VideoView New(VideoSyncMode syncMode); /** * @brief Sets a video url to play. @@ -65,7 +61,7 @@ public: * @SINCE_1_1.38 * @param [in] url The url of the video resource to play */ - void SetUrl( const std::string& url ); + void SetUrl(const std::string& url); /** * @brief Returns a video url. @@ -108,19 +104,19 @@ public: /** * @copydoc Toolkit::VideoView::Forward() */ - void Forward( int millisecond ); + void Forward(int millisecond); /** * @copydoc Toolkit::VideoView::Backward() */ - void Backward( int millisecond ); + void Backward(int millisecond); /** * @brief Sets the player mute status. * @SINCE_1_1.38 * @param[i] mute The new mute status, true is mute. */ - void SetMute( bool mute ); + void SetMute(bool mute); /** * @brief Returns the player mute status. @@ -135,7 +131,7 @@ public: * @param[in] left The left volume scalar * @param[in] right The right volume scalar */ - void SetVolume( float left, float right ); + void SetVolume(float left, float right); /** * @brief Returns current volume factor. @@ -143,9 +139,9 @@ public: * @param[out] left The current left volume scalar * @param[out] right The current right volume scalar */ - void GetVolume( float& left, float& right ); + void GetVolume(float& left, float& right); - /** + /** * @copydoc Dali::Toolkit::VideoView::FinishedSignal() */ Dali::Toolkit::VideoView::VideoViewSignalType& FinishedSignal(); @@ -160,7 +156,7 @@ public: * @SINCE_1_1.38 * @param[in] map The Dali::Property::Map to use for to display. */ - void SetPropertyMap( Property::Map map ); + void SetPropertyMap(Property::Map map); // Properties /** @@ -170,7 +166,7 @@ public: * @param[in] index The property index. * @param[in] value The new property value. */ - static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ); + static void SetProperty(BaseObject* object, Property::Index index, const Property::Value& value); /** * @brief Called to retrieve a property of an object of this type. @@ -179,7 +175,7 @@ public: * @param[in] index The property index. * @return The current value of the property. */ - static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex ); + static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex); /** * @brief Set the depth index of this image renderer @@ -188,7 +184,7 @@ public: * @SINCE_1_1.38 * @param[in] depthIndex The depth index of this renderer */ - void SetDepthIndex( int depthIndex ); + void SetDepthIndex(int depthIndex); /** * @brief Performs actions as requested using the action name. @@ -198,7 +194,7 @@ public: * @param[in] attributes The attributes with which to perfrom this action. * @return True if action has been accepted by this control */ - static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes ); + static bool DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes); /** * Connects a callback function with the object's signals. @@ -209,17 +205,17 @@ public: * @return True if the signal was connected. * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the c */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor); /** * @brief Updates video display area for window rendering target */ - void UpdateDisplayArea( Dali::PropertyNotification& source ); + void UpdateDisplayArea(Dali::PropertyNotification& source); /** * @brief Sets underlay flag and initializes new rendering target by flag. */ - void SetUnderlay( bool set ); + void SetUnderlay(bool set); /** * @brief Checks underlay flag. @@ -229,7 +225,7 @@ public: /** * @brief Sets sw codec type. */ - void SetSWCodec( bool on ); + void SetSWCodec(bool on); /** * @brief Gets play position. @@ -239,12 +235,12 @@ public: /** * @brief Sets play position. */ - void SetPlayPosition( int pos ); + void SetPlayPosition(int pos); /** * @brief Sets Display mode. */ - void SetDisplayMode( int mode ); + void SetDisplayMode(int mode); /** * @brief Gets Display mode. @@ -265,54 +261,57 @@ public: * @param[in] videoView The current VideoView * @param[in] animation The animation for video view's resize or move. */ - void PlayAnimation( Dali::Animation animation ); - -private: // From Control + void PlayAnimation(Dali::Animation animation); /** - * @copydoc Toolkit::Control::OnInitialize() + * @brief Checks whether the actor is set as a video view or not. + * + * @param[in] actor The actor to be checked + * @return True if actor is video view. */ - virtual void OnInitialize(); + bool IsVideoView(Actor actor) const; /** - * @copydoc Toolkit::Control::OnStageConnect() + * @brief Gets the Video Player. + * + * @return The return of video player. */ - virtual void OnStageConnection( int depth ); + VideoPlayer GetVideoPlayer(); +private: // From Control /** - * @copydoc Toolkit::Control::OnStageDisconnection() + * @copydoc Toolkit::Control::OnInitialize() */ - virtual void OnStageDisconnection(); + void OnInitialize() override; /** - * @copydoc Toolkit::Control::OnSizeSet() + * @copydoc Toolkit::Control::OnSceneConnection() */ - virtual void OnSizeSet( const Vector3& targetSize ); + void OnSceneConnection(int depth) override; /** - * @copydoc Toolkit::Control::GetNaturalSize + * @copydoc Toolkit::Control::OnSceneDisconnection() */ - virtual Vector3 GetNaturalSize(); + void OnSceneDisconnection() override; /** - * @copydoc Toolkit::Control::GetHeightForWidth() + * @copydoc Toolkit::Control::OnSizeSet() */ - virtual float GetHeightForWidth( float width ); + void OnSizeSet(const Vector3& targetSize) override; /** - * @copydoc Toolkit::Control::GetWidthForHeight() + * @copydoc Toolkit::Control::GetNaturalSize */ - virtual float GetWidthForHeight( float height ); + Vector3 GetNaturalSize() override; private: - /** * @brief Construct a new VideoView. */ - VideoView( const VideoView& videoView ); + VideoView(const VideoView& videoView); // Undefined assignment operator. - VideoView& operator=( const VideoView& videoView ); + VideoView& operator=(const VideoView& videoView); /** * @brief SetWindowSurfaceTarget for underlay video playback. @@ -335,12 +334,12 @@ private: * @param String output * @return true if the output was found */ - bool GetStringFromProperty( const Dali::Property::Value& value, std::string& output ); + bool GetStringFromProperty(const Dali::Property::Value& value, std::string& output); /* * @brief Internal version of SetProperty */ - void SetPropertyInternal( Property::Index index, const Property::Value& value ); + void SetPropertyInternal(Property::Index index, const Property::Value& value); /* * @brief Apply properties after reset video player @@ -354,7 +353,7 @@ private: * so Ui and video player's synchronization can be finished. * */ - void FrameRenderCallback( int frameID ); + void FrameRenderCallback(int frameID); /* * @brief Set frameRender Callback function @@ -364,30 +363,48 @@ private: */ void SetFrameRenderCallback(); - /* * @brief resize/move animation finished callback function * * This function is called the resize/move animation is finished, * */ - void OnAnimationFinished( Dali::Animation& animation ); + void OnAnimationFinished(Dali::Animation& animation); -private: + /* + * @brief window's resize callback function + * This function is called when window is resized. + * + * @param[in] winHandle The resized window's handle. + * @param[in] size The window's new size. + */ + void OnWindowResized(Dali::Window winHandle, Dali::Window::WindowSize size); + + /** + * @brief This signal is emitted when an actor's children change their sibling order + * + * @param[in] actor parent actor. + */ + void OnChildOrderChanged(Actor actor); - Dali::VideoPlayer mVideoPlayer; +private: + Dali::VideoPlayer mVideoPlayer; Dali::ImageDimensions mVideoSize; - Dali::Property::Map mPropertyMap; - Dali::Property::Map mEffectPropertyMap; - Dali::Texture mNativeTexture; + Dali::Property::Map mPropertyMap; + Dali::Property::Map mEffectPropertyMap; + Dali::Texture mNativeTexture; + Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal; - std::string mUrl; + + std::string mUrl; Dali::DisplayArea mDisplayArea; - Dali::Renderer mOverlayRenderer; - Dali::Renderer mTextureRenderer; + Dali::Renderer mOverlayRenderer; + Dali::Renderer mTextureRenderer; + Dali::PropertyNotification mPositionUpdateNotification; Dali::PropertyNotification mSizeUpdateNotification; Dali::PropertyNotification mScaleUpdateNotification; + Dali::Property::Map mPropertyBackup; int mCurrentVideoPlayPosition; @@ -397,22 +414,23 @@ private: bool mIsUnderlay; Dali::VideoSyncMode mSyncMode; + int mSiblingOrder; }; } // namespace Internal -inline Toolkit::Internal::VideoView& GetImpl( Toolkit::VideoView& handle ) +inline Toolkit::Internal::VideoView& GetImpl(Toolkit::VideoView& handle) { - DALI_ASSERT_ALWAYS( handle ); + DALI_ASSERT_ALWAYS(handle); Dali::RefObject& impl = handle.GetImplementation(); - return static_cast< Toolkit::Internal::VideoView& >( impl ); + return static_cast(impl); } -inline const Toolkit::Internal::VideoView& GetImpl( const Toolkit::VideoView& handle ) +inline const Toolkit::Internal::VideoView& GetImpl(const Toolkit::VideoView& handle) { - DALI_ASSERT_ALWAYS( handle ); + DALI_ASSERT_ALWAYS(handle); const Dali::RefObject& impl = handle.GetImplementation(); - return static_cast< const Toolkit::Internal::VideoView& >( impl ); + return static_cast(impl); } } // namespace Toolkit