1 #ifndef DALI_VIDEO_PLAYER_IMPL_H
2 #define DALI_VIDEO_PLAYER_IMPL_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/object/base-object.h>
23 #include <dali/devel-api/adaptor-framework/video-sync-mode.h>
26 #include <dali/devel-api/adaptor-framework/video-player.h>
27 #include <dali/devel-api/adaptor-framework/video-player-plugin.h>
41 typedef IntrusivePtr< VideoPlayer > VideoPlayerPtr;
44 * @brief VideoPlayer class is used for video playback.
47 class VideoPlayer: public Dali::BaseObject
52 * @brief Creates a new VideoPlayer handle
54 * @return VideoPlayer pointer
56 static VideoPlayerPtr New();
59 * @copydoc Dali::VideoPlayer::SetUrl()
61 void SetUrl( const std::string& url );
64 * @copydoc Dali::VideoPlayer::GetUrl()
69 * @copydoc Dali::VideoPlayer::SetLooping()
71 void SetLooping(bool looping);
74 * @copydoc Dali::VideoPlayer::IsLooping()
79 * @copydoc Dali::VideoPlayer::Play()
84 * @copydoc Dali::VideoPlayer::Pause()
89 * @copydoc Dali::VideoPlayer::Stop()
94 * @copydoc Dali::VideoPlayer::SetMute()
96 void SetMute( bool mute );
99 * @copydoc Dali::VideoPlayer::IsMuted()
104 * @copydoc Dali::VideoPlayer::SetVolume()
106 void SetVolume( float left, float right );
109 * @copydoc Dali::VideoPlayer::GetVolume()
111 void GetVolume( float& left, float& right );
114 * @copydoc Dali::VideoPlayer::SetRenderingTarget()
116 void SetRenderingTarget( Dali::Any target );
119 * @copydoc Dali::VideoPlayer::SetPlayPosition()
121 void SetPlayPosition( int millisecond );
124 * @copydoc Dali::VideoPlayer::GetPlayPosition()
126 int GetPlayPosition();
129 * @copydoc Dali::VideoPlayer::SetDisplayArea()
131 void SetDisplayArea( DisplayArea area );
134 * @copydoc Dali::VideoPlayer::SetSetDisplayRotation()
136 void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
139 * @copydoc Dali::VideoPlayer::GetDisplayRotation()
141 Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation();
144 * @copydoc Dali::VideoPlayer::FinishedSignal()
146 Dali::VideoPlayerPlugin::VideoPlayerSignalType& FinishedSignal();
149 * @brief Initializes member data.
151 void Initialize( Dali::Actor actor, VideoSyncMode syncMode );
154 * @brief Dali::VideoPlayer::Forward()
156 void Forward( int millisecond );
159 * @brief Dali::VideoPlayer::Backward()
161 void Backward( int millisecond );
164 * @brief Dali::VideoPlayer::IsVideoTextureSupported()
166 bool IsVideoTextureSupported();
169 * @brief Dali::VideoPlayer::SetCodecType()
171 void SetCodecType( Dali::VideoPlayerPlugin::CodecType type );
174 * @brief Dali::VideoPlayer::GetCodecType()
176 Dali::VideoPlayerPlugin::CodecType GetCodecType() const;
179 * @copydoc Dali::VideoPlayer::SetDisplayMode()
181 void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode );
184 * @brief Dali::VideoPlayer::GetDisplayMode()
186 Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const;
189 * @brief Dali::VideoPlayer::GetMediaPlayer()
191 Any GetMediaPlayer();
194 * @brief Dali::VideoPlayer::StartSynchronization()
196 void StartSynchronization();
199 * @copydoc Dali::VideoPlayer::FinishSynchronization()
201 void FinishSynchronization();
206 * @brief Constructor.
215 virtual ~VideoPlayer();
217 // Undefined copy constructor
218 VideoPlayer( const VideoPlayer& player );
220 // Undefined assignment operator
221 VideoPlayer& operator=( const VideoPlayer& player );
225 Dali::VideoPlayerPlugin* mPlugin; ///< Videoplayer plugin handle
226 void* mHandle; ///< Handle for the loaded library
228 typedef Dali::VideoPlayerPlugin* (*CreateVideoPlayerFunction)( Dali::Actor actor, Dali::VideoSyncMode syncMode );
229 typedef void (*DestroyVideoPlayerFunction)( Dali::VideoPlayerPlugin* plugin );
231 CreateVideoPlayerFunction mCreateVideoPlayerPtr;
232 DestroyVideoPlayerFunction mDestroyVideoPlayerPtr;
234 Dali::VideoPlayerPlugin::VideoPlayerSignalType mFinishedSignal;
237 } // namespace Adaptor
238 } // namespace Internal
240 inline static Internal::Adaptor::VideoPlayer& GetImplementation( Dali::VideoPlayer& player )
242 DALI_ASSERT_ALWAYS( player && "VideoPlayer handle is empty." );
244 BaseObject& handle = player.GetBaseObject();
246 return static_cast< Internal::Adaptor::VideoPlayer& >( handle );
249 inline static const Internal::Adaptor::VideoPlayer& GetImplementation( const Dali::VideoPlayer& player )
251 DALI_ASSERT_ALWAYS( player && "VideoPlayer handle is empty." );
253 const BaseObject& handle = player.GetBaseObject();
255 return static_cast< const Internal::Adaptor::VideoPlayer& >( handle );
260 #endif // DALI_VIDEO_PLAYER_IMPL_H