aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/elementary/src/lib/elm_video.h
blob: 018f632459aca8567d5e408dbc6a4c335d448938 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/**
 * @defgroup Video Video
 * @ingroup Elementary
 *
 * @addtogroup Video
 * @{
 *
 * Elementary comes with two object that help design application that need
 * to display video.
 *
 * The first one, Elm_Video, display a video by using Emotion.
 * It embeds the video inside an Edje object, so you can do some
 * animation depending on the video state change. It also implements a
 * resource management policy to remove this burden from the application.
 *
 * The second one,
 * Elm_Player is a video player that need to be linked with an Elm_Video.
 * It take care of updating its content according to Emotion event and provide a
 * way to theme itself. It also automatically raises the priority of the
 * linked Elm_Video so it will use the video decoder, if available. It also
 * activates the "remember" function on the linked Elm_Video object.
 *
 * Signals that you can add callback for are :
 *
 * "forward,clicked" - the user clicked the forward button.
 * "info,clicked" - the user clicked the info button.
 * "next,clicked" - the user clicked the next button.
 * "pause,clicked" - the user clicked the pause button.
 * "play,clicked" - the user clicked the play button.
 * "prev,clicked" - the user clicked the prev button.
 * "rewind,clicked" - the user clicked the rewind button.
 * "stop,clicked" - the user clicked the stop button.
 *
 * Default content parts of the player widget that you can use for are:
 * @li "video" - A video of the player
 *
 */

/**
 * @brief Add a new Elm_Player object to the given parent Elementary (container) object.
 *
 * @param parent The parent object
 * @return a new player widget handle or @c NULL, on errors.
 *
 * This function inserts a new player widget on the canvas.
 *
 * @see elm_object_part_content_set()
 *
 * @ingroup Video
 */
EAPI Evas_Object         *elm_player_add(Evas_Object *parent);

/**
 * @brief Add a new Elm_Video object to the given parent Elementary (container) object.
 *
 * @param parent The parent object
 * @return a new video widget handle or @c NULL, on errors.
 *
 * This function inserts a new video widget on the canvas.
 *
 * @see elm_video_file_set()
 *
 * @ingroup Video
 */
EAPI Evas_Object         *elm_video_add(Evas_Object *parent);

/**
 * @brief Define the file or URI that will be the video source.
 *
 * @param video The video object to define the file or URI for the video
 * of the Elm_Video object.
 *
 * @param filename The file or URI to target.
 * Local files can be specified using file:// or by using full file paths.
 * URI could be remote source of video, like http:// or local source like
 * WebCam (v4l2://). (You can use Emotion API to request and list
 * the available Webcam on your system).
 *
 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
 *
 * This function will explicitly define a file or URI as a source
 * for the video of the Elm_Video object.
 *
 * @see elm_video_add()
 * @see elm_player_add()
 *
 * @ingroup Video
 */
EAPI Eina_Bool            elm_video_file_set(Evas_Object *video, const char *filename);

/**
 * @brief Get the underlying Emotion object.
 *
 * @param video The video object to proceed the request on.
 * @return the underlying Emotion object.
 *
 * @ingroup Video
 */
EAPI Evas_Object         *elm_video_emotion_get(const Evas_Object *video);

/**
 * @brief Start to play the video
 *
 * @param video The video object to proceed the request on.
 *
 * Start to play the video and cancel all suspend state.
 *
 * @ingroup Video
 */
EAPI void                 elm_video_play(Evas_Object *video);

/**
 * @brief Pause the video
 *
 * @param video The video object to proceed the request on.
 *
 * Pause the video and start a timer to trigger suspend mode.
 *
 * @ingroup Video
 */
EAPI void                 elm_video_pause(Evas_Object *video);

/**
 * @brief Stop the video
 *
 * @param video The video object to proceed the request on.
 *
 * Stop the video and put the emotion in deep sleep mode.
 *
 * @ingroup Video
 */
EAPI void                 elm_video_stop(Evas_Object *video);

/**
 * @brief Is the video actually playing.
 *
 * @param video The video object to proceed the request on.
 * @return EINA_TRUE if the video is actually playing.
 *
 * You should consider watching event on the object instead of polling
 * the object state.
 *
 * @ingroup Video
 */
EAPI Eina_Bool            elm_video_is_playing_get(const Evas_Object *video);

/**
 * @brief Is it possible to seek inside the video.
 *
 * @param video The video object to proceed the request on.
 * @return EINA_TRUE if is possible to seek inside the video.
 *
 * @ingroup Video
 */
EAPI Eina_Bool            elm_video_is_seekable_get(const Evas_Object *video);

/**
 * @brief Is the audio muted.
 *
 * @param video The video object to proceed the request on.
 * @return EINA_TRUE if the audio is muted.
 *
 * @ingroup Video
 */
EAPI Eina_Bool            elm_video_audio_mute_get(const Evas_Object *video);

/**
 * @brief Change the mute state of the Elm_Video object.
 *
 * @param video The video object to proceed the request on.
 * @param mute The new mute state.
 *
 * @ingroup Video
 */
EAPI void                 elm_video_audio_mute_set(Evas_Object *video, Eina_Bool mute);

/**
 * @brief Get the audio level of the current video.
 *
 * @param video The video object to proceed the request on.
 * @return the current audio level.
 *
 * @ingroup Video
 */
EAPI double               elm_video_audio_level_get(const Evas_Object *video);

/**
 * @brief Set the audio level of an Elm_Video object.
 *
 * @param video The video object to proceed the request on.
 * @param volume The new audio volume.
 *
 * @ingroup Video
 */
EAPI void                 elm_video_audio_level_set(Evas_Object *video, double volume);

/**
 * @brief Get the current position (in seconds) being played in the
 * Elm_Video object.
 *
 * @param video The video object.
 * @return the time(in seconds) since the beginning of the media file.
 *
 * @ingroup Video
 */
EAPI double               elm_video_play_position_get(const Evas_Object *video);

/**
 * @brief Set the current position (in seconds) to be played in the
 * Elm_Video object.
 *
 * @param video The video object.
 * @param position the time(in seconds) since the beginning of the media file.
 *
 * @ingroup Video
 */
EAPI void                 elm_video_play_position_set(Evas_Object *video, double position);
/**
 * @brief Get the total playing time (in seconds) of the Elm_Video object.
 *
 * @param video The video object.
 * @return the total duration(in seconds) of the media file.
 *
 * @ingroup Video
 */
EAPI double               elm_video_play_length_get(const Evas_Object *video);

/**
 * @brief Set whether the object can remember the last played position.
 *
 * @param video The video object.
 * @param remember the last played position of the Elm_Video object.
 *
 * @note This API only serves as indication. System support is required.
 *
 * @ingroup Video
 */
EAPI void                 elm_video_remember_position_set(Evas_Object *video, Eina_Bool remember);

/**
 * @brief Set whether the object can remember the last played position.
 *
 * @param video The video object.
 * @return whether the object remembers the last played position (EINA_TRUE)
 * or not.
 *
 * @note This API only serves as indication. System support is required.
 *
 * @ingroup Video
 */
EAPI Eina_Bool            elm_video_remember_position_get(const Evas_Object *video);

/**
 * @brief Get the title (for ex. DVD title) from this emotion object.
 *
 * @param video The Elm_Video object.
 * @return A string containing the title.
 *
 * This function is only useful when playing a DVD.
 *
 * @note Don't change or free the string returned by this function.
 *
 * @ingroup Video
 */
EAPI const char          *elm_video_title_get(const Evas_Object *video);
/**
 * @}
 */