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();
52 return VideoPlayer( player.Get() );
55 VideoPlayer::VideoPlayer( const VideoPlayer& player )
56 : BaseHandle( player )
60 VideoPlayer& VideoPlayer::operator=( const VideoPlayer& player )
64 BaseHandle::operator=( player );
69 VideoPlayer VideoPlayer::DownCast( BaseHandle handle )
71 return VideoPlayer( dynamic_cast< Internal::Adaptor::VideoPlayer* >( handle.GetObjectPtr() ) );
74 void VideoPlayer::SetUrl( const std::string& url )
76 GetImplementation( *this ).SetUrl( url );
79 std::string VideoPlayer::GetUrl()
81 return GetImplementation( *this ).GetUrl();
84 void VideoPlayer::SetLooping(bool looping)
86 GetImplementation( *this ).SetLooping( looping );
89 bool VideoPlayer::IsLooping()
91 return GetImplementation( *this ).IsLooping();
94 void VideoPlayer::Play()
96 GetImplementation( *this ).Play();
99 void VideoPlayer::Pause()
101 GetImplementation( *this ).Pause();
104 void VideoPlayer::Stop()
106 GetImplementation( *this ).Stop();
109 void VideoPlayer::SetMute( bool mute )
111 GetImplementation( *this ).SetMute( mute );
114 bool VideoPlayer::IsMuted()
116 return GetImplementation( *this ).IsMuted();
119 void VideoPlayer::SetVolume( float left, float right )
121 GetImplementation( *this ).SetVolume( left, right );
124 void VideoPlayer::GetVolume( float& left, float& right )
126 GetImplementation( *this ).GetVolume( left, right );
129 void VideoPlayer::SetRenderingTarget( Any target )
131 GetImplementation( *this ).SetRenderingTarget( target );
134 void VideoPlayer::SetPlayPosition( int millisecond )
136 GetImplementation( *this ).SetPlayPosition( millisecond );
139 int VideoPlayer::GetPlayPosition()
141 return GetImplementation( *this ).GetPlayPosition();
144 void VideoPlayer::SetDisplayArea( DisplayArea area )
146 GetImplementation( *this ).SetDisplayArea( area );
149 void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
151 GetImplementation( *this ).SetDisplayRotation( rotation );
154 Dali::VideoPlayerPlugin::DisplayRotation VideoPlayer::GetDisplayRotation()
156 return GetImplementation( *this ).GetDisplayRotation();
159 Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal()
161 return GetImplementation( *this ).FinishedSignal();
164 void VideoPlayer::Forward( int millisecond )
166 GetImplementation( *this ).Forward( millisecond );
169 void VideoPlayer::Backward( int millisecond )
171 GetImplementation( *this ).Backward( millisecond );
174 bool VideoPlayer::IsVideoTextureSupported()
176 return GetImplementation( *this ).IsVideoTextureSupported();
179 void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
181 GetImplementation( *this ).SetCodecType( type );
184 Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
186 return GetImplementation( *this ).GetCodecType();
189 void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
191 GetImplementation( *this ).SetDisplayMode( mode );
194 Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
196 return GetImplementation( *this ).GetDisplayMode();