Merge branch 'devel/master(1.1.39)' into tizen
[platform/core/uifw/dali-adaptor.git] / adaptors / devel-api / adaptor-framework / video-player-plugin.h
1 #ifndef __DALI_VIDEO_PLAYER_PLUGIN_H__
2 #define __DALI_VIDEO_PLAYER_PLUGIN_H__
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/signals/dali-signal.h>
23
24 namespace Dali
25 {
26
27 class Any;
28
29 /**
30  * @brief VideoPlayerPlugin is an abstract interface, used by dali-adaptor to access video player plugin.
31  * A concrete implementation must be created for each platform and provided as dynamic library.
32  * @SINCE_1_1.38
33  */
34 class VideoPlayerPlugin
35 {
36 public:
37
38   typedef Signal< void () > VideoPlayerSignalType;
39
40   /**
41    * @brief Video display rotation option
42    * @SINCE_1_1.38
43    * @remarks The option is needed only for window surface rendering target
44    */
45   enum DisplayRotation
46   {
47     ROTATION_NONE,   ///< Display isn't rotated. @SINCE_1_1.38
48     ROTATION_90,     ///< Display is rotated 90 degree. @SINCE_1_1.38
49     ROTATION_180,    ///< Display is rotated 180 degree. @SINCE_1_1.38
50     ROTATION_270     ///< Display is rotated 270 degree. @SINCE_1_1.38
51   };
52
53   /**
54    * @brief Constructor.
55    * @SINCE_1_1.38
56    */
57   VideoPlayerPlugin(){}
58
59   /**
60    * @brief Destructor.
61    * @SINCE_1_1.38
62    */
63   virtual ~VideoPlayerPlugin(){}
64
65   /**
66    * @brief Sets a URL of the video file to play.
67    *
68    * @SINCE_1_1.38
69    * @param [in] url The url of video file
70    */
71   virtual void SetUrl( const std::string& url ) = 0;
72
73   /**
74    * @brief Returns the URL of the video file.
75    * @SINCE_1_1.38
76    * @return Url of string type
77    */
78   virtual std::string GetUrl() = 0;
79
80   /**
81    * @brief Sets the player looping status.
82    * @SINCE_1_1.38
83    *
84    * @param [in] looping The new looping status: true or false
85    */
86   virtual void SetLooping(bool looping) = 0;
87
88   /**
89    * @brief Returns the player looping status.
90    * @SINCE_1_1.38
91    *
92    * @return True if player is looping, false otherwise.
93    */
94   virtual bool IsLooping() = 0;
95
96   /**
97    * @brief Starts the video playback.
98    * @SINCE_1_1.38
99    */
100   virtual void Play() = 0;
101
102   /**
103    * @brief Pauses the video playback.
104    * @SINCE_1_1.38
105    */
106   virtual void Pause() = 0;
107
108   /**
109    * @brief Stops the video playback.
110    * @SINCE_1_1.38
111    */
112   virtual void Stop() = 0;
113
114   /**
115    * @brief Sets the player mute status.
116    * @SINCE_1_1.38
117    * @param[in] mute The new mute status, true is mute.
118    */
119   virtual void SetMute( bool mute ) = 0;
120
121   /**
122    * @brief Returns the player mute status.
123    * @SINCE_1_1.38
124    * @return True if player is mute.
125    */
126   virtual bool IsMuted() = 0;
127
128   /**
129    * @brief Sets the player volume.
130    * @SINCE_1_1.38
131    * @param[in] left The left volume scalar
132    * @param[in] right The right volume scalar
133    */
134   virtual void SetVolume( float left, float right ) = 0;
135
136   /**
137    * @brief Gets current volume factor.
138    * @SINCE_1_1.38
139    * @param[out] left The current left volume scalar
140    * @param[out] right The current right volume scalar
141    */
142   virtual void GetVolume( float& left, float& right ) = 0;
143
144   /**
145    * @brief Sets video rendering target.
146    * @SINCE_1_1.38
147    * @param[in] target The target for video rendering, window surface or native image source
148    */
149   virtual void SetRenderingTarget( Any target ) = 0;
150
151   /**
152    * @brief Sets the position for playback.
153    * @SINCE_1_1.38
154    *
155    * @param[in] millisecond The position for playback
156    */
157   virtual void SetPlayPosition( int millisecond ) = 0;
158
159   /**
160    * @brief Returns the current position in milliseconds.
161    * @SINCE_1_1.38
162    *
163    * @return The current position of playback
164    */
165   virtual int GetPlayPosition() = 0;
166
167   /**
168    * @brief Sets video display rotation
169    * @SINCE_1_1.38
170    * @param[in] rotation The rotation of display
171    */
172   virtual void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation ) = 0;
173
174   /**
175    * @brief Returns rotation of current video display
176    * @SINCE_1_1.38
177    * @return The rotation of current display
178    */
179   virtual Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation() = 0;
180
181   /**
182    * @brief Connect to this signal to be notified when a video playback have finished.
183    *
184    * @SINCE_1_1.38
185    * @return A signal object to connect with.
186    */
187   virtual VideoPlayerSignalType& FinishedSignal() = 0;
188
189 };
190
191 } // namespace Dali;
192
193 #endif