[ACR-1075] Add new APIs to set buffering size
[platform/core/api/player.git] / include / player.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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 #ifndef __TIZEN_MEDIA_PLAYER_H__
18 #define __TIZEN_MEDIA_PLAYER_H__
19
20 #include <tizen.h>
21 #include <sound_manager.h>
22 #include <media_packet.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #define PLAYER_ERROR_CLASS          TIZEN_ERROR_PLAYER | 0x20
29
30 /* This is for custom defined player error. */
31 #define PLAYER_CUSTOM_ERROR_CLASS   TIZEN_ERROR_PLAYER | 0x1000
32
33 /**
34  * @file player.h
35  * @brief This file contains the media player API.
36  */
37
38 /**
39  * @addtogroup CAPI_MEDIA_PLAYER_MODULE
40  * @{
41  */
42
43 /**
44  * @brief The media player's type handle.
45  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
46  */
47 typedef struct player_s *player_h;
48
49 /**
50  * @brief Enumeration for media player state.
51  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
52  */
53 typedef enum {
54         PLAYER_STATE_NONE,          /**< Player is not created */
55         PLAYER_STATE_IDLE,          /**< Player is created, but not prepared */
56         PLAYER_STATE_READY,         /**< Player is ready to play media */
57         PLAYER_STATE_PLAYING,       /**< Player is playing media */
58         PLAYER_STATE_PAUSED,        /**< Player is paused while playing media */
59 } player_state_e;
60
61 /**
62  * @brief Enumeration for media player's error codes.
63  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
64  */
65 typedef enum {
66         PLAYER_ERROR_NONE               = TIZEN_ERROR_NONE,                             /**< Successful */
67         PLAYER_ERROR_OUT_OF_MEMORY      = TIZEN_ERROR_OUT_OF_MEMORY,                    /**< Out of memory */
68         PLAYER_ERROR_INVALID_PARAMETER  = TIZEN_ERROR_INVALID_PARAMETER,                /**< Invalid parameter */
69         PLAYER_ERROR_NO_SUCH_FILE       = TIZEN_ERROR_NO_SUCH_FILE,                     /**< No such file or directory */
70         PLAYER_ERROR_INVALID_OPERATION  = TIZEN_ERROR_INVALID_OPERATION,                /**< Invalid operation */
71         PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE    = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE,  /**< No space left on the device */
72         PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE    = TIZEN_ERROR_NOT_SUPPORTED,    /**< Not supported Feature */
73         PLAYER_ERROR_SEEK_FAILED        = PLAYER_ERROR_CLASS | 0x01,                    /**< Seek operation failure */
74         PLAYER_ERROR_INVALID_STATE      = PLAYER_ERROR_CLASS | 0x02,                    /**< Invalid state */
75         PLAYER_ERROR_NOT_SUPPORTED_FILE = PLAYER_ERROR_CLASS | 0x03,                    /**< File format not supported */
76         PLAYER_ERROR_INVALID_URI        = PLAYER_ERROR_CLASS | 0x04,                    /**< Invalid URI */
77         PLAYER_ERROR_SOUND_POLICY       = PLAYER_ERROR_CLASS | 0x05,                    /**< Sound policy error */
78         PLAYER_ERROR_CONNECTION_FAILED  = PLAYER_ERROR_CLASS | 0x06,                    /**< Streaming connection failed */
79         PLAYER_ERROR_VIDEO_CAPTURE_FAILED   = PLAYER_ERROR_CLASS | 0x07,                /**< Video capture failed */
80         PLAYER_ERROR_DRM_EXPIRED        = PLAYER_ERROR_CLASS | 0x08,                    /**< Expired license */
81         PLAYER_ERROR_DRM_NO_LICENSE     = PLAYER_ERROR_CLASS | 0x09,                    /**< No license */
82         PLAYER_ERROR_DRM_FUTURE_USE     = PLAYER_ERROR_CLASS | 0x0a,                    /**< License for future use */
83         PLAYER_ERROR_DRM_NOT_PERMITTED  = PLAYER_ERROR_CLASS | 0x0b,                    /**< Format not permitted */
84         PLAYER_ERROR_RESOURCE_LIMIT     = PLAYER_ERROR_CLASS | 0x0c,                    /**< Resource limit */
85         PLAYER_ERROR_PERMISSION_DENIED  = TIZEN_ERROR_PERMISSION_DENIED,                /**< Permission denied */
86         PLAYER_ERROR_SERVICE_DISCONNECTED = PLAYER_ERROR_CLASS | 0x0d,                  /**< Socket connection lost (Since 3.0) */
87         PLAYER_ERROR_BUFFER_SPACE         = TIZEN_ERROR_BUFFER_SPACE,                   /**< No buffer space available (Since 3.0) */
88         PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC = PLAYER_ERROR_CLASS | 0x0e,             /**< Not supported audio codec but video can be played (Since 4.0) */
89         PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC = PLAYER_ERROR_CLASS | 0x0f,             /**< Not supported video codec but audio can be played (Since 4.0) */
90         PLAYER_ERROR_NOT_SUPPORTED_SUBTITLE = PLAYER_ERROR_CLASS | 0x10,                /**< Not supported subtitle format (Since 4.0) */
91 } player_error_e;
92
93 /**
94  * @brief Enumeration for media player's interruption type.
95  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
96  */
97 typedef enum {
98         PLAYER_INTERRUPTED_COMPLETED = 0,           /**< Interrupt completed (Deprecated since 3.0)*/
99         PLAYER_INTERRUPTED_BY_MEDIA,                /**< Interrupted by a non-resumable media application (Deprecated since 3.0)*/
100         PLAYER_INTERRUPTED_BY_CALL,                 /**< Interrupted by an incoming call (Deprecated since 3.0)*/
101         PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG,       /**< Interrupted by unplugging headphones (Deprecated since 3.0)*/
102         PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT,    /**< Interrupted by a resource conflict and the player handle will be unprepared */
103         PLAYER_INTERRUPTED_BY_ALARM,                /**< Interrupted by an alarm (Deprecated since 3.0)*/
104         PLAYER_INTERRUPTED_BY_EMERGENCY,            /**< Interrupted by an emergency (Deprecated since 3.0)*/
105         PLAYER_INTERRUPTED_BY_NOTIFICATION,         /**< Interrupted by a notification (Deprecated since 3.0)*/
106 } player_interrupted_code_e;
107
108 /**
109  * @brief Enumeration for progressive download message type.
110  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
111  */
112 typedef enum {
113         PLAYER_PD_STARTED = 0,              /**< Progressive download is started */
114         PLAYER_PD_COMPLETED,                /**< Progressive download is completed */
115 } player_pd_message_type_e;
116
117 /**
118  * @brief Enumeration for display type.
119  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
120  */
121 typedef enum {
122         PLAYER_DISPLAY_TYPE_OVERLAY = 0,        /**< Overlay surface display */
123         PLAYER_DISPLAY_TYPE_OBSOLETE_EVAS_WNONE = 1,
124                         /**< Obsolete. Acts as #PLAYER_DISPLAY_TYPE_NONE on Wearable,
125                                 #PLAYER_DISPLAY_TYPE_EVAS in all other cases.
126                                 This symbol was added for backward compatibility reasons.
127                                 It should not be used. (Deprecated since 4.0) */
128
129         PLAYER_DISPLAY_TYPE_OBSOLETE_NONE_WEVAS = 2,
130                         /**< Obsolete. Acts as #PLAYER_DISPLAY_TYPE_EVAS on Wearable 3.0 and later,
131                                 #PLAYER_DISPLAY_TYPE_NONE in all other cases.
132                                 This symbol was added for backward compatibility reasons.
133                                 It should not be used. (Deprecated since 4.0) */
134
135         PLAYER_DISPLAY_TYPE_EVAS = 3,           /**< Evas image object surface display (Since 4.0) */
136         PLAYER_DISPLAY_TYPE_NONE = 4,           /**< This disposes of buffers (Since 4.0) */
137 } player_display_type_e;
138
139 /**
140  * @brief Enumeration for audio latency mode.
141  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
142  */
143 typedef enum {
144         AUDIO_LATENCY_MODE_LOW = 0,     /**< Low audio latency mode */
145         AUDIO_LATENCY_MODE_MID,         /**< Middle audio latency mode */
146         AUDIO_LATENCY_MODE_HIGH,        /**< High audio latency mode */
147 } audio_latency_mode_e;
148
149 /**
150  * @brief Enumeration for stream type.
151  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
152  */
153 typedef enum {
154         PLAYER_STREAM_TYPE_DEFAULT,     /**< Container type */
155         PLAYER_STREAM_TYPE_AUDIO,       /**< Audio element stream type */
156         PLAYER_STREAM_TYPE_VIDEO,       /**< Video element stream type */
157         PLAYER_STREAM_TYPE_TEXT,        /**< Text type */
158 } player_stream_type_e;
159
160 /**
161  * @brief Enumeration of media stream buffer status
162  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
163  */
164 typedef enum {
165         PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
166         PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
167 } player_media_stream_buffer_status_e;
168
169 /**
170  * @brief The player display handle.
171  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
172  */
173 typedef void* player_display_h;
174
175 #ifndef GET_DISPLAY
176 /**
177  * @brief Definition for a display handle from evas object.
178  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
179  */
180 #define GET_DISPLAY(x) (void*)(x)
181 #endif
182
183 /**
184  * @}
185  */
186
187 /**
188  * @addtogroup CAPI_MEDIA_PLAYER_DISPLAY_MODULE
189  * @{
190  */
191
192 /**
193  * @brief Enumeration for display rotation type.
194  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
195  */
196 typedef enum {
197         PLAYER_DISPLAY_ROTATION_NONE,   /**< Display is not rotated */
198         PLAYER_DISPLAY_ROTATION_90,     /**< Display is rotated 90 degrees */
199         PLAYER_DISPLAY_ROTATION_180,    /**< Display is rotated 180 degrees */
200         PLAYER_DISPLAY_ROTATION_270,    /**< Display is rotated 270 degrees */
201 } player_display_rotation_e;
202
203 /**
204  * @brief Enumeration for display mode.
205  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
206  */
207 typedef enum {
208         PLAYER_DISPLAY_MODE_LETTER_BOX = 0,     /**< Letter box */
209         PLAYER_DISPLAY_MODE_ORIGIN_SIZE,        /**< Origin size */
210         PLAYER_DISPLAY_MODE_FULL_SCREEN,        /**< Full-screen */
211         PLAYER_DISPLAY_MODE_CROPPED_FULL,       /**< Cropped full-screen */
212         PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER,   /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
213         PLAYER_DISPLAY_MODE_DST_ROI,            /**< Dst ROI mode */
214         PLAYER_DISPLAY_MODE_NUM
215 } player_display_mode_e;
216
217 /**
218  * @}
219  */
220
221 /**
222  * @addtogroup CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE
223  * @{
224  */
225
226 /**
227  * @brief Enumeration for media stream content information.
228  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
229  */
230 typedef enum {
231         PLAYER_CONTENT_INFO_ALBUM,      /**< Album */
232         PLAYER_CONTENT_INFO_ARTIST,     /**< Artist */
233         PLAYER_CONTENT_INFO_AUTHOR,     /**< Author */
234         PLAYER_CONTENT_INFO_GENRE,      /**< Genre */
235         PLAYER_CONTENT_INFO_TITLE,      /**< Title */
236         PLAYER_CONTENT_INFO_YEAR,       /**< Year */
237 } player_content_info_e;
238
239 /**
240  * @}
241  */
242
243
244 /**
245  * @addtogroup CAPI_MEDIA_PLAYER_SUBTITLE_MODULE
246  * @{
247  */
248
249 /**
250  * @brief  Called when the subtitle is updated.
251  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
252  * @param[in]   duration        The duration of the updated subtitle
253  * @param[in]   text            The text of the updated subtitle
254  * @param[in]   user_data       The user data passed from the callback registration function
255  * @see player_set_subtitle_updated_cb()
256  * @see player_unset_subtitle_updated_cb()
257  */
258 typedef void (*player_subtitle_updated_cb)(unsigned long duration, char *text, void *user_data);
259
260 /**
261  * @}
262  */
263
264 /**
265  * @addtogroup CAPI_MEDIA_PLAYER_MODULE
266  * @{
267  */
268
269 /**
270  * @brief Called when the media player is prepared.
271  * @details It will be invoked when player has reached the begin of stream.
272  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
273  * @param[in]   user_data  The user data passed from the callback registration function
274  * @pre player_prepare_async() will cause this callback.
275  * @post The player state will be #PLAYER_STATE_READY.
276  * @see player_prepare_async()
277  */
278 typedef void (*player_prepared_cb)(void *user_data);
279
280 /**
281  * @brief Called when the media player is completed.
282  * @details It will be invoked when player has reached the end of the stream.
283  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
284  * @param[in]   user_data  The user data passed from the callback registration function
285  * @pre It will be invoked when the playback is completed if you register this callback using player_set_completed_cb().
286  * @see player_set_completed_cb()
287  * @see player_unset_completed_cb()
288  */
289 typedef void (*player_completed_cb)(void *user_data);
290
291 /**
292  * @brief Called when the seek operation is completed.
293  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
294  * @param[in]   user_data  The user data passed from the callback registration function
295  * @see player_set_play_position()
296  */
297 typedef void (*player_seek_completed_cb)(void *user_data);
298
299 /**
300  * @brief Called when the media player is interrupted.
301  * @details If the code is #PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, the player handle will be unprepared.
302  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
303  * @param[in] code        The interrupted error code
304  * @param[in] user_data   The user data passed from the callback registration function
305  * @see player_set_interrupted_cb()
306  * @see player_unset_interrupted_cb()
307  */
308 typedef void (*player_interrupted_cb)(player_interrupted_code_e code, void *user_data);
309
310 /**
311  * @brief Called when an error occurs in the media player.
312  * @details Following error codes can be delivered.
313  *          #PLAYER_ERROR_INVALID_OPERATION
314  *          #PLAYER_ERROR_INVALID_STATE
315  *          #PLAYER_ERROR_INVALID_URI
316  *          #PLAYER_ERROR_CONNECTION_FAILED
317  *          #PLAYER_ERROR_DRM_NOT_PERMITTED
318  *          #PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE
319  *          #PLAYER_ERROR_NOT_SUPPORTED_FILE
320  *          #PLAYER_ERROR_SEEK_FAILED
321  *          #PLAYER_ERROR_SERVICE_DISCONNECTED
322  *          #PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC (Since 4.0)
323  *          #PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC (Since 4.0)
324  *          #PLAYER_ERROR_NOT_SUPPORTED_SUBTITLE (Since 4.0)
325  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
326  * @param[in]   error_code  The error code
327  * @param[in]   user_data       The user data passed from the callback registration function
328  * @see player_set_error_cb()
329  * @see player_unset_error_cb()
330  */
331 typedef void (*player_error_cb)(int error_code, void *user_data);
332
333 /**
334  * @brief Called when the buffering percentage of the media playback is updated.
335  * @details If the buffer is full, it will return 100%.
336  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
337  * @param[in]   percent The percentage of buffering completed (0~100)
338  * @param[in]   user_data       The user data passed from the callback registration function
339  * @see player_set_buffering_cb()
340  * @see player_unset_buffering_cb()
341  */
342 typedef void (*player_buffering_cb)(int percent, void *user_data);
343
344 /**
345  * @brief Called when progressive download is started or completed.
346  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
347  * @param[in]   type            The message type for progressive download
348  * @param[in]   user_data       The user data passed from the callback registration function
349  * @see player_set_progressive_download_path()
350  */
351 typedef void (*player_pd_message_cb)(player_pd_message_type_e type, void *user_data);
352
353 /**
354  * @brief Called when the video is captured.
355  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
356  * @remarks The color space format of the captured image is IMAGE_UTIL_COLORSPACE_RGB888.
357  * @param[in]   data    The captured image buffer
358  * @param[in]   width   The width of the captured image
359  * @param[in]   height  The height of the captured image
360  * @param[in]   size    The size of the captured image
361  * @param[in]   user_data       The user data passed from the callback registration function
362  * @see player_capture_video()
363  */
364 typedef void (*player_video_captured_cb)(unsigned char *data, int width, int height, unsigned int size, void *user_data);
365
366 /**
367  * @brief Called to register for notifications about delivering media packet when every video frame is decoded.
368  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
369  *
370  * @remarks This function is called in the context of gstreamer so the UI update code must not be directly invoked.\n
371  *          The packet must be released after use by calling media_packet_destroy(). \n
372  *          If not, the decoder will fail due to having insufficient buffer space for the decoded frame.
373  *
374  * @param[in] pkt Reference pointer to the media packet
375  * @param[in] user_data The user data passed from the callback registration function
376  */
377 typedef void (*player_media_packet_video_decoded_cb)(media_packet_h pkt, void *user_data);
378
379 /**
380  * @brief Called when the buffer level drops below the threshold of max size or no free space in buffer.
381  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
382  * @remarks This API is used for media stream playback only.
383  * @param[in] status The buffer status
384  * @param[in] user_data The user data passed from the callback registration function
385  * @see player_set_media_stream_buffer_status_cb()
386  * @see player_set_media_stream_buffer_max_size()
387  * @see player_set_media_stream_buffer_min_threshold()
388  */
389 typedef void (*player_media_stream_buffer_status_cb) (player_media_stream_buffer_status_e status, void *user_data);
390
391 /**
392  * @brief Called to notify the next push-buffer offset when seeking is occurred.
393  * @details The next push-buffer should produce buffers from the new offset.
394  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
395  * @remarks This API is used for media stream playback only.
396  * @param[in] offset The new byte position to seek
397  * @param[in] user_data The user data passed from the callback registration function
398  */
399 typedef void (*player_media_stream_seek_cb) (unsigned long long offset, void *user_data);
400
401 /**
402  * @brief Called to notify the video stream changed.
403  * @details The video stream changing is detected just before rendering operation.
404  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
405  * @param[in] width     The width of the captured image
406  * @param[in] height The height of the captured image
407  * @param[in] fps The frame per second of the video \n
408  *            It can be @c 0 if there is no video stream information.
409  * @param[in] bit_rate The video bit rate [Hz] \n
410  *            It can be an invalid value if there is no video stream information.
411  * @param[in] user_data The user data passed from the callback registration function
412  * @see player_set_video_stream_changed_cb()
413  */
414 typedef void (*player_video_stream_changed_cb) (int width, int height, int fps, int bit_rate, void *user_data);
415
416 /**
417  * @brief Called to notify the streaming variant information.
418  * @details The adaptive streaming protocol(hls, mpeg dash) can support variant stream condition.
419  *          All the streaming variant information can be shared by calling player_foreach_adaptive_variant().
420  * @since_tizen 4.0
421  * @param[in] bandwidth The bandwidth of the stream can be supportable, this is mandatory parameter
422  * @param[in] width The width of the stream, this is optional parameter
423  * @param[in] height The height of the stream, this is optional parameter
424  * @param[in] user_data The user data passed from the callback registration function
425  * @see player_foreach_adaptive_variant()
426  */
427 typedef void (*player_adaptive_variant_cb) (int bandwidth, int width, int height, void *user_data);
428
429 /**
430  * @brief Creates a player handle for playing multimedia content.
431  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
432  * @remarks You must release @a player by using player_destroy().\n
433  *          Although you can create multiple player handles at the same time,
434  *          the player cannot guarantee proper operation because of limited resources, such as
435  *          audio or display device.
436  *
437  * @param[out]  player  A new handle to the media player
438  * @return @c 0 on success,
439  *         otherwise a negative error value
440  * @retval #PLAYER_ERROR_NONE Successful
441  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
442  * @retval #PLAYER_ERROR_OUT_OF_MEMORY Out of memory
443  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
444  * @retval #PLAYER_ERROR_RESOURCE_LIMIT Cannot create more instance due to resource(socket, thread, etc) limitation on system.
445  * @post The player state will be #PLAYER_STATE_IDLE.
446  * @see player_destroy()
447  */
448 int player_create(player_h *player);
449
450 /**
451  * @brief Destroys the media player handle and releases all its resources.
452  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
453  * @remarks To completely shutdown player operation, call this function with a valid player handle from any player state.
454  * @param[in] player The handle to the media player to be destroyed
455  * @return @c 0 on success,
456  *         otherwise a negative error value
457  * @retval #PLAYER_ERROR_NONE Successful
458  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
459  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
460  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
461  * @post The player state will be #PLAYER_STATE_NONE.
462  * @see player_create()
463  */
464 int player_destroy(player_h player);
465
466 /**
467  * @brief Prepares the media player for playback.
468  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
469  * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any video/audio files are used to play located in the internal storage.
470  * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any video/audio files are used to play located in the external storage.
471  * @remarks The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from network.
472  * @param[in]   player The handle to the media player
473  * @return @c 0 on success,
474  *         otherwise a negative error value
475  * @retval #PLAYER_ERROR_NONE Successful
476  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
477  * @retval #PLAYER_ERROR_INVALID_URI Invalid URI
478  * @retval #PLAYER_ERROR_NO_SUCH_FILE File not found
479  * @retval #PLAYER_ERROR_NOT_SUPPORTED_FILE File not supported
480  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
481  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
482  * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied
483  * @retval #PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC Not support audio codec format (Since 4.0)
484  * @retval #PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC Not support video codec format (Since 4.0)
485  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play.
486  * @post The player state will be #PLAYER_STATE_READY.
487  * @see player_prepare_async()
488  * @see player_unprepare()
489  * @see player_set_uri()
490  */
491 int player_prepare(player_h player);
492
493 /**
494  * @brief Prepares the media player for playback, asynchronously.
495  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
496  * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any video/audio files are used to play located in the internal storage.
497  * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any video/audio files are used to play located in the external storage.
498  * @remarks The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from network.
499  * @param[in] player The handle to the media player
500  * @param[in] callback  The callback function to register
501  * @param[in] user_data The user data to be passed to the callback function
502  * @return @c 0 on success,
503  *         otherwise a negative error value
504  * @retval #PLAYER_ERROR_NONE Successful
505  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
506  * @retval #PLAYER_ERROR_INVALID_URI Invalid URI
507  * @retval #PLAYER_ERROR_NO_SUCH_FILE File not found
508  * @retval #PLAYER_ERROR_NOT_SUPPORTED_FILE File not supported
509  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
510  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
511  * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied
512  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play.
513  * @post It invokes player_prepared_cb() when playback is prepared.
514  * @see player_prepare()
515  * @see player_prepared_cb()
516  * @see player_unprepare()
517  * @see player_set_uri()
518  */
519 int player_prepare_async(player_h player, player_prepared_cb callback, void* user_data);
520
521 /**
522  * @brief Resets the media player.
523  * @details The most recently used media is reset and no longer associated with the player.
524  *          Playback is no longer possible. If you want to use the player again, you must set the data URI and call
525  *          player_prepare() again.
526  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
527  * @param[in] player The handle to the media player
528  * @return @c 0 on success,
529  *         otherwise a negative error value
530  * @retval #PLAYER_ERROR_NONE Successful
531  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
532  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
533  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
534  * @pre The player state must be higher than #PLAYER_STATE_IDLE.
535  * @post The player state will be #PLAYER_STATE_IDLE.
536  * @see player_prepare()
537  */
538 int player_unprepare(player_h player);
539
540 /**
541  * @brief Sets the data source (file-path, HTTP or RTSP URI) to use.
542  *
543  * @details Associates media contents, referred to by the URI, with the player.
544  *          If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media.
545  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
546  * @remarks If you use HTTP or RTSP, URI must start with "http://" or "rtsp://". The default protocol is "file://".
547  *          If you provide an invalid URI, you won't receive an error message until you call player_start().
548  * @remarks This API must be called before calling the player_prepare() or player_prepare_async() to build the player based on the uri information.
549  * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any video/audio files are used to play located in the internal storage.
550  * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any video/audio files are used to play located in the external storage.
551  * @remarks The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from network.
552  *
553  * @param[in]   player The handle to the media player
554  * @param[in]   uri The content location, such as the file path, the URI of the HTTP or RTSP stream you want to play
555  *
556  * @return @c 0 on success,
557  *         otherwise a negative error value
558  * @retval #PLAYER_ERROR_NONE Successful
559  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
560  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
561  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
562  * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied
563  * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
564  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
565  * @see player_set_memory_buffer()
566  */
567 int player_set_uri(player_h player, const char * uri);
568
569 /**
570  * @brief Sets memory as the data source.
571  *
572  * @details Associates media content, cached in memory, with the player. Unlike the case of player_set_uri(), the media resides in memory.
573  *          If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media.
574  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
575  * @remarks If you provide an invalid data, you won't receive an error message until you call player_start().
576  * @remarks This API must be called before calling the player_prepare() or player_prepare_async()
577  *          to build the player based on the data.
578  *
579  * @param[in]   player The handle to the media player
580  * @param[in]   data The memory pointer of media data
581  * @param[in]   size The size of media data
582  * @return @c 0 on success,
583  *         otherwise a negative error value
584  * @retval #PLAYER_ERROR_NONE Successful
585  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
586  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
587  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
588  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
589  * @see player_set_uri()
590  */
591 int player_set_memory_buffer(player_h player, const void * data, int size);
592
593 /**
594  * @brief Gets the player's current state.
595  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
596  * @param[in]   player  The handle to the media player
597  * @param[out]  state   The current state of the player
598  * @return @c 0 on success,
599  *         otherwise a negative error value
600  * @retval #PLAYER_ERROR_NONE Successful
601  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
602  * @see #player_state_e
603  */
604 int player_get_state(player_h player, player_state_e *state);
605
606 /**
607  * @brief Sets the player's volume.
608  * @details  Setting this volume adjusts the player's instance volume, not the system volume.
609  *           The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0.
610  *           To change system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
611  *           Finally, it does not support to set other value into each channel currently.
612  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
613  * @param[in]   player The handle to the media player
614  * @param[in]   left The left volume scalar
615  * @param[in]   right The right volume scalar
616  * @return @c 0 on success,
617  *         otherwise a negative error value
618  * @retval #PLAYER_ERROR_NONE Successful
619  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
620  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
621  * @see player_get_volume()
622  */
623 int player_set_volume(player_h player, float left, float right);
624
625 /**
626  * @brief Gets the player's current volume factor.
627  * @details The range of @a left and @a right is from @c 0 to @c 1.0, inclusive (1.0 = 100%).
628  *          This function gets the player volume, not the system volume.
629  *          To get the system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
630  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
631  * @param[in]   player The handle to the media player
632  * @param[out]  left The current left volume scalar
633  * @param[out]  right The current right volume scalar
634  * @return @c 0 on success,
635  *         otherwise a negative error value
636  * @retval #PLAYER_ERROR_NONE Successful
637  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
638  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
639  * @see player_set_volume()
640  */
641 int player_get_volume(player_h player, float *left, float *right);
642
643 /**
644  * @deprecated Deprecated since 3.0. Use player_set_sound_stream_info() instead.
645  * @brief Sets the player's volume type.
646  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
647  * @remarks The default sound type of the player is #SOUND_TYPE_MEDIA.
648  *          To get the current sound type, use sound_manager_get_current_sound_type().
649  * @remarks If stream_info already exists by calling sound_manager_create_stream_info(),
650  *          It will return error since 3.0.
651  *
652  * @param[in]   player The handle to the media player
653  * @param[in]   type The sound type
654  * @return @c 0 on success,
655  *         otherwise a negative error value
656  * @retval #PLAYER_ERROR_NONE Successful
657  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
658  * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error
659  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create().
660  * @see sound_manager_get_current_sound_type()
661  */
662 int player_set_sound_type(player_h player, sound_type_e type) TIZEN_DEPRECATED_API;
663
664 /**
665  * @brief Sets the player's sound manager stream information.
666  * @since_tizen 3.0
667  * @remarks You can set sound stream information including audio routing and volume type.
668  *          For more details, please refer to sound_manager.h
669  * @remarks This API must be called before calling the player_prepare() or player_prepare_async()
670  *          to reflect the sound stream information when the player is building.
671  *
672  * @param[in] player The handle to the media player
673  * @param[in] stream_info The sound manager info type
674  * @return @c 0 on success,
675  *         otherwise a negative error value
676  * @retval #PLAYER_ERROR_NONE Successful
677  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
678  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
679  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
680  * @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature
681  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create().
682  * @see #sound_stream_info_h
683  * @see sound_manager_create_stream_information()
684  * @see sound_manager_destroy_stream_information()
685  * @par Example
686    @code
687        #include <player.h>
688        #include <sound_manager.h>
689        ...
690        player_h player = NULL;
691        sound_stream_info_h stream_info = NULL;
692        sound_stream_type_e stream_type = SOUND_STREAM_TYPE_MEDIA;
693        ...
694        sound_manager_create_stream_information (stream_type, _focus_callback, use_data, &stream_info);
695        player_create (&player);
696        player_set_sound_stream_info (player, stream_info);
697        ...
698        player_prepare_async (player, _prepared_cb, udata);
699        ...
700    @endcode
701  */
702 int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_info);
703
704 /**
705  * @brief Sets the audio latency mode.
706  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
707  * @remarks The default audio latency mode of the player is #AUDIO_LATENCY_MODE_MID.
708  *              To get the current audio latency mode, use player_get_audio_latency_mode().
709  *              If it's high mode, audio output interval can be increased so, it can keep more audio data to play.
710  *              But, state transition like pause or resume can be more slower than default(mid) mode.
711  *
712  * @param[in] player The handle to the media player
713  * @param[in] latency_mode The latency mode to be applied to the audio
714  * @return @c 0 on success,
715  *         otherwise a negative error value
716  * @retval #PLAYER_ERROR_NONE Successful
717  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
718  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
719  * @see #audio_latency_mode_e
720  * @see player_get_audio_latency_mode()
721  */
722 int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_mode);
723
724 /**
725  * @brief Gets the current audio latency mode.
726  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
727  * @param[in] player The handle to the media player
728  * @param[out] latency_mode The latency mode to get from the audio
729  * @return @c 0 on success,
730  *         otherwise a negative error value
731  * @retval #PLAYER_ERROR_NONE Successful
732  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
733  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
734  * @see #audio_latency_mode_e
735  * @see player_set_audio_latency_mode()
736  */
737 int player_get_audio_latency_mode(player_h player, audio_latency_mode_e *latency_mode);
738
739 /**
740  * @brief Starts or resumes playback.
741  * @details Plays current media content, or resumes play if paused.
742  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
743  * @remarks Sound can be mixed with other sounds if you don't control the stream focus in sound-manager module since 3.0.\n
744  * You can refer to @ref CAPI_MEDIA_SOUND_MANAGER_MODULE.
745  * @remarks Even if you don't set visible to true by calling player_set_display_visible, the video will be shown on #PLAYER_STATE_PLAYING state.
746  *
747  * @param[in]   player The handle to the media player
748  * @return @c 0 on success,
749  *         otherwise a negative error value
750  * @retval #PLAYER_ERROR_NONE Successful
751  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
752  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
753  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
754  * @retval #PLAYER_ERROR_CONNECTION_FAILED Network connection failed
755  * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error
756  * @pre player_prepare() must be called before calling this function.
757  * @pre The player state must be set to #PLAYER_STATE_READY by calling player_prepare() or set to #PLAYER_STATE_PAUSED by calling player_pause().
758  * @post The player state will be #PLAYER_STATE_PLAYING.
759  * @post It invokes player_completed_cb() when playback completes, if you set a callback with player_set_completed_cb().
760  * @post It invokes player_pd_message_cb() when progressive download starts or completes, if you set a download path with player_set_progressive_download_path() and a callback with player_set_progressive_download_message_cb().
761  * @see player_prepare()
762  * @see player_prepare_async()
763  * @see player_stop()
764  * @see player_pause()
765  * @see player_set_completed_cb()
766  * @see player_completed_cb()
767  * @see player_set_progressive_download_path()
768  * @see player_set_progressive_download_message_cb()
769  * @see player_pd_message_cb()
770  * @see player_set_display_visible()
771  */
772 int player_start(player_h player);
773
774 /**
775  * @brief Stops playing media content.
776  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
777  * @param[in]   player The handle to the media player
778  * @return @c 0 on success,
779  *         otherwise a negative error value
780  * @retval #PLAYER_ERROR_NONE Successful
781  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid state
782  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
783  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
784  * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error
785  * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause().
786  * @post The player state will be #PLAYER_STATE_READY.
787  * @post The downloading will be aborted if you use progressive download.
788  * @see player_start()
789  * @see player_pause()
790  */
791 int player_stop(player_h player);
792
793 /**
794  * @brief Pauses the player.
795  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
796  * @remarks     You can resume playback using player_start().
797  *
798  * @param[in]   player The handle to the media player
799  * @return @c 0 on success,
800  *         otherwise a negative error value
801  * @retval #PLAYER_ERROR_NONE Successful
802  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid state
803  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
804  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
805  * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error
806  * @pre The player state must be set to #PLAYER_STATE_PLAYING.
807  * @post The player state will be #PLAYER_STATE_READY.
808  * @see player_start()
809  */
810 int player_pause(player_h player);
811
812 /**
813  * @brief Sets the seek position for playback, asynchronously.
814  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
815  * @remarks This api will trigger the seeking operation on player instance.
816  *          Normally application need to wait for player_seek_completed_cb() before calling it again.
817  *          Otherwise it will return PLAYER_ERROR_SEEK_FAILED.
818  *          Please note that if application is playing external media data via player_set_media_stream_info(),
819  *          then consecutive calling of this api will always success and no need to wait for player_seek_completed_cb()
820  *          before next calling of this api.(since_tizen 3.0)
821  * @remarks Even if you don't set visible to true by calling player_set_display_visible,
822  *          the video will be shown when the _seek_completed cb is invoked.
823  * @remarks In case of non-seekable content, it will return PLAYER_ERROR_INVALID_OPERATION.
824  *          If application ignore this error, player will keep playing without changing play position.
825  * @param[in] player The handle to the media player
826  * @param[in] millisecond The position in milliseconds from the start to the seek point
827  * @param[in] accurate If @c true the selected position is returned, but this might be considerably slow,
828  *                     if @c false the nearest key frame position is returned, but this might be faster but less accurate.
829  * @param[in] callback  The callback function to register
830  * @param[in] user_data The user data to be passed to the callback function
831  * @return @c 0 on success,
832  *         otherwise a negative error value
833  * @retval #PLAYER_ERROR_NONE Successful
834  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
835  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
836  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
837  * @retval #PLAYER_ERROR_SEEK_FAILED Seek operation failure
838  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
839  * @post It invokes player_seek_completed_cb() when seek operation completes, if you set a callback.
840  * @see player_get_play_position()
841  */
842 int player_set_play_position(player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data);
843
844 /**
845  * @brief Gets the current position in milliseconds.
846  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
847  * @param[in]   player The handle to the media player
848  * @param[out]  millisecond The current position in milliseconds
849  * @return @c 0 on success,
850  *         otherwise a negative error value
851  * @retval #PLAYER_ERROR_NONE Successful
852  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
853  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
854  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
855  * @retval #PLAYER_ERROR_SEEK_FAILED Seek operation failure
856  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
857  * @see player_set_play_position()
858  */
859 int player_get_play_position(player_h player, int *millisecond);
860
861 /**
862  * @brief Sets the player's mute status.
863  * @details If the mute status is @c true, no sounds are played.
864  *          If it is @c false, sounds are played at the previously set volume level.
865  *          Until this function is called, by default the player is not muted.
866  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
867  * @param[in]   player The handle to the media player
868  * @param[in]   muted The new mute status: (@c true = mute, @c false = not muted)
869  * @return @c 0 on success,
870  *         otherwise a negative error value
871  * @retval #PLAYER_ERROR_NONE Successful
872  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
873  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
874  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
875  * @see player_is_muted()
876  */
877 int player_set_mute(player_h player, bool muted);
878
879 /**
880  * @brief Gets the player's mute status.
881  * @details If the mute status is @c true, no sounds are played.
882  *          If it is @c false, sounds are played at the previously set volume level.
883  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
884  * @param[in]   player The handle to the media player
885  * @param[out]  muted  The current mute status: (@c true = mute, @c false = not muted)
886  * @return @c 0 on success,
887  *         otherwise a negative error value
888  * @retval #PLAYER_ERROR_NONE Successful
889  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
890  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
891  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
892  * @see player_set_mute()
893  */
894 int player_is_muted(player_h player, bool *muted);
895
896 /**
897  * @brief Sets the player's looping status.
898  * @details If the looping status is @c true, playback automatically restarts upon finishing.
899  *          If it is @c false, it won't. The default value is @c false.
900  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
901  * @param[in]   player The handle to the media player
902  * @param[in]   looping The new looping status: (@c true = looping, @c false = non-looping )
903  * @return @c 0 on success,
904  *         otherwise a negative error value
905  * @retval #PLAYER_ERROR_NONE Successful
906  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
907  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
908  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
909  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
910  * @see player_is_looping()
911  */
912 int player_set_looping(player_h player, bool looping);
913
914 /**
915  * @brief Gets the player's looping status.
916  * @details If the looping status is @c true, playback automatically restarts upon finishing.
917  *          If it is @c false, it won't.
918  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
919  * @param[in]   player The handle to the media player
920  * @param[out]  looping The looping status: (@c true = looping, @c false = non-looping )
921  * @return @c 0 on success,
922  *         otherwise a negative error value
923  * @retval #PLAYER_ERROR_NONE Successful
924  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
925  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
926  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
927  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
928  * @see player_set_looping()
929  */
930 int player_is_looping(player_h player, bool *looping);
931
932 /**
933  * @brief Sets the video display.
934  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
935  * @remarks To get @a display to set, use #GET_DISPLAY().
936  * @remarks We are not supporting changing display.
937  * @remarks This API have be called before calling the player_prepare() or player_prepare_async() \n
938  *          to reflect the display type.
939  * @param[in]   player The handle to the media player
940  * @param[in]   type The display type
941  * @param[in]   display The handle to display
942  * @return @c 0 on success,
943  *         otherwise a negative error value
944  * @retval #PLAYER_ERROR_NONE Successful
945  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
946  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
947  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
948  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
949  * @see #player_display_type_e
950  * @see player_set_display_mode
951  * @see player_set_display_roi_area
952  * @see player_set_display_visible
953  * @see player_set_display_rotation
954  */
955 int player_set_display(player_h player, player_display_type_e type, player_display_h display);
956
957 /**
958  * @brief Registers a media packet video callback function to be called once per frame.
959  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
960  * @remarks This function must be called before calling player_prepare() or player_prepare_async().\n
961  *          A registered callback is called in a separate thread (not in the main loop).\n
962  *          A video frame can be retrieved using a registered callback as a media packet.\n
963  *          The callback function holds the same buffer that will be drawn on the display device.\n
964  *          So if you change the media packet in a registered callback, it will be displayed on the device\n
965  *          and the media packet is available until it's destroyed by media_packet_destroy().\n
966  *          The packet have to be destroyed as quickly as possible after rendering the packet\n
967  *          and all the packets have to be destroyed before player_unprepare() is called.\n
968  * @param[in] player The handle to the media player
969  * @param[in] callback The callback function to be registered
970  * @param[in] user_data The user data to be passed to the callback function
971  * @return @c 0 on success,
972  *         otherwise a negative error value
973  * @retval #PLAYER_ERROR_NONE Successful
974  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
975  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
976  * @pre The player's state must be #PLAYER_STATE_IDLE. And, #PLAYER_DISPLAY_TYPE_NONE must be set by calling player_set_display().
977  * @see player_unset_media_packet_video_frame_decoded_cb
978  */
979 int player_set_media_packet_video_frame_decoded_cb(player_h player, player_media_packet_video_decoded_cb callback, void *user_data);
980
981 /**
982  * @brief Unregisters the callback function.
983  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
984  * @param[in] player The handle to the media player
985  * @return @c 0 on success,
986  *         otherwise a negative error value
987  * @retval #PLAYER_ERROR_NONE Successful
988  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
989  * @pre The player's state must be #PLAYER_STATE_READY or #PLAYER_STATE_IDLE
990  * @see player_set_media_packet_video_frame_decoded_cb()
991  */
992 int player_unset_media_packet_video_frame_decoded_cb(player_h player);
993
994 /**
995  * @brief  Pushes elementary stream to decode audio or video
996  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
997  * @remarks player_set_media_stream_info() must be called before using this API.
998  * @remarks The available buffer size can be set by calling player_set_media_stream_buffer_max_size() API.
999  *          If there is no available buffer space, this api will return error since 3.0.
1000  * @param[in]  player   The handle to media player
1001  * @param[in]  packet   The media packet to decode
1002  * @return @c 0 on success,
1003  *         otherwise a negative error value
1004  * @retval #PLAYER_ERROR_NONE Successful
1005  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1006  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
1007  * @retval #PLAYER_ERROR_NOT_SUPPORTED_FILE File not supported
1008  * @retval #PLAYER_ERROR_BUFFER_SPACE No buffer space available (since 3.0)
1009  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation (since 3.0)
1010  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
1011  * @see player_set_media_stream_info()
1012  * @see player_set_media_stream_buffer_max_size()
1013  */
1014 int player_push_media_stream(player_h player, media_packet_h packet);
1015
1016 /**
1017  * @brief  Sets contents information for media stream
1018  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1019  * @remarks AV format must be set before pushing elementary stream with player_push_media_stream().
1020  * @remarks This API must be called before calling the player_prepare() or player_prepare_async()
1021  *          to reflect the media information.
1022  * @remarks AAC can be supported.
1023  * @remarks H.264 can be supported.
1024  * @param[in] player The handle to media player
1025  * @param[in] type   The type of target stream
1026  * @param[in] format The media format to set audio information
1027  * @return @c 0 on success,
1028  *         otherwise a negative error value
1029  * @retval #PLAYER_ERROR_NONE Successful
1030  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1031  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
1032  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
1033  * @see  player_push_media_stream()
1034  */
1035 int player_set_media_stream_info(player_h player, player_stream_type_e type, media_format_h format);
1036
1037 /**
1038  * @brief Registers a callback function to be invoked when buffer underrun or overflow is occurred.
1039  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1040  * @remarks This API is used for media stream playback only.
1041  * @remarks The callback is called in a separate thread (not in the main loop).
1042  * @param[in] player   The handle to the media player
1043  * @param[in] type     The type of target stream
1044  * @param[in] callback The buffer status callback function to register
1045  * @param[in] user_data The user data to be passed to the callback function
1046  * @return @c 0 on success,
1047  *         otherwise a negative error value
1048  * @retval #PLAYER_ERROR_NONE Successful
1049  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1050  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1051  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
1052  * @post player_media_stream_buffer_status_cb() will be invoked.
1053  * @see player_unset_media_stream_buffer_status_cb()
1054  * @see player_media_stream_buffer_status_cb()
1055  */
1056 int player_set_media_stream_buffer_status_cb(player_h player, player_stream_type_e type, player_media_stream_buffer_status_cb callback, void *user_data);
1057
1058 /**
1059  * @brief Unregisters the buffer status callback function.
1060  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1061  * @remarks This API is used for media stream playback only.
1062  * @param[in] player The handle to the media player
1063  * @param[in] type   The type of target stream
1064  * @return @c 0 on success,
1065  *         otherwise a negative error value
1066  * @retval #PLAYER_ERROR_NONE Successful
1067  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1068  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1069  * @see player_set_media_stream_buffer_status_cb()
1070  */
1071 int player_unset_media_stream_buffer_status_cb(player_h player, player_stream_type_e type);
1072
1073 /**
1074  * @brief Registers a callback function to be invoked when seeking is occurred.
1075  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1076  * @remarks This API is used for media stream playback only.
1077  * @remarks The callback is called in a separate thread (not in the main loop).
1078  * @param[in] player    The handle to the media player
1079  * @param[in] type      The type of target stream
1080  * @param[in] callback  The callback function to register
1081  * @param[in] user_data The user data to be passed to the callback function
1082  * @return @c 0 on success,
1083  *         otherwise a negative error value
1084  * @retval #PLAYER_ERROR_NONE Successful
1085  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1086  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1087  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
1088  * @post player_media_stream_seek_cb() will be invoked.
1089  * @see player_unset_media_stream_seek_cb()
1090  * @see player_media_stream_seek_cb()
1091  */
1092 int player_set_media_stream_seek_cb(player_h player, player_stream_type_e type, player_media_stream_seek_cb callback, void *user_data);
1093
1094 /**
1095  * @brief Unregisters the seek callback function.
1096  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1097  * @param[in] player The handle to the media player
1098  * @param[in] type   The type of target stream
1099  * @return @c 0 on success,
1100  *         otherwise a negative error value
1101  * @retval #PLAYER_ERROR_NONE Successful
1102  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1103  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1104  * @see player_set_media_stream_seek_cb()
1105  */
1106 int player_unset_media_stream_seek_cb(player_h player, player_stream_type_e type);
1107
1108 /**
1109  * @brief Sets the max size bytes of buffer.
1110  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1111  * @remarks This API is used for media stream playback only.
1112  * @remarks If the buffer level over the max size, player_media_stream_buffer_status_cb() will be invoked with overflow status.
1113  * @param[in] player The handle to the media player
1114  * @param[in] type   The type of target stream
1115  * @param[in] max_size The max bytes of buffer, it has to be bigger than zero. (default: 200000)
1116  * @return @c 0 on success,
1117  *         otherwise a negative error value
1118  * @retval #PLAYER_ERROR_NONE Successful
1119  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1120  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1121  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. (since 3.0)
1122  * @see player_get_media_stream_buffer_max_size()
1123  * @see player_media_stream_buffer_status_cb()
1124  */
1125 int player_set_media_stream_buffer_max_size(player_h player, player_stream_type_e type, unsigned long long max_size);
1126
1127 /**
1128  * @brief Gets the max size bytes of buffer.
1129  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1130  * @remarks This API is used for media stream playback only.
1131  * @remarks If the buffer level over the max size, player_media_stream_buffer_status_cb() will be invoked with overflow status.
1132  * @param[in] player The handle to the media player
1133  * @param[in] type   The type of target stream
1134  * @param[out] max_size The max bytes of buffer
1135  * @return @c 0 on success,
1136  *         otherwise a negative error value
1137  * @retval #PLAYER_ERROR_NONE Successful
1138  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1139  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1140  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1141  * @see player_set_media_stream_buffer_max_size()
1142  * @see player_media_stream_buffer_status_cb()
1143  */
1144 int player_get_media_stream_buffer_max_size(player_h player, player_stream_type_e type, unsigned long long *max_size);
1145
1146 /**
1147  * @brief Sets the buffer threshold percent of buffer.
1148  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1149  * @remarks This API is used for media stream playback only.
1150  * @remarks If the buffer level drops below the percent value, player_media_stream_buffer_status_cb() will be invoked with underrun status.
1151  * @param[in] player The handle to the media player
1152  * @param[in] type   The type of target stream
1153  * @param[in] percent The minimum threshold(0~100) of buffer (default: 0)
1154  * @return @c 0 on success,
1155  *         otherwise a negative error value
1156  * @retval #PLAYER_ERROR_NONE Successful
1157  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1158  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1159  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. (since 3.0)
1160  * @see player_get_media_stream_buffer_min_threshold()
1161  * @see player_media_stream_buffer_status_cb()
1162  */
1163 int player_set_media_stream_buffer_min_threshold(player_h player, player_stream_type_e type, unsigned int percent);
1164
1165 /**
1166  * @brief Gets the buffer threshold percent of buffer.
1167  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
1168  * @remarks This API is used for media stream playback only.
1169  * @remarks If the buffer level drops below the percent value, player_media_stream_buffer_status_cb() will be invoked with underrun status.
1170  * @param[in] player The handle to the media player
1171  * @param[in] type   The type of target stream
1172  * @param[out] percent The minimum threshold(0~100) of buffer
1173  * @return @c 0 on success,
1174  *         otherwise a negative error value
1175  * @retval #PLAYER_ERROR_NONE Successful
1176  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1177  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1178  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1179  * @see player_set_media_stream_buffer_min_threshold()
1180  * @see player_media_stream_buffer_status_cb()
1181  */
1182 int player_get_media_stream_buffer_min_threshold(player_h player, player_stream_type_e type, unsigned int *percent);
1183
1184 /**
1185  * @}
1186  */
1187
1188 /**
1189  * @addtogroup CAPI_MEDIA_PLAYER_DISPLAY_MODULE
1190  * @{
1191  */
1192
1193 /**
1194  * @brief Sets the video display mode.
1195  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1196  * @remarks If no display is set, no operation is performed.
1197  * @param[in] player   The handle to the media player
1198  * @param[in] mode     The display mode
1199  * @return @c 0 on success,
1200  *         otherwise a negative error value
1201  * @retval #PLAYER_ERROR_NONE Successful
1202  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1203  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1204  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
1205  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1206  * @see #player_display_mode_e
1207  * @see player_set_display()
1208  * @see player_get_display_mode()
1209  */
1210 int player_set_display_mode(player_h player, player_display_mode_e mode);
1211
1212 /**
1213  * @brief Gets the video display mode.
1214  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1215  * @remarks If no display is set, no operation is performed.
1216  * @param[in] player The handle to the media player
1217  * @param[out] mode The current display mode
1218  * @return @c 0 on success,
1219  *         otherwise a negative error value
1220  * @retval  #PLAYER_ERROR_NONE Successful
1221  * @retval  #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1222  * @retval  #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1223  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1224  * @see #player_display_mode_e
1225  * @see player_set_display_mode()
1226  */
1227 int player_get_display_mode(player_h player, player_display_mode_e *mode);
1228
1229 /**
1230  * @brief Sets the ROI(Region Of Interest) area of display.
1231  * @since_tizen 3.0
1232  * @remarks If no display is set, no operation is performed.
1233  * @remarks Before set display ROI area, #PLAYER_DISPLAY_MODE_DST_ROI must be set with player_set_display_mode().
1234  *          The minimum value of width and height are 1.
1235  * @param[in] player The handle to the media player
1236  * @param[in] x X coordinate of area
1237  * @param[in] y Y coordinate of area
1238  * @param[in] width Width of area
1239  * @param[in] height Height of area
1240  * @return @c 0 on success,
1241  *         otherwise a negative error value
1242  * @retval  #PLAYER_ERROR_NONE Successful
1243  * @retval  #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1244  * @retval  #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1245  * @pre display_mode must be set to #PLAYER_DISPLAY_MODE_DST_ROI.
1246  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1247  * @see player_set_display()
1248  * @see player_set_display_mode()
1249  */
1250 int player_set_display_roi_area(player_h player, int x, int y, int width, int height);
1251
1252 /**
1253  * @brief Sets the visibility of the video display
1254  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1255  * @remarks If no display is set, no operation is performed.
1256  * @remarks If you set visible before calling player_set_display, it will be applied on #PLAYER_STATE_READY state.
1257  * @param[in] player   The handle to the media player
1258  * @param[in] visible The visibility of the display (@c true = visible, @c false = non-visible )
1259  * @return @c 0 on success,
1260  *         otherwise a negative error value
1261  * @retval #PLAYER_ERROR_NONE Successful
1262  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1263  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1264  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
1265  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1266  * @see player_set_display()
1267  * @see player_is_display_visible()
1268  */
1269 int player_set_display_visible(player_h player, bool visible);
1270
1271 /**
1272  * @brief Gets the visibility of the video display.
1273  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1274  * @param[in] player The handle to the media player
1275  * @param[out] visible The current visibility of the display (@c true = visible, @c false = non-visible )
1276  * @return @c 0 on success,
1277  *         otherwise a negative error value
1278  * @retval  #PLAYER_ERROR_NONE Successful
1279  * @retval  #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1280  * @retval  #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1281  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1282  * @see player_set_display_visible()
1283  */
1284 int player_is_display_visible(player_h player, bool* visible);
1285
1286 /**
1287  * @brief Sets the rotation settings of the video surface display.
1288  * @details Use this function to change the video orientation to portrait mode.
1289  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1290  * @remarks If no display is set, no operation is performed.
1291  * @param[in] player   The handle to the media player
1292  * @param[in] rotation The rotation of the display
1293  * @return @c 0 on success,
1294  *         otherwise a negative error value
1295  * @retval #PLAYER_ERROR_NONE Successful
1296  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1297  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1298  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
1299  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1300  * @see #player_display_rotation_e
1301  * @see  player_set_display
1302  * @see  player_get_display_rotation()
1303  */
1304 int player_set_display_rotation(player_h player, player_display_rotation_e rotation);
1305
1306 /**
1307  * @brief Gets the rotation of the video surface display.
1308  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1309  * @param[in] player The handle to the media player
1310  * @param[out] rotation The current rotation of the display
1311  * @return @c 0 on success,
1312  *         otherwise a negative error value
1313  * @retval  #PLAYER_ERROR_NONE Successful
1314  * @retval  #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1315  * @retval  #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1316  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1317  * @see #player_display_rotation_e
1318  * @see     player_set_display_rotation()
1319  */
1320 int player_get_display_rotation(player_h player, player_display_rotation_e *rotation);
1321
1322 /**
1323  * @}
1324  */
1325
1326
1327 /**
1328  * @addtogroup CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE
1329  * @{
1330  */
1331
1332  /**
1333  * @brief Gets the media content information.
1334  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1335  * @remarks You must release @a value using @c free().
1336  * @remarks The playback type should be local playback or HTTP streaming playback.
1337  * @param[in]  player The handle to the media player
1338  * @param[in] key The key attribute name to get
1339  * @param[out] value The value of the key attribute \n
1340  *                   It can be an empty string if there is no content information.
1341  * @return @c 0 on success,
1342  *         otherwise a negative error value
1343  * @retval #PLAYER_ERROR_NONE Successful
1344  * @retval #PLAYER_ERROR_INVALID_PARAMETER  Invalid parameter
1345  * @retval #PLAYER_ERROR_OUT_OF_MEMORY Not enough memory is available
1346  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1347  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1348  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
1349  */
1350 int player_get_content_info(player_h player, player_content_info_e key, char ** value);
1351
1352 /**
1353  * @brief Gets the audio and video codec information.
1354  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1355  * @remarks You must release @a audio_codec and @a video_codec using free().
1356  * @remarks The playback type should be local playback or HTTP streaming playback.
1357  * @param[in] player The handle to the media player
1358  * @param[out] audio_codec The name of the audio codec \n
1359  *                         It can be @c NULL if there is no audio codec.
1360  * @param[out] video_codec The name of the video codec \n
1361  *                         It can be @c NULL if there is no video codec.
1362  * @return @c 0 on success,
1363  *         otherwise a negative error value
1364  * @retval #PLAYER_ERROR_NONE Successful
1365  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1366  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1367  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1368  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
1369  */
1370 int player_get_codec_info(player_h player, char **audio_codec, char **video_codec);
1371
1372 /**
1373  * @brief Gets the audio stream information.
1374  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1375  * @remarks The playback type should be local playback or HTTP streaming playback.
1376  * @param[in] player The handle to the media player
1377  * @param[out]  sample_rate The audio sample rate [Hz] \n
1378  *                          Value can be invalid if there is no audio stream information.
1379  * @param[out]  channel The audio channel (1: mono, 2: stereo) \n
1380  *                      Value can be invalid if there is no audio stream information.
1381  * @param[out]  bit_rate The audio bit rate [Hz] \n
1382  *                       Value can be invalid if there is no audio stream information.
1383  * @return @c 0 on success,
1384  *         otherwise a negative error value
1385  * @retval #PLAYER_ERROR_NONE Successful
1386  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1387  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1388  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1389  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
1390  */
1391 int player_get_audio_stream_info(player_h player, int *sample_rate, int *channel, int *bit_rate);
1392
1393 /**
1394  * @brief Gets the video stream information.
1395  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1396  * @remarks The playback type should be local playback or HTTP streaming playback.
1397  * @param[in] player The handle to the media player
1398  * @param[out]  fps The frame per second of the video \n
1399  *                  It can be @c 0 if there is no video stream information.
1400  * @param[out]  bit_rate The video bit rate [Hz] \n
1401  *                       It can be an invalid value if there is no video stream information.
1402  * @return @c 0 on success,
1403  *         otherwise a negative error value
1404  * @retval #PLAYER_ERROR_NONE Successful
1405  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1406  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1407  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1408  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
1409  */
1410 int player_get_video_stream_info(player_h player, int *fps, int *bit_rate);
1411
1412 /**
1413  * @brief Gets the video display's height and width.
1414  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1415  * @remarks The playback type should be local playback or HTTP streaming playback.
1416  * @param[in] player The handle to the media player
1417  * @param[out] width The width of the video \n
1418  *                   Value can be invalid if there is no video or no display is set.
1419  * @param[out] height The height of the video \n
1420  *                    Value can be invalid value if there is no video or no display is set.
1421  * @return @c 0 on success,
1422  *         otherwise a negative error value
1423  * @retval #PLAYER_ERROR_NONE Successful
1424  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1425  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1426  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1427  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
1428  */
1429 int player_get_video_size(player_h player, int *width, int *height);
1430
1431 /**
1432  * @brief Gets the album art in the media resource.
1433  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1434  * @remarks You must not release @a album_art. It will be released by framework when the player is destroyed.
1435  * @param[in] player The handle to the media player
1436  * @param[out] album_art The encoded artwork image
1437  * @param[out] size The encoded artwork size
1438  * @return @c 0 on success,
1439  *         otherwise a negative error value
1440  * @retval #PLAYER_ERROR_NONE Successful
1441  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1442  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1443  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1444  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
1445  */
1446 int player_get_album_art(player_h player, void **album_art, int *size);
1447
1448 /**
1449  * @brief Gets the total running time of the associated media.
1450  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1451  * @remarks The media source is associated with the player, using either player_set_uri() or player_set_memory_buffer().
1452  * @remarks The playback type should be local playback or HTTP streaming playback.
1453  * @param[in]   player The handle to the media player
1454  * @param[out]  duration The duration in milliseconds
1455  * @return @c 0 on success,
1456  *         otherwise a negative error value
1457  * @retval #PLAYER_ERROR_NONE Successful
1458  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1459  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1460  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1461  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
1462  * @see player_set_uri()
1463  * @see player_set_memory_buffer()
1464  */
1465 int player_get_duration(player_h player, int *duration);
1466
1467 /**
1468  * @}
1469  */
1470
1471
1472 /**
1473  * @addtogroup CAPI_MEDIA_PLAYER_AUDIO_EFFECT_MODULE
1474  * @{
1475  */
1476
1477 /**
1478  * @brief Gets the number of equalizer bands.
1479  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1480  * @param[in] player The handle to the media player
1481  * @param[out] count The number of equalizer bands
1482  * @return @c 0 on success,
1483  *         otherwise a negative error value
1484  * @retval #PLAYER_ERROR_NONE Successful
1485  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1486  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1487  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1488  * @see player_audio_effect_equalizer_is_available()
1489  * @see player_audio_effect_set_equalizer_band_level()
1490  * @see player_audio_effect_set_equalizer_all_bands()
1491  */
1492 int player_audio_effect_get_equalizer_bands_count(player_h player, int *count);
1493
1494 /**
1495  * @brief Sets the gain set for the given equalizer band.
1496  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1497  * @param[in] player The handle to the media player
1498  * @param[in] index The index of the equalizer band to be set
1499  * @param[in] level The new gain in decibel that is set to the given band [dB]
1500  * @return @c 0 on success,
1501  *         otherwise a negative error value
1502  * @retval #PLAYER_ERROR_NONE Successful
1503  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1504  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1505  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1506  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1507  * @see player_audio_effect_equalizer_is_available()
1508  * @see player_audio_effect_get_equalizer_bands_count()
1509  * @see player_audio_effect_get_equalizer_level_range()
1510  * @see player_audio_effect_get_equalizer_band_level()
1511  * @see player_audio_effect_set_equalizer_all_bands()
1512  */
1513 int player_audio_effect_set_equalizer_band_level(player_h player, int index, int level);
1514
1515 /**
1516  * @brief Gets the gain set for the given equalizer band.
1517  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1518  * @param[in]   player The handle to the media player
1519  * @param[in]   index The index of the requested equalizer band
1520  * @param[out]   level The gain in decibel of the given band [dB]
1521  * @return @c 0 on success,
1522  *         otherwise a negative error value
1523  * @retval #PLAYER_ERROR_NONE Successful
1524  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1525  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1526  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1527  * @see player_audio_effect_equalizer_is_available()
1528  * @see player_audio_effect_set_equalizer_band_level()
1529  */
1530 int player_audio_effect_get_equalizer_band_level(player_h player, int index, int *level);
1531
1532 /**
1533  * @brief Sets all bands of the equalizer.
1534  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1535  * @param[in] player The handle to the media player
1536  * @param[in] band_levels The list of band levels to be set
1537  * @param[in] length The length of the band level
1538  * @return @c 0 on success,
1539  *         otherwise a negative error value
1540  * @retval #PLAYER_ERROR_NONE Successful
1541  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1542  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1543  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1544  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1545  * @see player_audio_effect_equalizer_is_available()
1546  * @see player_audio_effect_get_equalizer_bands_count()
1547  * @see player_audio_effect_get_equalizer_level_range()
1548  * @see player_audio_effect_set_equalizer_band_level()
1549  */
1550 int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_levels, int length);
1551
1552 /**
1553  * @brief Gets the valid band level range of the equalizer.
1554  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1555  * @param[in] player The handle to the media player
1556  * @param[out] min The minimum value to be set [dB]
1557  * @param[out] max The maximum value to be set [dB]
1558  * @return @c 0 on success,
1559  *         otherwise a negative error value
1560  * @retval #PLAYER_ERROR_NONE Successful
1561  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1562  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1563  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1564  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1565  * @see player_audio_effect_equalizer_is_available()
1566  * @see player_audio_effect_set_equalizer_band_level()
1567  * @see player_audio_effect_set_equalizer_all_bands()
1568  */
1569 int player_audio_effect_get_equalizer_level_range(player_h player, int* min, int* max);
1570
1571 /**
1572  * @brief Gets the band frequency of the equalizer.
1573  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1574  * @param[in] player The handle to the media player
1575  * @param[in]  index The index of the requested equalizer band
1576  * @param[out] frequency The frequency of the given band [dB]
1577  * @return @c 0 on success,
1578  *         otherwise a negative error value
1579  * @retval #PLAYER_ERROR_NONE Successful
1580  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1581  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1582  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1583  * @see player_audio_effect_equalizer_is_available()
1584  */
1585 int player_audio_effect_get_equalizer_band_frequency(player_h player, int index, int *frequency);
1586
1587 /**
1588  * @brief Gets the band frequency range of the equalizer.
1589  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1590  * @param[in] player The handle to the media player
1591  * @param[in]  index The index of the requested equalizer band
1592  * @param[out] range The frequency range of the given band [dB]
1593  * @return @c 0 on success,
1594  *         otherwise a negative error value
1595  * @retval #PLAYER_ERROR_NONE Successful
1596  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1597  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1598  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1599  * @see player_audio_effect_equalizer_is_available()
1600  */
1601 int player_audio_effect_get_equalizer_band_frequency_range(player_h player, int index, int *range);
1602
1603 /**
1604  * @brief Clears the equalizer effect.
1605  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1606  * @param[in] player The handle to the media player
1607  * @return @c 0 on success,
1608  *         otherwise a negative error value
1609  * @retval #PLAYER_ERROR_NONE Successful
1610  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1611  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1612  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1613  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1614  * @see player_audio_effect_equalizer_is_available()
1615  * @see player_audio_effect_set_equalizer_band_level()
1616  * @see player_audio_effect_set_equalizer_all_bands()
1617  */
1618 int player_audio_effect_equalizer_clear(player_h player);
1619
1620 /**
1621  * @brief Checks whether the custom equalizer effect is available.
1622  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1623  * @param[in] player The handle to the media player
1624  * @param[out] available If @c true the specified audio effect is available,
1625  *                       otherwise @c false
1626  * @return @c 0 on success,
1627  *         otherwise a negative error value
1628  * @retval #PLAYER_ERROR_NONE Successful
1629  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1630  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1631  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1632  * @see player_audio_effect_set_equalizer_band_level()
1633  * @see player_audio_effect_set_equalizer_all_bands()
1634  */
1635 int player_audio_effect_equalizer_is_available(player_h player, bool *available);
1636
1637 /**
1638  * @}
1639  */
1640
1641
1642 /**
1643  * @addtogroup CAPI_MEDIA_PLAYER_MODULE
1644  * @{
1645  */
1646
1647 /**
1648  * @brief Captures the video frame, asynchronously.
1649  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1650  * @param[in] player The handle to the media player
1651  * @param[in] callback  The callback function to register
1652  * @param[in] user_data The user data to be passed to the callback function
1653  * @return @c 0 on success,
1654  *         otherwise a negative error value
1655  * @retval #PLAYER_ERROR_NONE Successful
1656  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1657  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1658  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1659  * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause().
1660  * @pre Video display type should be set by calling player_set_display() otherwise, audio stream is only processed even though video file is set.
1661  * @post It invokes player_video_captured_cb() when capture completes, if you set a callback.
1662  * @see player_video_captured_cb()
1663  */
1664 int player_capture_video(player_h player, player_video_captured_cb callback, void *user_data);
1665
1666 /**
1667  * @brief Sets the cookie for streaming playback.
1668  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1669  * @remarks This API must be called before calling the player_prepare() or player_prepare_async()
1670  *          to reflect the cookie information when the streaming connection is set up.
1671  * @param[in] player The handle to the media player
1672  * @param[in] cookie The cookie to set
1673  * @param[in] size The size of the cookie
1674  * @return @c 0 on success,
1675  *         otherwise a negative error value
1676  * @retval #PLAYER_ERROR_NONE Successful
1677  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1678  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1679  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1680  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
1681  * @see player_set_uri()
1682  * @see player_set_streaming_user_agent()
1683  */
1684 int player_set_streaming_cookie(player_h player, const char *cookie, int size);
1685
1686 /**
1687  * @brief Sets the streaming user agent for playback.
1688  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1689  * @remarks This API must be called before calling the player_prepare() or player_prepare_async()
1690  *          to reflect the user agent information when the streaming connection is set up.
1691  * @param[in] player The handle to the media player
1692  * @param[in] user_agent The user agent to set
1693  * @param[in] size The size of the user agent
1694  * @return @c 0 on success,
1695  *         otherwise a negative error value
1696  * @retval #PLAYER_ERROR_NONE Successful
1697  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1698  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1699  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1700  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
1701  * @see player_set_uri()
1702  * @see player_set_streaming_cookie()
1703  */
1704 int player_set_streaming_user_agent(player_h player, const char *user_agent, int size);
1705
1706 /**
1707  * @brief Gets the download progress for streaming playback.
1708  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1709  * @param[in] player The handle to the media player
1710  * @param[out] start The starting position in percentage [0, 100]
1711  * @param[out] current The current position in percentage [0, 100]
1712  * @return @c 0 on success,
1713  *         otherwise a negative error value
1714  * @retval #PLAYER_ERROR_NONE Successful
1715  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1716  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1717  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1718  * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause().
1719  */
1720 int player_get_streaming_download_progress(player_h player, int *start, int *current);
1721
1722 /**
1723  * @brief Registers a callback function to be invoked when the playback is finished.
1724  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1725  * @param[in] player    The handle to the media player
1726  * @param[in] callback  The callback function to register
1727  * @param[in] user_data The user data to be passed to the callback function
1728  * @return @c 0 on success,
1729  *         otherwise a negative error value
1730  * @retval #PLAYER_ERROR_NONE Successful
1731  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1732  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1733  * @post  player_completed_cb() will be invoked.
1734  * @see player_unset_completed_cb()
1735  * @see player_completed_cb()
1736  * @see player_start()
1737  */
1738 int player_set_completed_cb(player_h player, player_completed_cb callback, void *user_data);
1739
1740 /**
1741  * @brief Unregisters the callback function.
1742  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1743  * @param[in] player The handle to the media player
1744  * @return @c 0 on success,
1745  *         otherwise a negative error value
1746  * @retval #PLAYER_ERROR_NONE Successful
1747  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1748  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1749  * @see player_set_completed_cb()
1750  */
1751 int player_unset_completed_cb(player_h player);
1752
1753 /**
1754  * @brief Registers a callback function to be invoked when the playback is interrupted or the interrupt is completed.
1755  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1756  * @param[in] player    The handle to the media player
1757  * @param[in] callback  The callback function to register
1758  * @param[in] user_data The user data to be passed to the callback function
1759  * @return @c 0 on success,
1760  *         otherwise a negative error value
1761  * @retval #PLAYER_ERROR_NONE Successful
1762  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1763  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1764  * @post  player_interrupted_cb() will be invoked.
1765  * @see player_unset_interrupted_cb()
1766  * @see #player_interrupted_code_e
1767  * @see player_interrupted_cb()
1768  */
1769 int player_set_interrupted_cb(player_h player, player_interrupted_cb callback, void *user_data);
1770
1771 /**
1772  * @brief Unregisters the callback function.
1773  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1774  * @param[in] player The handle to the media player
1775  * @return @c 0 on success,
1776  *         otherwise a negative error value
1777  * @retval #PLAYER_ERROR_NONE Successful
1778  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1779  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1780  * @see player_set_interrupted_cb()
1781  */
1782 int player_unset_interrupted_cb(player_h player);
1783
1784 /**
1785  * @brief Registers a callback function to be invoked when an error occurs.
1786  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1787  * @param[in] player    The handle to the media player
1788  * @param[in] callback  The callback function to register
1789  * @param[in] user_data The user data to be passed to the callback function
1790  * @return @c 0 on success,
1791  *         otherwise a negative error value
1792  * @retval #PLAYER_ERROR_NONE Successful
1793  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1794  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1795  * @post  player_error_cb() will be invoked.
1796  * @see player_unset_error_cb()
1797  * @see player_error_cb()
1798  */
1799 int player_set_error_cb(player_h player, player_error_cb callback, void *user_data);
1800
1801 /**
1802  * @brief Unregisters the callback function.
1803  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1804  * @param[in] player The handle to the media player
1805  * @return @c 0 on success,
1806  *         otherwise a negative error value
1807  * @retval #PLAYER_ERROR_NONE Successful
1808  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1809  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1810  * @see player_set_error_cb()
1811  */
1812 int player_unset_error_cb(player_h player);
1813
1814 /**
1815  * @brief Registers a callback function to be invoked when there is a change in the buffering status of a media stream.
1816  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1817  * @remarks The media resource should be streamed over the network.
1818  * @param[in] player    The handle to the media player
1819  * @param[in] callback  The callback function to register
1820  * @param[in] user_data The user data to be passed to the callback function
1821  * @return @c 0 on success,
1822  *         otherwise a negative error value
1823  * @retval #PLAYER_ERROR_NONE Successful
1824  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1825  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1826  * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
1827  * @post  player_buffering_cb() will be invoked.
1828  * @see player_unset_buffering_cb()
1829  * @see player_set_uri()
1830  * @see player_buffering_cb()
1831  */
1832 int player_set_buffering_cb(player_h player, player_buffering_cb callback, void *user_data);
1833
1834 /**
1835  * @brief Unregisters the callback function.
1836  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1837  * @param[in] player The handle to the media player
1838  * @return @c 0 on success,
1839  *         otherwise a negative error value
1840  * @retval #PLAYER_ERROR_NONE Successful
1841  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1842  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1843  * @see player_set_buffering_cb()
1844  */
1845 int player_unset_buffering_cb(player_h player);
1846
1847 /**
1848  * @deprecated Deprecated since 4.0.
1849  * @brief Sets a path to download, progressively.
1850  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1851  * @remarks Progressive download will be started when you invoke player_start().
1852  * @remarks This API must be called before calling the player_prepare() or player_prepare_async() to reflect the download path when the player is building.
1853  * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any files are used to download and play located in the internal storage.
1854  * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any files are used to download and play located in the external storage.
1855  *
1856  * @param[in]   player The handle to the media player
1857  * @param[in]   path The absolute path to download
1858  * @return @c 0 on success,
1859  *         otherwise a negative error value
1860  * @retval #PLAYER_ERROR_NONE Successful
1861  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1862  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1863  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1864  * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
1865  * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied
1866  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
1867  * @see player_set_progressive_download_message_cb()
1868  * @see player_unset_progressive_download_message_cb()
1869  */
1870 int player_set_progressive_download_path(player_h player, const char *path) TIZEN_DEPRECATED_API;
1871
1872 /**
1873  * @deprecated Deprecated since 4.0.
1874  * @brief Gets the status of progressive download.
1875  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1876  * @param[in] player The handle to the media player
1877  * @param[out] current The current download position (bytes)
1878  * @param[out] total_size The total size of the file (bytes)
1879  * @return @c 0 on success,
1880  *         otherwise a negative error value
1881  * @retval #PLAYER_ERROR_NONE Successful
1882  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1883  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1884  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1885  * @pre The progressive download path must be set by calling player_set_progressive_download_path().
1886  * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause().
1887  */
1888 int player_get_progressive_download_status(player_h player, unsigned long *current, unsigned long *total_size) TIZEN_DEPRECATED_API;
1889
1890 /**
1891  * @deprecated Deprecated since 4.0.
1892  * @brief Registers a callback function to be invoked when progressive download is started or completed.
1893  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1894  * @param[in] player    The handle to the media player
1895  * @param[in] callback  The callback function to register
1896  * @param[in] user_data The user data to be passed to the callback function
1897  * @return @c 0 on success,
1898  *         otherwise a negative error value
1899  * @retval #PLAYER_ERROR_NONE Successful
1900  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1901  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1902  * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
1903  * @pre The path to download must be set by calling player_set_progressive_download_path().
1904  * @post  player_pd_message_cb() will be invoked.
1905  * @see player_unset_progressive_download_message_cb()
1906  * @see player_set_progressive_download_path()
1907  */
1908 int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data) TIZEN_DEPRECATED_API;
1909
1910 /**
1911  * @deprecated Deprecated since 4.0.
1912  * @brief Unregisters the callback function.
1913  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1914  * @param[in] player The handle to the media player
1915  * @return @c 0 on success,
1916  *         otherwise a negative error value
1917  * @retval #PLAYER_ERROR_NONE Successful
1918  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1919  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1920  * @see player_set_progressive_download_message_cb()
1921  */
1922 int player_unset_progressive_download_message_cb(player_h player) TIZEN_DEPRECATED_API;
1923
1924 /**
1925  * @brief Sets the playback rate.
1926  * @details The default value is @c 1.0.
1927  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1928  * @remarks #PLAYER_ERROR_INVALID_OPERATION occurs when streaming playback.
1929  * @remarks No operation is performed, if @a rate is @c 0.
1930  * @remarks The sound is muted, when playback rate is under @c 0.0 and over @c 2.0.
1931  * @param[in] player The handle to the media player
1932  * @param[in] rate The playback rate (-5.0x ~ 5.0x)
1933  * @return @c 0 on success,
1934  *         otherwise a negative error value
1935  * @retval #PLAYER_ERROR_NONE Successful
1936  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1937  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1938  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1939  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1940  */
1941 int player_set_playback_rate(player_h player, float rate);
1942
1943 /**
1944  * @}
1945  */
1946
1947 /**
1948  * @addtogroup CAPI_MEDIA_PLAYER_SUBTITLE_MODULE
1949  * @{
1950  */
1951
1952 /**
1953  * @brief Sets a subtitle path.
1954  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1955  * @remarks Only MicroDVD/SubViewer(*.sub), SAMI(*.smi), and SubRip(*.srt) subtitle formats are supported.
1956  * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any files are used to play located in the internal storage.
1957  * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any files are used to play located in the external storage.
1958  * @remarks The path value can be @c NULL for reset before calling player_prepare() or player_prepare_async().
1959  *
1960  * @param[in]   player The handle to the media player
1961  * @param[in]   path The absolute path of the subtitle file, it can be @c NULL in the #PLAYER_STATE_IDLE state.
1962  * @return @c 0 on success,
1963  *         otherwise a negative error value
1964  * @retval #PLAYER_ERROR_NONE Successful
1965  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1966  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1967  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
1968  * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied
1969  * @retval #PLAYER_ERROR_NO_SUCH_FILE File not found (Since 4.0)
1970  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
1971  */
1972 int player_set_subtitle_path(player_h player, const char *path);
1973
1974 /**
1975  * @brief Registers a callback function to be invoked when a subtitle updates.
1976  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1977  * @remarks The callback is called in a separate thread (not in the main loop).
1978  * @param[in] player    The handle to the media player
1979  * @param[in] callback  The callback function to register
1980  * @param[in] user_data The user data to be passed to the callback function
1981  * @return @c 0 on success,
1982  *         otherwise a negative error value
1983  * @retval #PLAYER_ERROR_NONE Successful
1984  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
1985  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
1986  * @pre The subtitle must be set by calling player_set_subtitle_path().
1987  * @post  player_subtitle_updated_cb() will be invoked.
1988  * @see player_unset_subtitle_updated_cb()
1989  * @see player_subtitle_updated_cb()
1990  * @see player_set_subtitle_path()
1991  */
1992 int player_set_subtitle_updated_cb(player_h player, player_subtitle_updated_cb callback, void *user_data);
1993
1994 /**
1995  * @brief Unregisters the callback function.
1996  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1997  * @param[in] player The handle to the media player
1998  * @return @c 0 on success,
1999  *         otherwise a negative error value
2000  * @retval #PLAYER_ERROR_NONE Successful
2001  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2002  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2003  * @see player_set_subtitle_updated_cb()
2004  */
2005 int player_unset_subtitle_updated_cb(player_h player);
2006
2007 /**
2008  * @brief Sets the seek position for the subtitle.
2009  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif.1
2010  * @remarks Only MicroDVD/SubViewer(*.sub), SAMI(*.smi), and SubRip(*.srt) subtitle formats are supported.
2011  * @param[in]  player The handle to the media player
2012  * @param[in]  millisecond The position in milliseconds from the start to the seek point
2013  * @return @c 0 on success,
2014  *         otherwise a negative error value
2015  * @retval #PLAYER_ERROR_NONE Successful
2016  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2017  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2018  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
2019  * @pre The subtitle must be set by calling player_set_subtitle_path().
2020  * @pre The player state must be one of #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
2021  */
2022 int player_set_subtitle_position_offset(player_h player, int millisecond);
2023
2024 /**
2025  * @brief Registers a callback function to be invoked when video stream is changed.
2026  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
2027  * @remarks The stream changing is detected just before rendering operation.
2028  * @remarks The callback is called in a separate thread (not in the main loop).
2029  * @remarks This API must be called before calling the player_prepare() or player_prepare_async()
2030  *          to reflect the requirement when the player is building.
2031  * @param[in] player   The handle to the media player
2032  * @param[in] callback The stream changed callback function to register
2033  * @param[in] user_data The user data to be passed to the callback function
2034  * @return @c 0 on success,
2035  *         otherwise a negative error value
2036  * @retval #PLAYER_ERROR_NONE Successful
2037  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
2038  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2039  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
2040  * @post player_video_stream_changed_cb() will be invoked.
2041  * @see player_unset_video_stream_changed_cb()
2042  * @see player_video_stream_changed_cb()
2043  */
2044 int player_set_video_stream_changed_cb(player_h player, player_video_stream_changed_cb callback, void *user_data);
2045
2046 /**
2047  * @brief Unregisters the video stream changed callback function.
2048  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
2049  * @param[in] player The handle to the media player
2050  * @return @c 0 on success,
2051  *         otherwise a negative error value
2052  * @retval #PLAYER_ERROR_NONE Successful
2053  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
2054  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2055  * @see player_set_video_stream_changed_cb()
2056  */
2057 int player_unset_video_stream_changed_cb(player_h player);
2058
2059 /**
2060  * @brief Gets current track index.
2061  * @details Index starts from 0.
2062  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
2063  * @param[in] player The handle to the media player
2064  * @param[in] type The type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT
2065  * @param[out] index  The index of track
2066  * @return @c 0 on success,
2067  *         otherwise a negative error value
2068  * @retval #PLAYER_ERROR_NONE Successful
2069  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2070  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2071  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
2072  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
2073  */
2074 int player_get_current_track(player_h player, player_stream_type_e type, int *index);
2075
2076 /**
2077  * @brief Gets language code of a track.
2078  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
2079  * @remarks @a code must be released with @c free() by caller
2080  * @param[in] player The handle to the media player
2081  * @param[in] type The type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT
2082  * @param[in] index  The index of track
2083  * @param[out] code A language code in ISO 639-1. "und" will be returned if the language is undefined.
2084  * @return @c 0 on success,
2085  *         otherwise a negative error value
2086  * @retval #PLAYER_ERROR_NONE Successful
2087  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2088  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2089  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
2090  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
2091  */
2092 int player_get_track_language_code(player_h player, player_stream_type_e type, int index, char **code);
2093
2094 /**
2095  * @brief Gets the track count.
2096  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
2097  * @param[in] player The handle to the media player
2098  * @param[in] type The type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT
2099  * @param[out] count The number of track
2100  * @return @c 0 on success,
2101  *         otherwise a negative error value
2102  * @retval #PLAYER_ERROR_NONE Successful
2103  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2104  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2105  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
2106  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
2107  */
2108 int player_get_track_count(player_h player, player_stream_type_e type, int *count);
2109
2110 /**
2111  * @brief Selects a track to play.
2112  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
2113  * @param[in] player The handle to the media player
2114  * @param[in] type The type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT
2115  * @param[in] index  The index of track
2116  * @return @c 0 on success,
2117  *         otherwise a negative error value
2118  * @retval #PLAYER_ERROR_NONE Successful
2119  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2120  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2121  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
2122  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
2123  * @see player_get_current_track()
2124  */
2125 int player_select_track(player_h player, player_stream_type_e type, int index);
2126
2127 /**
2128  * @brief Retrieves all the streaming variant information.
2129  * @since_tizen 4.0
2130  * @remarks This API is used for adaptive streaming(hls/mpeg dash) only.
2131  * @param[in] player The handle to the media player
2132  * @param[in] callback The iteration callback function
2133  * @param[in] user_data The user data to be passed to the callback function
2134  * @return @c 0 on success,
2135  *         otherwise a negative error value
2136  * @retval #PLAYER_ERROR_NONE Successful
2137  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2138  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2139  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
2140  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
2141  * @see player_adaptive_variant_cb
2142  */
2143 int player_foreach_adaptive_variant(player_h player, player_adaptive_variant_cb callback, void *user_data);
2144
2145 /**
2146  * @brief Sets the maximum limit of the streaming variant.
2147  * @since_tizen 4.0
2148  * @remarks This API is used for adaptive streaming(hls/mpeg dash) only.
2149  * @remarks The bandwidth setting can only be applied if there is no width, height information at streaming variant header.
2150  *          Application can get all the variant information by calling player_foreach_adaptive_variant() function.
2151  * @remarks If there is no affordable stream for the condition, the minimum bandwidth stream will be selected.
2152  * @param[in] player The handle to the media player
2153  * @param[in] bandwidth The max bandwidth limit of the stream variant (default: -1)
2154  * @param[in] width The max width limit of the stream variant (deafult: -1)
2155  * @param[in] height The max height limit of the stream variant (deafult: -1)
2156  * @return @c 0 on success,
2157  *         otherwise a negative error value
2158  * @retval #PLAYER_ERROR_NONE Successful
2159  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2160  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2161  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
2162  * @see player_foreach_adaptive_variant()
2163  * @see player_get_max_adaptive_variant_limit()
2164  */
2165 int player_set_max_adaptive_variant_limit(player_h player, int bandwidth, int width, int height);
2166
2167 /**
2168  * @brief Gets the maximum limit of the streaming variant.
2169  * @since_tizen 4.0
2170  * @remarks This API is used for adaptive streaming(hls/mpeg dash) only.
2171  * @param[in] player The handle to the media player
2172  * @param[out] bandwidth The max bandwidth limit of the stream variant (default: -1)
2173  * @param[out] width The max width limit of the stream variant (deafult: -1)
2174  * @param[out] height The max height limit of the stream variant (deafult: -1)
2175  * @return @c 0 on success,
2176  *         otherwise a negative error value
2177  * @retval #PLAYER_ERROR_NONE Successful
2178  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2179  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
2180  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
2181  * @see player_foreach_adaptive_variant()
2182  * @see player_set_max_adaptive_variant_limit()
2183  */
2184 int player_get_max_adaptive_variant_limit(player_h player, int *bandwidth, int *width, int *height);
2185
2186 /**
2187  * @brief Sets the audio only mode.
2188  * @details This function is used to disable or enable video rendering during playback.
2189  * @since_tizen 4.0
2190  * @param[in] player       The handle to the media player
2191  * @param[in] audio_only   The new audio only status: (@c true = enable audio only, @c false = disable audio only)
2192  * @return @c 0 on success,
2193  *         otherwise a negative error value
2194  * @retval #PLAYER_ERROR_NONE                Successful
2195  * @retval #PLAYER_ERROR_INVALID_PARAMETER   Invalid parameter
2196  * @retval #PLAYER_ERROR_INVALID_OPERATION   Invalid operation
2197  * @retval #PLAYER_ERROR_INVALID_STATE       Invalid player state
2198  * @pre The player state must be one of: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
2199  * @see player_is_audio_only()
2200  */
2201 int player_set_audio_only(player_h player, bool audio_only);
2202
2203 /**
2204  * @brief Gets the audio only mode status.
2205  * @since_tizen 4.0
2206  * @param[in]  player      The handle to the media player
2207  * @param[out] audio_only  The current audio only status: (@c true = audio only enabled, @c false = audio only disabled)
2208  * @return @c 0 on success,
2209  *         otherwise a negative error value
2210  * @retval #PLAYER_ERROR_NONE                Successful
2211  * @retval #PLAYER_ERROR_INVALID_PARAMETER   Invalid parameter
2212  * @retval #PLAYER_ERROR_INVALID_OPERATION   Invalid operation
2213  * @pre The player state must be one of: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
2214  * @see player_set_audio_only()
2215  */
2216 int player_is_audio_only(player_h player, bool *audio_only);
2217
2218 /**
2219  * @brief Sets the streaming buffering time.
2220  * @since_tizen 4.0
2221  * @param[in] player       The handle to the media player
2222  * @param[in] prebuffer_ms The buffer time to start playback
2223  * @param[in] rebuffer_ms  The buffer time during playback if player enter pause state for buffering.
2224  * @return @c 0 on success,
2225  *         otherwise a negative error value
2226  * @retval #PLAYER_ERROR_NONE Successful
2227  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2228  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
2229  * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
2230  * @pre The player state must be #PLAYER_STATE_IDLE.
2231  * @see player_get_streaming_buffering_time()
2232  */
2233 int player_set_streaming_buffering_time(player_h player, int prebuffer_ms, int rebuffer_ms);
2234
2235 /**
2236  * @brief Gets the streaming buffering time.
2237  * @since_tizen 4.0
2238  * @param[in] player       The handle to the media player
2239  * @param[in] prebuffer_ms The buffer time to start playback
2240  * @param[in] rebuffer_ms  The buffer time during playback if player enter pause state for buffering.
2241  * @return @c 0 on success,
2242  *         otherwise a negative error value
2243  * @retval #PLAYER_ERROR_NONE Successful
2244  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
2245  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
2246  * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
2247  * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
2248  * @see player_get_streaming_buffering_time()
2249  */
2250 int player_get_streaming_buffering_time(player_h player, int *prebuffer_ms, int *rebuffer_ms);
2251
2252 /**
2253  * @}
2254  */
2255
2256 #ifdef __cplusplus
2257 }
2258 #endif
2259
2260 #endif /* __TIZEN_MEDIA_PLAYER_H__ */
2261