Added APIs for setting display mode in video-player
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / video-player.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/devel-api/adaptor-framework/video-player.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/any.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/internal/video/common/video-player-impl.h>
26
27 namespace Dali
28 {
29
30 VideoPlayer::VideoPlayer()
31 {
32 }
33
34 VideoPlayer::VideoPlayer( Internal::Adaptor::VideoPlayer* internal )
35 : BaseHandle( internal )
36 {
37 }
38
39 VideoPlayer::~VideoPlayer()
40 {
41 }
42
43 VideoPlayer VideoPlayer::New()
44 {
45   Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
46
47   if( player )
48   {
49     player->Initialize();
50   }
51
52   return VideoPlayer( player.Get() );
53 }
54
55 VideoPlayer::VideoPlayer( const VideoPlayer& player )
56 : BaseHandle( player )
57 {
58 }
59
60 VideoPlayer& VideoPlayer::operator=( const VideoPlayer& player )
61 {
62   if( *this != player )
63   {
64     BaseHandle::operator=( player );
65   }
66   return *this;
67 }
68
69 VideoPlayer VideoPlayer::DownCast( BaseHandle handle )
70 {
71   return VideoPlayer( dynamic_cast< Internal::Adaptor::VideoPlayer* >( handle.GetObjectPtr() ) );
72 }
73
74 void VideoPlayer::SetUrl( const std::string& url )
75 {
76   GetImplementation( *this ).SetUrl( url );
77 }
78
79 std::string VideoPlayer::GetUrl()
80 {
81   return GetImplementation( *this ).GetUrl();
82 }
83
84 void VideoPlayer::SetLooping(bool looping)
85 {
86   GetImplementation( *this ).SetLooping( looping );
87 }
88
89 bool VideoPlayer::IsLooping()
90 {
91   return GetImplementation( *this ).IsLooping();
92 }
93
94 void VideoPlayer::Play()
95 {
96   GetImplementation( *this ).Play();
97 }
98
99 void VideoPlayer::Pause()
100 {
101   GetImplementation( *this ).Pause();
102 }
103
104 void VideoPlayer::Stop()
105 {
106   GetImplementation( *this ).Stop();
107 }
108
109 void VideoPlayer::SetMute( bool mute )
110 {
111   GetImplementation( *this ).SetMute( mute );
112 }
113
114 bool VideoPlayer::IsMuted()
115 {
116   return GetImplementation( *this ).IsMuted();
117 }
118
119 void VideoPlayer::SetVolume( float left, float right )
120 {
121   GetImplementation( *this ).SetVolume( left, right );
122 }
123
124 void VideoPlayer::GetVolume( float& left, float& right )
125 {
126   GetImplementation( *this ).GetVolume( left, right );
127 }
128
129 void VideoPlayer::SetRenderingTarget( Any target )
130 {
131   GetImplementation( *this ).SetRenderingTarget( target );
132 }
133
134 void VideoPlayer::SetPlayPosition( int millisecond )
135 {
136   GetImplementation( *this ).SetPlayPosition( millisecond );
137 }
138
139 int VideoPlayer::GetPlayPosition()
140 {
141   return GetImplementation( *this ).GetPlayPosition();
142 }
143
144 void VideoPlayer::SetDisplayArea( DisplayArea area )
145 {
146   GetImplementation( *this ).SetDisplayArea( area );
147 }
148
149 void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
150 {
151   GetImplementation( *this ).SetDisplayRotation( rotation );
152 }
153
154 Dali::VideoPlayerPlugin::DisplayRotation VideoPlayer::GetDisplayRotation()
155 {
156   return GetImplementation( *this ).GetDisplayRotation();
157 }
158
159 Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal()
160 {
161   return GetImplementation( *this ).FinishedSignal();
162 }
163
164 void VideoPlayer::Forward( int millisecond )
165 {
166   GetImplementation( *this ).Forward( millisecond );
167 }
168
169 void VideoPlayer::Backward( int millisecond )
170 {
171   GetImplementation( *this ).Backward( millisecond );
172 }
173
174 bool VideoPlayer::IsVideoTextureSupported()
175 {
176   return GetImplementation( *this ).IsVideoTextureSupported();
177 }
178
179 void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
180 {
181   GetImplementation( *this ).SetCodecType( type );
182 }
183
184 Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
185 {
186   return GetImplementation( *this ).GetCodecType();
187 }
188
189 void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
190 {
191   GetImplementation( *this ).SetDisplayMode( mode );
192 }
193
194 Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
195 {
196   return GetImplementation( *this ).GetDisplayMode();
197 }
198
199 } // namespace Dali;
200