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=7ee0380768f7fc8bdf710bfd6c1fea99875ae49d;hp=309a237036b09aa44143049304160592d9453c78;hb=b1e8521ad77e7b4e62b59613b2edef64429130e9;hpb=f4f74e774495b9c798c86e5697fe84db6decc327 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 100644 new mode 100755 index 309a237..7ee0380 --- a/dali-toolkit/internal/controls/video-view/video-view-impl.h +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_VIDEO_VIEW_H__ -#define __DALI_TOOLKIT_INTERNAL_VIDEO_VIEW_H__ +#ifndef DALI_TOOLKIT_INTERNAL_VIDEO_VIEW_H +#define DALI_TOOLKIT_INTERNAL_VIDEO_VIEW_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -20,11 +20,16 @@ // EXTERNAL INCLUDES #include -#include +#include +#include +#include +#include +#include #include +#include +#include // INTERNAL INCLUDES -#include #include #include @@ -43,16 +48,16 @@ class VideoView: public Control { protected: - VideoView(); + VideoView( Dali::VideoSyncMode syncMode ); virtual ~VideoView(); public: /** - * @copydoc Toolkit::VideoView::New() + * @copydoc Toolkit::DevelVideoView::New() */ - static Toolkit::VideoView New(); + static Toolkit::VideoView New( VideoSyncMode syncMode ); /** * @brief Sets a video url to play. @@ -179,13 +184,12 @@ public: /** * @brief Set the depth index of this image renderer * - * Renderer with higher depth indices are rendered in front of other renderers with smaller values + * Renderer with higher depth indices are rendered in front of other visuals with smaller values * @SINCE_1_1.38 * @param[in] depthIndex The depth index of this renderer */ void SetDepthIndex( int depthIndex ); - /** * @brief Performs actions as requested using the action name. * @SINCE_1_1.38 @@ -196,19 +200,94 @@ public: */ static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes ); + /** + * Connects a callback function with the object's signals. + * @param[in] object The object providing the signal. + * @param[in] tracker Used to disconnect the signal. + * @param[in] signalName The signal to connect to. + * @param[in] functor A newly allocated FunctorDelegate. + * @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 ); + /** + * @brief Updates video display area for window rendering target + */ + void UpdateDisplayArea( Dali::PropertyNotification& source ); + + /** + * @brief Sets underlay flag and initializes new rendering target by flag. + */ + void SetUnderlay( bool set ); + + /** + * @brief Checks underlay flag. + */ + bool IsUnderlay(); + + /** + * @brief Sets sw codec type. + */ + void SetSWCodec( bool on ); + + /** + * @brief Gets play position. + */ + int GetPlayPosition(); + + /** + * @brief Sets play position. + */ + void SetPlayPosition( int pos ); + + /** + * @brief Sets Display mode. + */ + void SetDisplayMode( int mode ); + + /** + * @brief Gets Display mode. + */ + int GetDisplayMode() const; + + /** + * @brief Gets internal media player. + */ + Any GetMediaPlayer(); + + /** + * @brief Play the resize or move animation with synchronization between UI(transparent hole) and video player + * + * The resize and move animation's play() function is called. + * If the animation is played, UI and video player will work synchronization. + * + * @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 /** - * @copydoc Toolkit::Control::OnStageConnect() + * @copydoc Toolkit::Control::OnInitialize() */ - virtual void OnStageConnection( int depth ); + virtual void OnInitialize(); /** - * @copydoc Toolkit::Control::OnStageDisconnection() + * @copydoc Toolkit::Control::OnSceneConnection() */ - virtual void OnStageDisconnection(); + virtual void OnSceneConnection( int depth ); + + /** + * @copydoc Toolkit::Control::OnSceneDisconnection() + */ + virtual void OnSceneDisconnection(); + + /** + * @copydoc Toolkit::Control::OnSizeSet() + */ + virtual void OnSizeSet( const Vector3& targetSize ); /** * @copydoc Toolkit::Control::GetNaturalSize @@ -227,28 +306,97 @@ private: // From Control private: - // Undefined + /** + * @brief Construct a new VideoView. + */ VideoView( const VideoView& videoView ); + // Undefined assignment operator. VideoView& operator=( const VideoView& videoView ); + /** + * @brief SetWindowSurfaceTarget for underlay video playback. + */ void SetWindowSurfaceTarget(); + /** + * @brief SetNativeImageTarget for native image video playback. + */ void SetNativeImageTarget(); + /** + * @brief CreateShader for native image target + */ + Dali::Shader CreateShader(); + + /** + * @brief Checks whether the property has a string value. + * @param Property value + * @param String output + * @return true if the output was found + */ + bool GetStringFromProperty( const Dali::Property::Value& value, std::string& output ); + + /* + * @brief Internal version of SetProperty + */ + void SetPropertyInternal( Property::Index index, const Property::Value& value ); + + /* + * @brief Apply properties after reset video player + */ + void ApplyBackupProperties(); + + /* + * @brief FrameRender's callback function + * + * This function means the resize/move animation is finished, + * so Ui and video player's synchronization can be finished. + * + */ + void FrameRenderCallback( int frameID ); + + /* + * @brief Set frameRender Callback function + * + * This function is added for listenr the resize/move animation is finished, + * + */ + void SetFrameRenderCallback(); + + + /* + * @brief resize/move animation finished callback function + * + * This function is called the resize/move animation is finished, + * + */ + void OnAnimationFinished( Dali::Animation& animation ); + private: Dali::VideoPlayer mVideoPlayer; Dali::ImageDimensions mVideoSize; - Toolkit::ControlRenderer mRenderer; Dali::Property::Map mPropertyMap; - Dali::NativeImage mNativeImage; ///< Native image handle for video rendering by texture streaming + Dali::Property::Map mEffectPropertyMap; + Dali::Texture mNativeTexture; Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal; std::string mUrl; + Dali::DisplayArea mDisplayArea; + Dali::Renderer mOverlayRenderer; + Dali::Renderer mTextureRenderer; + Dali::PropertyNotification mPositionUpdateNotification; + Dali::PropertyNotification mSizeUpdateNotification; + Dali::PropertyNotification mScaleUpdateNotification; + Dali::Property::Map mPropertyBackup; + int mCurrentVideoPlayPosition; - bool mSetRenderingTarget; + int mFrameID; + bool mIsPlay; - bool mIsPause; + bool mIsUnderlay; + + Dali::VideoSyncMode mSyncMode; }; } // namespace Internal @@ -271,4 +419,4 @@ inline const Toolkit::Internal::VideoView& GetImpl( const Toolkit::VideoView& ha } // namespace Dali -#endif // __DALI_TOOLKIT_VIDEO_VIEW_H__ +#endif // DALI_TOOLKIT_VIDEO_VIEW_H