2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/devel-api/adaptor-framework/video-player.h>
22 #include <dali/public-api/object/any.h>
25 #include <dali/internal/video/common/video-player-impl.h>
30 VideoPlayer::VideoPlayer()
34 VideoPlayer::VideoPlayer( Internal::Adaptor::VideoPlayer* internal )
35 : BaseHandle( internal )
39 VideoPlayer::~VideoPlayer()
43 VideoPlayer VideoPlayer::New()
45 Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
50 player->Initialize( actor, VideoSyncMode::DISABLED );
53 return VideoPlayer( player.Get() );
56 VideoPlayer VideoPlayer::New( Dali::Actor actor, VideoSyncMode syncMode )
58 Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
62 player->Initialize( actor, syncMode );
65 return VideoPlayer( player.Get() );
68 VideoPlayer::VideoPlayer( const VideoPlayer& player )
69 : BaseHandle( player )
73 VideoPlayer& VideoPlayer::operator=( const VideoPlayer& player )
77 BaseHandle::operator=( player );
82 VideoPlayer VideoPlayer::DownCast( BaseHandle handle )
84 return VideoPlayer( dynamic_cast< Internal::Adaptor::VideoPlayer* >( handle.GetObjectPtr() ) );
87 void VideoPlayer::SetUrl( const std::string& url )
89 GetImplementation( *this ).SetUrl( url );
92 std::string VideoPlayer::GetUrl()
94 return GetImplementation( *this ).GetUrl();
97 void VideoPlayer::SetLooping(bool looping)
99 GetImplementation( *this ).SetLooping( looping );
102 bool VideoPlayer::IsLooping()
104 return GetImplementation( *this ).IsLooping();
107 void VideoPlayer::Play()
109 GetImplementation( *this ).Play();
112 void VideoPlayer::Pause()
114 GetImplementation( *this ).Pause();
117 void VideoPlayer::Stop()
119 GetImplementation( *this ).Stop();
122 void VideoPlayer::SetMute( bool mute )
124 GetImplementation( *this ).SetMute( mute );
127 bool VideoPlayer::IsMuted()
129 return GetImplementation( *this ).IsMuted();
132 void VideoPlayer::SetVolume( float left, float right )
134 GetImplementation( *this ).SetVolume( left, right );
137 void VideoPlayer::GetVolume( float& left, float& right )
139 GetImplementation( *this ).GetVolume( left, right );
142 void VideoPlayer::SetRenderingTarget( Any target )
144 GetImplementation( *this ).SetRenderingTarget( target );
147 void VideoPlayer::SetPlayPosition( int millisecond )
149 GetImplementation( *this ).SetPlayPosition( millisecond );
152 int VideoPlayer::GetPlayPosition()
154 return GetImplementation( *this ).GetPlayPosition();
157 void VideoPlayer::SetDisplayArea( DisplayArea area )
159 GetImplementation( *this ).SetDisplayArea( area );
162 void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
164 GetImplementation( *this ).SetDisplayRotation( rotation );
167 Dali::VideoPlayerPlugin::DisplayRotation VideoPlayer::GetDisplayRotation()
169 return GetImplementation( *this ).GetDisplayRotation();
172 Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal()
174 return GetImplementation( *this ).FinishedSignal();
177 void VideoPlayer::Forward( int millisecond )
179 GetImplementation( *this ).Forward( millisecond );
182 void VideoPlayer::Backward( int millisecond )
184 GetImplementation( *this ).Backward( millisecond );
187 bool VideoPlayer::IsVideoTextureSupported()
189 return GetImplementation( *this ).IsVideoTextureSupported();
192 void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
194 GetImplementation( *this ).SetCodecType( type );
197 Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
199 return GetImplementation( *this ).GetCodecType();
202 void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
204 GetImplementation( *this ).SetDisplayMode( mode );
207 Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
209 return GetImplementation( *this ).GetDisplayMode();
212 Any VideoPlayer::GetMediaPlayer()
214 return GetImplementation( *this ).GetMediaPlayer();
217 void VideoPlayer::StartSynchronization()
219 GetImplementation( *this ).StartSynchronization();
222 void VideoPlayer::FinishSynchronization()
224 GetImplementation( *this ).FinishSynchronization();