1 #ifndef __DALI_VIDEO_PLAYER_PLUGIN_H__
2 #define __DALI_VIDEO_PLAYER_PLUGIN_H__
5 * Copyright (c) 2016 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/signals/dali-signal.h>
23 #include <dali/public-api/math/rect.h>
29 typedef Dali::Rect< int > DisplayArea;
32 * @brief VideoPlayerPlugin is an abstract interface, used by dali-adaptor to access video player plugin.
33 * A concrete implementation must be created for each platform and provided as dynamic library.
36 class VideoPlayerPlugin
40 typedef Signal< void () > VideoPlayerSignalType;
43 * @brief Video display rotation option
45 * @remarks The option is needed only for window surface rendering target
49 ROTATION_NONE, ///< Display isn't rotated. @SINCE_1_1.38
50 ROTATION_90, ///< Display is rotated 90 degree. @SINCE_1_1.38
51 ROTATION_180, ///< Display is rotated 180 degree. @SINCE_1_1.38
52 ROTATION_270 ///< Display is rotated 270 degree. @SINCE_1_1.38
56 * @brief Enumeration for video codec type
60 DEFAULT, ///< Codec which has higher priority as default. Platform selects it. Usually the H/W codec has higher priority than S/W codec if it exist.
75 virtual ~VideoPlayerPlugin(){}
78 * @brief Sets a URL of the video file to play.
81 * @param [in] url The url of video file
83 virtual void SetUrl( const std::string& url ) = 0;
86 * @brief Returns the URL of the video file.
88 * @return Url of string type
90 virtual std::string GetUrl() = 0;
93 * @brief Sets the player looping status.
96 * @param [in] looping The new looping status: true or false
98 virtual void SetLooping(bool looping) = 0;
101 * @brief Returns the player looping status.
104 * @return True if player is looping, false otherwise.
106 virtual bool IsLooping() = 0;
109 * @brief Starts the video playback.
112 virtual void Play() = 0;
115 * @brief Pauses the video playback.
118 virtual void Pause() = 0;
121 * @brief Stops the video playback.
124 virtual void Stop() = 0;
127 * @brief Sets the player mute status.
129 * @param[in] mute The new mute status, true is mute.
131 virtual void SetMute( bool mute ) = 0;
134 * @brief Returns the player mute status.
136 * @return True if player is mute.
138 virtual bool IsMuted() = 0;
141 * @brief Sets the player volume.
143 * @param[in] left The left volume scalar
144 * @param[in] right The right volume scalar
146 virtual void SetVolume( float left, float right ) = 0;
149 * @brief Gets current volume factor.
151 * @param[out] left The current left volume scalar
152 * @param[out] right The current right volume scalar
154 virtual void GetVolume( float& left, float& right ) = 0;
157 * @brief Sets video rendering target.
159 * @param[in] target The target for video rendering, window surface or native image source
161 virtual void SetRenderingTarget( Any target ) = 0;
164 * @brief Sets the position for playback.
167 * @param[in] millisecond The position for playback
169 virtual void SetPlayPosition( int millisecond ) = 0;
172 * @brief Returns the current position in milliseconds.
175 * @return The current position of playback
177 virtual int GetPlayPosition() = 0;
180 * @brief Sets the area of video display.
182 * param[in] area The left-top position and size of the video display area
184 virtual void SetDisplayArea( DisplayArea area ) = 0;
187 * @brief Sets video display rotation
189 * @param[in] rotation The rotation of display
191 virtual void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation ) = 0;
194 * @brief Returns rotation of current video display
196 * @return The rotation of current display
198 virtual Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation() = 0;
201 * @brief Connect to this signal to be notified when a video playback have finished.
204 * @return A signal object to connect with.
206 virtual VideoPlayerSignalType& FinishedSignal() = 0;
209 * @brief Seeks forward by the specified number of milliseconds.
212 * @param[in] millisecond The position for forward playback
214 virtual void Forward( int millisecond ) = 0;
217 * @brief Seeks backward by the specified number of milliseconds.
220 * @param[in] millisecond The position for backward playback
222 virtual void Backward( int millisecond ) = 0;
225 * @brief Checks whether the video texture is supported
226 * @return True if supported, otherwise false.
228 virtual bool IsVideoTextureSupported() = 0;
231 * @brief Sets codec type
232 * @param[in] type The CodecType
234 virtual void SetCodecType( VideoPlayerPlugin::CodecType type ) = 0;
237 * @brief Gets codec type
240 virtual VideoPlayerPlugin::CodecType GetCodecType() const = 0;