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>
25 #include <dali/devel-api/adaptor-framework/video-player.h>
26 #include <dali/devel-api/adaptor-framework/video-player-plugin.h>
40 typedef IntrusivePtr< VideoPlayer > VideoPlayerPtr;
43 * @brief VideoPlayer class is used for video playback.
46 class VideoPlayer: public Dali::BaseObject
51 * @brief Creates a new VideoPlayer handle
53 * @return VideoPlayer pointer
55 static VideoPlayerPtr New();
58 * @copydoc Dali::VideoPlayer::SetUrl()
60 void SetUrl( const std::string& url );
63 * @copydoc Dali::VideoPlayer::GetUrl()
68 * @copydoc Dali::VideoPlayer::SetLooping()
70 void SetLooping(bool looping);
73 * @copydoc Dali::VideoPlayer::IsLooping()
78 * @copydoc Dali::VideoPlayer::Play()
83 * @copydoc Dali::VideoPlayer::Pause()
88 * @copydoc Dali::VideoPlayer::Stop()
93 * @copydoc Dali::VideoPlayer::SetMute()
95 void SetMute( bool mute );
98 * @copydoc Dali::VideoPlayer::IsMuted()
103 * @copydoc Dali::VideoPlayer::SetVolume()
105 void SetVolume( float left, float right );
108 * @copydoc Dali::VideoPlayer::GetVolume()
110 void GetVolume( float& left, float& right );
113 * @copydoc Dali::VideoPlayer::SetRenderingTarget()
115 void SetRenderingTarget( Dali::Any target );
118 * @copydoc Dali::VideoPlayer::SetPlayPosition()
120 void SetPlayPosition( int millisecond );
123 * @copydoc Dali::VideoPlayer::GetPlayPosition()
125 int GetPlayPosition();
128 * @copydoc Dali::VideoPlayer::SetDisplayArea()
130 void SetDisplayArea( DisplayArea area );
133 * @copydoc Dali::VideoPlayer::SetSetDisplayRotation()
135 void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
138 * @copydoc Dali::VideoPlayer::GetDisplayRotation()
140 Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation();
143 * @copydoc Dali::VideoPlayer::FinishedSignal()
145 Dali::VideoPlayerPlugin::VideoPlayerSignalType& FinishedSignal();
148 * @brief Initializes member data.
153 * @brief Dali::VideoPlayer::Forward()
155 void Forward( int millisecond );
158 * @brief Dali::VideoPlayer::Backward()
160 void Backward( int millisecond );
163 * @brief Dali::VideoPlayer::IsVideoTextureSupported()
165 bool IsVideoTextureSupported();
168 * @brief Dali::VideoPlayer::SetCodecType()
170 void SetCodecType( Dali::VideoPlayerPlugin::CodecType type );
173 * @brief Dali::VideoPlayer::GetCodecType()
175 Dali::VideoPlayerPlugin::CodecType GetCodecType() const;
178 * @copydoc Dali::VideoPlayer::SetDisplayMode()
180 void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode );
183 * @brief Dali::VideoPlayer::GetDisplayMode()
185 Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const;
188 * @brief Dali::VideoPlayer::GetMediaPlayer()
190 Any GetMediaPlayer();
195 * @brief Constructor.
204 virtual ~VideoPlayer();
206 // Undefined copy constructor
207 VideoPlayer( const VideoPlayer& player );
209 // Undefined assignment operator
210 VideoPlayer& operator=( const VideoPlayer& player );
214 Dali::VideoPlayerPlugin* mPlugin; ///< Videoplayer plugin handle
215 void* mHandle; ///< Handle for the loaded library
217 typedef Dali::VideoPlayerPlugin* (*CreateVideoPlayerFunction)();
218 typedef void (*DestroyVideoPlayerFunction)( Dali::VideoPlayerPlugin* plugin );
220 CreateVideoPlayerFunction mCreateVideoPlayerPtr;
221 DestroyVideoPlayerFunction mDestroyVideoPlayerPtr;
223 Dali::VideoPlayerPlugin::VideoPlayerSignalType mFinishedSignal;
226 } // namespace Adaptor
227 } // namespace Internal
229 inline static Internal::Adaptor::VideoPlayer& GetImplementation( Dali::VideoPlayer& player )
231 DALI_ASSERT_ALWAYS( player && "VideoPlayer handle is empty." );
233 BaseObject& handle = player.GetBaseObject();
235 return static_cast< Internal::Adaptor::VideoPlayer& >( handle );
238 inline static const Internal::Adaptor::VideoPlayer& GetImplementation( const Dali::VideoPlayer& player )
240 DALI_ASSERT_ALWAYS( player && "VideoPlayer handle is empty." );
242 const BaseObject& handle = player.GetBaseObject();
244 return static_cast< const Internal::Adaptor::VideoPlayer& >( handle );
249 #endif // DALI_VIDEO_PLAYER_IMPL_H