aa208205fb39c5ae7f9b64422f888a308b802a7f
[platform/core/multimedia/esplusplayer.git] / include / esplusplayer_capi / esplusplayer_capi.h
1 /**
2  * @file           esplusplayer_capi.h
3  * @brief          EsPlusPlayer api c version
4  * @interfacetype  Platform
5  * @privlevel      None-privilege
6  * @privilege      None
7  * @product        TV, AV, B2B
8  * @version        2.0
9  * @SDK_Support    N
10  * @remark         This is esplusplayer api header implemented as C style to
11  *                 avoid binary compatibility issues.
12  *
13  * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
14  * PROPRIETARY/CONFIDENTIAL
15  * This software is the confidential and proprietary
16  * information of SAMSUNG ELECTRONICS ("Confidential Information"). You shall
17  * not disclose such Confidential Information and shall use it only in
18  * accordance with the terms of the license agreement you entered into with
19  * SAMSUNG ELECTRONICS. SAMSUNG make no representations or warranties about the
20  * suitability of the software, either express or implied, including but not
21  * limited to the implied warranties of merchantability, fitness for a
22  * particular purpose, or non-infringement. SAMSUNG shall not be liable for any
23  * damages suffered by licensee as a result of using, modifying or distributing
24  * this software or its derivatives.
25  */
26
27 #ifndef __PLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
28 #define __PLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
29
30 #include "esplusplayer_capi/buffer.h"
31 #include "esplusplayer_capi/display.h"
32 #include "esplusplayer_capi/drm.h"
33 #include "esplusplayer_capi/error.h"
34 #include "esplusplayer_capi/espacket.h"
35 #include "esplusplayer_capi/event.h"
36 #include "esplusplayer_capi/state.h"
37 #include "esplusplayer_capi/stream.h"
38 #include "esplusplayer_capi/submitdatatype.h"
39 #include "esplusplayer_capi/submitstatus.h"
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 #include <stdint.h>
46
47 typedef void (*esplusplayer_error_cb)(const esplusplayer_error_type, void*);
48 typedef void (*esplusplayer_buffer_status_cb)(const esplusplayer_stream_type,
49                                               const esplusplayer_buffer_status,
50                                               void*);
51 typedef void (*esplusplayer_buffer_byte_status_cb)(
52     const esplusplayer_stream_type, const esplusplayer_buffer_status, uint64_t,
53     void*);
54 typedef void (*esplusplayer_buffer_time_status_cb)(
55     const esplusplayer_stream_type, const esplusplayer_buffer_status, uint64_t,
56     void*);
57 typedef void (*esplusplayer_resource_conflicted_cb)(void*);
58 typedef void (*esplusplayer_eos_cb)(void*);
59 typedef void (*esplusplayer_ready_to_prepare_cb)(const esplusplayer_stream_type,
60                                                  void*);
61 typedef void (*esplusplayer_prepare_async_done_cb)(bool, void*);
62 typedef void (*esplusplayer_seek_done_cb)(void*);
63 typedef void (*esplusplayer_ready_to_seek_cb)(const esplusplayer_stream_type,
64                                               const uint64_t, void*);
65 typedef void (*esplusplayer_media_packet_video_decoded_cb)(
66     const esplusplayer_decoded_video_packet*, void*);
67 typedef void (*esplusplayer_closed_caption_cb)(const char* data, const int size,
68                                                void* userdata);
69 typedef void (*esplusplayer_flush_done_cb)(void*);
70 typedef void (*esplusplayer_event_cb)(const esplusplayer_event_type,
71                                       const esplusplayer_event_msg, void*);
72
73 typedef void* esplusplayer_handle;
74
75 /**
76  * @brief  Enumerations for the Adaptive info type
77  */
78 typedef enum {
79   ESPLUSPLAYER_ADAPT_INFO_TYPE_NONE,
80   ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_FRAMES,
81   ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_VIDEO_FRAMES_FOR_CATCHUP,
82   ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_AUDIO_FRAMES_FOR_CATCHUP,
83 } esplusplayer_adaptive_info_type;
84
85 /**
86  * @brief   Enumerations for low latency mode
87  * @remark  Public supports #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL only.
88  */
89 typedef enum {
90   ESPLUSPLAYER_LOW_LATENCY_MODE_NONE = 0x0000,
91   /**
92    * @description   to support audio fast decoding/rendering
93    */
94   ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO = 0x0001,
95   /**
96    * @description   to support video fast decoding/rendering
97    *                Video stream should be composed only of P and I frames.
98    *                The mode support seamless resolution change since tizen 6.5
99    */
100   ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO = 0x0010,
101   /**
102    * @description   to support video fast decoding/rendering and video
103    *                distortion concealment.
104    *                Video stream should be composed only of P and I frames.
105    *                For applications using the UDP protocol, packet loss can
106    *                occur. when video distortion by video packet loss is
107    *                detected, it is a function to conceal distortion by showing
108    *                previous video frame. It is supported only in h.264 codec &
109    *                FHD or lower resolution.
110    */
111   ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO_DISTORTION_CONCEALMENT =
112       ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO | 0x0020,
113   /**
114    * @description   to disable clock sync and a/v sync when rendering. it
115    *                includes #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL.
116    */
117   ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC = 0x0100,
118   /**
119    * @description   to disable preroll which means player doesn't wait for
120    *                first buffer when state is changed to
121    *                #ESPLUSPLAYER_STATE_READY from #ESPLUSPLAYER_STATE_IDLE.
122    *                It changes the state immediately.
123    *                It's usually used for sparse stream. (e.g. video packet
124    *                arrives but audio packet doesn't yet.)
125    */
126   ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL = 0x0200,
127   /**
128    * @deprecated    Deprecated since tizen 6.5
129    * @description   to set lower video quality
130    *                If set this value, it can use original game_mode.
131    *                This value will be deprecated from 2022TV.
132    *                Please use ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE.
133    */
134   ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY = 0x1000,
135   /**
136    * @description   to set game mode for minimum latency
137    *                Video stream should be composed only of P and I frames.
138    *                It must not be used together with
139    *                #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
140    *                If use this value, It can expect better latency performance
141    *                than #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
142    *                The mode support seamless resolution change.
143    *                The mode use lower video quality.
144    */
145   ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE =
146       ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO |
147       ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO | 0x2000,
148   /**
149    * @description   to set game mode for latency
150    *                Video stream should be composed only of P and I frames.
151    *                Video stream must use fixed resolution.
152    *                It must not be used together with
153    *                #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
154    *                If use this value, It can expect better latency
155    *                performance than
156    *                #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY and
157    *                #ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE
158    *                The mode use lower video quality.
159    */
160   ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE_WITH_FIXED_RESOLUTION =
161       ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE | 0x4000,
162 } esplusplayer_low_latency_mode;
163
164 /**
165  * @brief   Enumerations for esplusplayer audio codec type
166  */
167 typedef enum {
168   /**
169    * @description   hardware codec can only be selected, default type
170    */
171   ESPLUSPLAYER_AUDIO_CODEC_TYPE_HW,
172   /**
173    * @description   software codec can only be selected
174    */
175   ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW,
176   ESPLUSPLAYER_AUDIO_CODEC_TYPE_MAX
177 } esplusplayer_audio_codec_type;
178
179 /**
180  * @brief   Enumerations for esplusplayer video codec type
181  */
182 typedef enum {
183   /**
184    * @description   hardware codec can only be selected, default type
185    */
186   ESPLUSPLAYER_VIDEO_CODEC_TYPE_HW,
187   /**
188    * @description   software codec can only be selected
189    */
190   ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW,
191   /**
192   * @description   hardware codec using n-decoding mode can only be selected.
193                    It must set display type to mixer type by display setting
194   api.
195                    esplusplayer_set_display()
196   */
197   ESPLUSPLAYER_VIDEO_CODEC_TYPE_HW_N_DECODING,
198   ESPLUSPLAYER_VIDEO_CODEC_TYPE_MAX
199
200 } esplusplayer_video_codec_type;
201 /**
202  * @brief   Enumerations for esplusplayer audio easing type
203  * @version 3.0
204  */
205 typedef enum {
206   /**
207    * @description audio easing function type is linear
208    */
209   ESPLUSPLAYER_AUDIO_EASING_LINEAR,
210   /**
211    * @description audio easing function type is incubic
212    */
213   ESPLUSPLAYER_AUDIO_EASING_INCUBIC,
214   /**
215    * @description audio easing function type is outcubic
216    */
217   ESPLUSPLAYER_AUDIO_EASING_OUTCUBIC,
218   /**
219    * @description audio easing function type is none
220    */
221   ESPLUSPLAYER_AUDIO_EASING_NONE
222 } esplusplayer_audio_easing_type;
223
224 /**
225  * @brief   Enumerations for esplusplayer resource type
226  * @version 3.0
227  */
228 typedef enum {
229   /**
230    * @description video renderer type
231    */
232   ESPLUSPLAYER_RSC_TYPE_VIDEO_RENDERER
233 } esplusplayer_rsc_type;
234
235 /**
236  * @brief   Enumerations for advanced video quality type
237  * @version 3.1
238  */
239 typedef enum {
240   /**
241    * @description advanced picture quality for video call
242    */
243   ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_VIDEO_CALL,
244   /**
245    * @description advanced picture quality for usb camera
246    */
247   ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_USB_CAMERA
248 } esplusplayer_advanced_picture_quality_type;
249
250 typedef struct {
251   /**
252    * @description   the minimum frame number in case of mid latency
253    */
254   int mid_latency_threshold;
255   /**
256    * @description   the minimum frame number in case of high latency
257    */
258   int high_latency_threshold;
259 } esplusplayer_latency_threshold;
260
261 /**
262  * @brief  rational number numerator/denominator
263  */
264 typedef struct {
265   /**
266    * @description   the numerator value
267    */
268   int num;
269   /**
270    * @description   the denominator value
271    */
272   int den;
273 } esplusplayer_rational;
274
275 /**
276  * @brief  resource allocate policy
277  */
278 typedef enum {
279   /**
280    * @description exclusive policy, RM will return the requested resources,
281    * default policy
282    */
283   ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE = 0,
284   /**
285    * @description conditional policy, when trying to allocate resources and
286    * available resources are not left, RM will return fail.
287    */
288   ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE_CONDITIONAL
289 } esplusplayer_rsc_alloc_policy;
290
291 /**
292  * @brief     Create a esplusplayer handle.
293  * @param     None
294  * @return    return esplusplayer handle pointer.
295  * @code
296  *            esplusplayer_handle esplayer = esplusplayer_create();
297  *            // ... your codes ...
298  *            esplusplayer_destroy(esplayer);
299  * @endcode
300  * @pre       None
301  * @post      The player state will be #ESPLUSPLAYER_STATE_NONE.
302  * @exception None
303  */
304 esplusplayer_handle esplusplayer_create();
305
306 /**
307  * @brief     Open esplusplayer handle.
308  * @param     [in] handle : esplusplayer handle
309  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
310  *            values will be returned.
311  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
312  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
313  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
314  * @code
315  *            esplusplayer_handle esplayer = esplusplayer_create();
316  *            esplusplayer_open(esplayer);
317  *            // ... your codes ...
318  *            esplusplayer_close(esplayer);
319  *            esplusplayer_destroy(esplayer);
320  * @endcode
321  * @pre       The player state must be #ESPLUSPLAYER_STATE_NONE.
322  * @post      The player state will be #ESPLUSPLAYER_STATE_IDLE.
323  * @exception None
324  * @see       esplusplayer_close()
325  */
326 int esplusplayer_open(esplusplayer_handle handle);
327
328 /**
329  * @brief     Release all the player resources and all setting except callback
330  *            functions.
331  * @param     [in] handle : esplusplayer handle.
332  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
333  *            values will be returned.
334  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
335  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
336  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
337  * @pre       The player state must be all of #esplusplayer_state except
338  *            #ESPLUSPLAYER_STATE_NONE.
339  * @post      The player state will be #ESPLUSPLAYER_STATE_NONE.
340  * @exception None
341  * @see       esplusplayer_open()
342  */
343 int esplusplayer_close(esplusplayer_handle handle);
344
345 /**
346  * @brief     Release player handle.
347  * @param     [in] handle : esplusplayer handle.
348  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
349  *            values will be returned.
350  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
351  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
352  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
353  * @code
354  *            refer to the sample code of esplusplayer_create()
355  * @endcode
356  * @pre       The player state must be #ESPLUSPLAYER_STATE_NONE
357  * @post      player handle will be removed.
358  * @exception None
359  * @see       esplusplayer_create()
360  */
361 int esplusplayer_destroy(esplusplayer_handle handle);
362
363 /**
364  * @brief     Flush the specific buffered stream data and release TV resource
365  *            to change stream.
366  * @remark    To activate, the stream must be set again.
367  * @param     [in] handle : esplusplayer handle.
368  * @param     [in] type : stream type which user want to deactivate.
369  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
370  *            values will be returned.
371  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
372  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
373  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
374  * @code
375               refer to the sample code of esplusplayer_activate()
376  * @endcode
377  * @pre       The player state must be at least #ESPLUSPLAYER_STATE_READY
378  * @post      The player state is same as before calling
379  *            esplusplayer_deactivate(). The deactivated stream will stop
380  *            rendering and release the decoder, renderer resources.
381  * @exception None
382  * @see       esplusplayer_activate
383  */
384 int esplusplayer_deactivate(esplusplayer_handle handle,
385                             esplusplayer_stream_type type);
386
387 /**
388  * @brief     Reprepare for the specific stream playback.
389  * @remark    There must be active stream to prepare playback.
390  * @param     [in] handle : esplusplayer handle.
391  * @param     [in] type : stream type which user want to activate.
392  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
393  *            values will be returned.
394  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
395  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
396  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
397  * @code
398  *            prepare esplayer done
399  *            // ... your codes ...
400  *            esplusplayer_deactivate(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
401  *            esplusplayer_video_stream_info stream;
402  *            stream.width = 640;
403  *            stream.height = 352;
404  *            stream.mime_type = ESPLUSPLAYER_VIDEO_MIME_TYPE_H264;
405  *            stream.framerate_num = 30;
406  *            stream.framerate_den = 1;
407  *            esplusplayer_set_video_stream_info(esplayer, &stream);
408  *            esplusplayer_activate(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
409  *            // ... your codes ...
410  *            esplusplayer_close(esplayer);
411  *            esplusplayer_destroy(esplayer);
412  * @endcode
413  * @pre       The player state must be at least #ESPLUSPLAYER_STATE_READY
414  * @post      The player state is same as before calling
415  *            esplusplayer_activate(). Rebuild pipeline to render the stream.
416  * @exception None
417  * @see       esplusplayer_prepare_async()
418  */
419 int esplusplayer_activate(esplusplayer_handle handle,
420                           esplusplayer_stream_type type);
421
422 /**
423  * @brief     Prepare the player for playback, asynchronously.
424  * @param     [in] handle : esplusplayer handle.
425  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
426  *            values will be returned.
427  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
428  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
429  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
430  * @code
431  *            static void OnPrepareDone(bool ret, void* userdata) {
432  *                //Something you want to do when prepare done, but, we strongly
433  *                //recommend DO NOT CALL PLAYER APIs in this callback
434  *                printf("OnPrepareDone\n");
435  *            }
436  *            esplusplayer_handle esplayer = esplusplayer_create();
437  *            esplusplayer_set_prepare_async_done_cb(esplayer, OnPrepareDone,nullptr);
438  *            esplusplayer_open(esplayer);
439  *            esplusplayer_prepare_async(esplayer);
440  *            // ... your codes ...
441  *            esplusplayer_close(esplayer);
442  *            esplusplayer_destroy(esplayer);
443  * @endcode
444  * @pre       The player state must be #ESPLUSPLAYER_STATE_IDLE. \n
445  *            Call at least one of esplusplayer_set_video_stream_info() or
446  *            esplusplayer_set_audio_stream_info(). \n
447  * @post      It invokes esplusplayer_prepare_async_done_cb() when prepare is
448  *            finished. \n
449  *            Prepare result can be succeeded or not at this moment. \n
450  *            If the result is succeeded, the player state will be
451  *            #ESPLUSPLAYER_STATE_READY and one frame will be displayed
452  *            unless esplusplayer_set_display_visible() is set to @c false.
453  * @exception None
454  * @remark    esplusplayer_prepare_async_done_cb() can be invoked only when as
455  *            many es packets as at least one decoded frame is submitted. \n
456  *            The player can receive es packets after
457  *            esplusplayer_ready_to_seek_cb() is called.
458  * @see       esplusplayer_open() \n
459  *            esplusplayer_stop() \n
460  *            esplusplayer_submit_packet() \n
461  *            esplusplayer_ready_to_prepare_cb() \n
462  *            esplusplayer_close()
463  */
464 int esplusplayer_prepare_async(esplusplayer_handle handle);
465
466 /**
467  * @brief     Start playback.
468  * @param     [in] handle : esplusplayer handle.
469  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
470  *            values will be returned.
471  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
472  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
473  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
474  * @code
475  *            prepare esplayer done
476  *            esplusplayer_start(esplayer);
477  *            // ... your codes ...
478  *            esplusplayer_stop(esplayer);
479  * @endcode
480  * @pre       The player state should be #ESPLUSPLAYER_STATE_READY.
481  * @post      The player state will be #ESPLUSPLAYER_STATE_PLAYING.
482  * @exception None
483  * @see       esplusplayer_open() \n
484  *            esplusplayer_prepare_async() \n
485  *            esplusplayer_stop() \n
486  *            esplusplayer_close()
487  */
488 int esplusplayer_start(esplusplayer_handle handle);
489
490 /**
491  * @brief     Stop playing media content.
492  * @param     [in] handle : esplusplayer handle.
493  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
494  *            values will be returned.
495  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
496  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
497  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
498  * @code
499  *            prepare esplayer done
500  *            // ... your codes ...
501  *            esplusplayer_stop(esplayer);
502  *             // ... your codes ...
503  *            esplusplayer_close(esplayer);
504  * @endcode
505  * @pre       The player state must be all of #esplusplayer_state except
506  *            #ESPLUSPLAYER_STATE_NONE.
507  * @post      The player state will be #ESPLUSPLAYER_STATE_IDLE.
508  * @exception None
509  * @remark    esplusplayer_close() must be called once after player is stopped
510  * @see       esplusplayer_open() \n
511  *            esplusplayer_prepare_async() \n
512  *            esplusplayer_start() \n
513  *            esplusplayer_pause() \n
514  *            esplusplayer_resume() \n
515  *            esplusplayer_close()
516  */
517 int esplusplayer_stop(esplusplayer_handle handle);
518
519 /**
520  * @brief     Pause playing media content.
521  * @param     [in] handle : esplusplayer handle.
522  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
523  *            values will be returned.
524  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
525  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
526  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
527  * @code
528  *            prepare esplayer done
529  *            // ... your codes ...
530  *            esplusplayer_pause(esplayer);
531  *            // ... your codes ...
532  *            esplusplayer_stop(esplayer);
533  * @endcode
534  * @pre       The player state must be one of #ESPLUSPLAYER_STATE_READY or
535  *            #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
536  * @post      The player state will be #ESPLUSPLAYER_STATE_PAUSE.
537  * @exception None
538  * @see       esplusplayer_start() \n
539  *            esplusplayer_resume() \n
540  *            esplusplayer_prepare_async()
541  */
542 int esplusplayer_pause(esplusplayer_handle handle);
543
544 /**
545  * @brief     Resume playing media content.
546  * @param     [in] handle : esplusplayer handle.
547  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
548  *            values will be returned.
549  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
550  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
551  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
552  * @code
553  *            prepare esplayer done
554  *            // ... your codes ...
555  *            esplusplayer_pause(esplayer);
556  *            // ... your codes ...
557  *            esplusplayer_resume(esplayer);
558  *            // ... your codes ...
559  *            esplusplayer_stop(esplayer);
560  * @endcode
561  * @pre       The player state must be one of #ESPLUSPLAYER_STATE_PAUSED or
562  *            #ESPLUSPLAYER_STATE_PLAYING.
563  * @post      The player state will be #ESPLUSPLAYER_STATE_PLAYING.
564  * @exception None
565  * @see       esplusplayer_start() \n
566  *            esplusplayer_pause() \n
567  *            esplusplayer_prepare_async()
568  */
569 int esplusplayer_resume(esplusplayer_handle handle);
570
571 /**
572  * @brief     Set playback rate.
573  * @param     [in] handle : esplusplayer handle.
574  * @param     [in] playback_rate :  the playback rate from 0.0 to 2.0.
575  * @param     [in] audio_mute :  the audio is mute on/off, true: mute on, false:
576  * mute off.
577  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
578  *            values will be returned.
579  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
580  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
581  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
582  * @code
583  *            prepare esplayer done
584  *            // ... your codes ...
585  *            esplusplayer_set_playback_rate(esplayer,2,true);
586  *            // ... your codes ...
587  *            esplusplayer_stop(esplayer);
588  * @endcode
589  * @pre       The player state must be one of #ESPLUSPLAYER_STATE_READY or
590  *            #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING. \n
591  *            User has to push the data as fast as playback rate.
592  * @post      None
593  * @exception None
594  * @see       esplusplayer_prepare_async()
595  */
596 int esplusplayer_set_playback_rate(esplusplayer_handle handle,
597                                    const double playback_rate,
598                                    const bool audio_mute);
599
600 /**
601  * @brief     Seek for playback, asynchronously.
602  * @param     [in] handle : esplusplayer handle.
603  * @param     [in] time_ms : seek time in milliseconds
604  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
605  *            values will be returned.
606  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
607  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
608  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
609  * @code
610  *            prepare esplayer done
611  *            // ... your codes ...
612  *            const uint64_t ms_to_seek = 0;
613  *            esplusplayer_seek(esplayer,ms_to_seek);
614  *            // ... your codes ...
615  *            esplusplayer_stop(esplayer);
616  * @endcode
617  * @pre       The player state must be one of #ESPLUSPLAYER_STATE_READY or
618  *            #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
619  *            In ESPLUSPLAYER_STATE_IDLE, this api can be called exceptionally
620  *            between esplusplayer_open() and esplusplayer_prepare_async().
621  *            the start time of playback can be set explicitly when starting
622  *            first playback. In this case, esplusplayer_set_seek_done_cb is not
623  *            called.
624  * @post      None
625  * @exception None
626  * @remark    esplusplayer_set_seek_done_cb() will be invoked if seek operation
627  *            is finished. \n
628  *            Seek result can be succeeded or not at this moment. \n
629  *            esplusplayer_set_seek_done_cb() can be invoked only when as many
630  *            es packets as at least one decoded frame is submitted. \n
631  *            The player can receive es packets from seek time after
632  *            esplusplayer_ready_to_seek_cb() is invoked.
633  * @see       esplusplayer_ready_to_seek_cb() \n
634  *            esplusplayer_prepare_async()
635  */
636 int esplusplayer_seek(esplusplayer_handle handle, uint64_t time_ms);
637
638 /**
639  * @brief     Set the video display.
640  * @param     [in] handle : esplusplayer handle.
641  * @param     [in] type : display type.
642  * @param     [in] window : the handle to display window.
643  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
644  *            values will be returned.
645  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
646  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
647  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
648  * @code
649  *            esplusplayer_open(esplayer);
650  *            esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
651  *            // ... your codes ...
652  *            esplusplayer_close(esplayer);
653  * @endcode
654  * @pre       The player state must be #ESPLUSPLAYER_STATE_IDLE.
655  * @post      None
656  * @exception None
657  * @remark    Esplusplayer is not supporting changing display. \n
658  *            This API have to be called before calling
659  *            esplusplayer_prepare_async() to reflect the display type.
660  * @see       esplusplayer_open() \n
661  *            esplusplayer_set_display_mode() \n
662  *            esplusplayer_set_display_roi() \n
663  *            esplusplayer_set_display_visible()
664  */
665 int esplusplayer_set_display(esplusplayer_handle handle,
666                              esplusplayer_display_type type, void* window);
667
668 #ifdef TIZEN_FEATURE_TV
669 /**
670  * @brief     Set the video display.
671  * @param     [in] handle : esplusplayer handle.
672  * @param     [in] type : display type.
673  * @param     [in] subsurface : the ecore wayland subsurface handle.
674  * @param     [in] x : the x coordinate of subsurface.
675  * @param     [in] y : the y coordinate of subsurface.
676  * @param     [in] width : the width of subsurface.
677  * @param     [in] height : the height of subsurface.
678  * @return    @c one of esplusplayer_error_type values will be returned.
679  * @pre       The player state must be #ESPLUSPLAYER_STATE_IDLE.
680  * @post      None
681  * @exception   None
682  * @version   3.1
683  * @see       esplusplayer_set_display_mode() \n
684  *            esplusplayer_set_display_roi() \n
685  *            esplusplayer_set_display_visible()
686  */
687 int esplusplayer_set_display_ecore_subsurface(esplusplayer_handle handle,
688                                               esplusplayer_display_type type,
689                                               void* subsurface, int x, int y,
690                                               int width, int height);
691 #endif
692
693 /**
694  * @brief     Set the video display mode.
695  * @param     [in] handle : esplusplayer handle.
696  * @param     [in] mode : display mode.
697  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
698  *            values will be returned.
699  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
700  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
701  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
702  * @code
703  *            esplusplayer_open(esplayer);
704  *            esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
705  *            // ... your codes ...
706  *            esplusplayer_close(esplayer);
707  * @endcode
708  * @pre       The player state can be all of #esplusplayer_state except
709  *            #ESPLUSPLAYER_STATE_NONE.
710  * @post      None
711  * @exception None
712  * @remark    If no display is set, no operation is performed.
713  * @see       esplusplayer_open() \n
714  *            esplusplayer_set_display_mode() \n
715  *            esplusplayer_set_display_roi() \n
716  *            esplusplayer_set_display_visible()
717  */
718 int esplusplayer_set_display_mode(esplusplayer_handle handle,
719                                   esplusplayer_display_mode mode);
720
721 /**
722  * @brief     Set the ROI(Region Of Interest) area of display.
723  * @param     [in] handle : esplusplayer handle.
724  * @param     [in] x : var startPointX in src video area.
725  * @param     [in] y : var startPointY in src video area.
726  * @param     [in] width : width of display in src video area.
727  * @param     [in] height : height of display in src video area.
728  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
729  *            values will be returned.
730  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
731  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
732  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
733  * @code
734  *            esplusplayer_open(esplayer);
735  *            esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
736  *            esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
737  *            esplusplayer_set_display_roi(esplayer,0,0,600,500);
738  *            // ... your codes ...
739  *            esplusplayer_close(esplayer);
740  * @endcode
741  * @pre       The player state can be all of #esplusplayer_state except
742  *            #ESPLUSPLAYER_STATE_NONE. \n
743  *            Before set display ROI, #ESPLUSPLAYER_DISPLAY_MODE_DST_ROI
744  *            must be set with esplusplayer_set_display_mode().
745  * @post      None
746  * @exception None
747  * @remark    The minimum value of width and height are 1.
748  * @see       esplusplayer_open() \n
749  *            esplusplayer_set_display() \n
750  *            esplusplayer_set_display_mode() \n
751  *            esplusplayer_set_display_visible()
752  */
753 int esplusplayer_set_display_roi(esplusplayer_handle handle, int x, int y,
754                                  int width, int height);
755
756 /**
757  * @brief     Set the Crop Area(Region Of Src ratio) area of display.
758  * @param     [in] handle : esplusplayer handle.
759  * @param     [in] scale_x: x label ratio in src video area.
760  * @param     [in] scale_y: y label ratio in src video area.
761  * @param     [in] scale_w: width ratio in src video area.
762  * @param     [in] scale_h: height ratio in src video area.
763  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
764  *            values will be returned.
765  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
766  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
767  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
768  * @code
769  *            esplusplayer_open(esplayer);
770  *            esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
771  *            esplusplayer_set_video_roi(esplayer,0,0,0.5,0.5);
772  *            // ... your codes ...
773  *            esplusplayer_close(esplayer);
774  * @endcode
775  * @pre       The player state can be all of #esplusplayer_state except
776  *            #ESPLUSPLAYER_STATE_NONE. \n
777  * @post      None
778  * @exception None
779  * @remark    The minimum value of input are 0,maximum value is 1.
780  * @see       esplusplayer_open() \n
781  *            esplusplayer_set_display() \n
782  *            esplusplayer_set_display_visible()
783  */
784 int esplusplayer_set_video_roi(esplusplayer_handle handle, double scale_x,
785                                double scale_y, double scale_w, double scale_h);
786
787 /**
788  * @brief     Set the visibility of the video display.
789  * @param     [in] handle : esplusplayer handle.
790  * @param     [in] visible : the visibility of the display.
791  *            (@c true = visible, @c false = non-visible)
792  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
793  *            values will be returned.
794  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
795  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
796  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
797  * @code
798  *            esplusplayer_open(esplayer);
799  *            esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
800  *            esplusplayer_set_display_visible(esplayer,false);
801  *            // ... your codes ...
802  *            esplusplayer_close(esplayer);
803  * @endcode
804  * @pre       The player state can be all of #esplusplayer_state except
805  *            #ESPLUSPLAYER_STATE_NONE.
806  * @post      None
807  * @exception   None
808  * @see       esplusplayer_open() \n
809  *            esplusplayer_set_display()
810  */
811 int esplusplayer_set_display_visible(esplusplayer_handle handle, bool visible);
812
813 /**
814  * @brief     Set the rotate angle of the video display.
815  * @param     [in] handle : esplusplayer handle.
816  * @param     [in] rotation : the rotate angle of the display.
817  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
818  *            values will be returned.
819  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
820  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
821  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
822  * @code
823  *            esplusplayer_open(esplayer);
824  *            esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
825  *            esplusplayer_set_display_rotation(esplayer_,ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_90);
826  *            // ... your codes ...
827  *            esplusplayer_close(esplayer);
828  * @endcode
829  * @pre       The player state can be all of #esplusplayer_state except
830  *            #ESPLUSPLAYER_STATE_NONE.
831  * @post      this API worked only when video sink created.
832  * @exception None
833  * @see       esplusplayer_open() \n
834  *            esplusplayer_set_display()
835  */
836 int esplusplayer_set_display_rotation(
837     esplusplayer_handle handle, esplusplayer_display_rotation_type rotation);
838
839 /**
840  * @brief     Get the rotate angle of the video display.
841  * @param     [in] handle : esplusplayer handle.
842  * @param     [out] rotation : the rotate angle of the display which want to
843  * get.
844  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
845  *            values will be returned.
846  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
847  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
848  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
849  * @code
850  *            esplusplayer_open(esplayer);
851  *            esplusplayer_set_display_rotation(esplayer,ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_90);
852  *            esplusplayer_display_rotation_type rotation_get = ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_NONE;
853  *            // ... your codes ...
854  *            esplusplayer_get_display_rotation(esplayer,&rotation_get);
855  *            // ... your codes ...
856  *            esplusplayer_close(esplayer);
857  * @endcode
858  * @pre       The player state can be all of #esplusplayer_state except
859  *            #ESPLUSPLAYER_STATE_NONE.
860  * @post      this API worked only when video sink created.
861  * @exception None
862  * @see       esplusplayer_open() \n
863  *            esplusplayer_set_display_rotation()
864  */
865 int esplusplayer_get_display_rotation(
866     esplusplayer_handle handle, esplusplayer_display_rotation_type* rotation);
867
868 /**
869  * @brief     Set whether to send decrypted es packets in the trust zone or
870  *            encrypted es packets.
871  * @param     [in] handle : esplusplayer handle.
872  * @param     [in] type : whether to use trust zone memory or encrypted data
873  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
874  *            values will be returned.
875  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
876  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
877  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
878  * @code
879  *            esplusplayer_open(esplayer);
880  *            esplusplayer_set_submit_data_type(esplayer,ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA);
881  *            // ... your codes ...
882  *            esplusplayer_close(esplayer);
883  * @endcode
884  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
885  * @post      None
886  * @exception None
887  * @remark    This API have to be called before calling
888  *            esplusplayer_prepare_async(). \n
889  *            If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA use
890  *            esplusplayer_submit_packet() to send clean packets. \n
891  *            If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA, use
892  *            esplusplayer_submit_encrypted_packet() to send encrypted packets.
893  * @see       esplusplayer_open() \n
894  *            esplusplayer_submit_encrypted_packet() \n
895  *            esplusplayer_submit_data_type
896  */
897 int esplusplayer_set_submit_data_type(esplusplayer_handle handle,
898                                       esplusplayer_submit_data_type type);
899
900 /**
901  * @brief     Set on mute of the audio sound.
902  * @param     [in] handle : esplusplayer handle.
903  * @param     [in] mute : on mute of the sound.
904  *            (@c true = mute, @c false = non-mute)
905  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of esplusplayer_error_type
906  *            values will be returned.
907  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
908  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
909  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
910  * @code
911  *            esplusplayer_open(esplayer);
912  *            esplusplayer_set_audio_mute(esplayer, true);
913  *            // ... your codes ...
914  *            esplusplayer_close(esplayer);
915  * @endcode
916  * @pre       The player state can be all of #esplusplayer_state except
917  *            #ESPLUSPLAYER_STATE_NONE.
918  * @post      None
919  * @exception None
920  * @see       esplusplayer_open()
921  */
922 int esplusplayer_set_audio_mute(esplusplayer_handle handle, bool mute);
923
924 /**
925  * @brief     Get current state of player.
926  * @param     [in] handle : esplusplayer handle.
927  * @return    current #esplusplayer_state of player.
928  * @code
929  *            esplusplayer_handle esplayer = esplusplayer_create();
930  *            // ... your codes ...
931  *            esplusplayer_state ret = esplusplayer_get_state(esplayer);
932  *            // ... your codes ...
933  *            esplusplayer_destroy(esplayer);
934  * @endcode
935  * @pre       None
936  * @post      None
937  * @exception None
938  */
939 esplusplayer_state esplusplayer_get_state(esplusplayer_handle handle);
940
941 /**
942  * @brief     Submit es packet to decode audio or video.
943  * @param     [in] handle : esplusplayer handle.
944  * @param     [in] packet : es packet pointer.
945  * @return    @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
946  *            packet,
947  *            otherwise @c : fail to submit es packet.
948  * @code
949  *            static void OnPrepareDone(bool ret, void* userdata) {
950  *                // ... your codes ...
951  *                printf ("OnPrepareDone\n");
952  *            }
953  *            static void OnReadyToPrepare(const esplusplayer_stream_type type,void* userdata) {
954  *                if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
955  *                    //Something you want to do when feed es video stream is allowed
956  *                } else {
957  *                    //Something you want to do when feed es audio stream is allowed
958  *                }
959  *                //Something you want to do when OnReadyToPrepare
960  *                printf ("OnReadyToPrepare\n");
961  *            }
962  *            static void OnBufferByteStatus(const esplusplayer_stream_type type,
963  *                                           const esplusplayer_buffer_status status,
964  *                                           uint64_t byte_size, void* userdata) {
965  *                if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
966  *                    if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
967  *                        //Something you want to do when es video buffer is enough
968  *                    } else {
969  *                        //Something you want to do when es video buffer is not enough
970  *                    }
971  *                } else {
972  *                    if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
973  *                        //Something you want to do when es audio buffer is enough
974  *                    } else {
975  *                        //Something you want to do when es audio buffer is not enough
976  *                    }
977  *                }
978  *                //Something you want to do when OnBufferByteStatus
979  *                printf ("OnBufferByteStatus\n");
980  *            }
981  *            static void OnBufferTimeStatus(const esplusplayer_stream_type type,
982  *                                           const esplusplayer_buffer_status status,
983  *                                           uint64_t time_size,void* userdata) {
984  *                if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
985  *                    if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
986  *                        //Something you want to do when es video buffer is enough
987  *                    } else {
988  *                        //Something you want to do when es video buffer is not enough
989  *                    }
990  *                } else {
991  *                    if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
992  *                        //Something you want to do when es audio buffer is enough
993  *                    } else {
994  *                        //Something you want to do when es audio buffer is not enough
995  *                    }
996  *                }
997  *                //Something you want to do when OnBufferTimeStatus
998  *                printf ("OnBufferTimeStatus\n");
999  *            }
1000  *            void FeedEsPacket(esplusplayer_handle player,esplusplayer_es_packet pkt) {
1001  *               // ... your codes ...
1002  *               if(feed is allowed && buffer is enough) {
1003  *                   esplusplayer_submit_packet(player, &pkt);
1004  *               }
1005  *               // ... your codes ...
1006  *           )
1007  *            esplusplayer_handle esplayer = esplusplayer_create();
1008  *            esplusplayer_set_prepare_async_done_cb(esplayer,OnPrepareDone,&esplayer);
1009  *            esplusplayer_set_ready_to_prepare_cb(esplayer,OnReadyToPrepare,&esplayer);
1010  *            esplusplayer_set_buffer_byte_status_cb(esplayer,OnBufferByteStatus,&esplayer);
1011  *            esplusplayer_set_buffer_time_status_cb(esplayer,OnBufferTimeStatus,&esplayer);
1012  *            esplusplayer_open(esplayer);
1013  *            esplusplayer_prepare_async(esplayer);
1014  *            // ... your codes ...
1015  *            //FeedEsPacket()(call a new thread to do this)
1016  *            // ... your codes ...
1017  *            esplusplayer_close(esplayer);
1018  *            esplusplayer_destroy(esplayer);
1019  * @endcode
1020  * @pre       User can submit es packets after
1021  *            esplusplayer_ready_to_prepare_cb() or
1022  *            esplusplayer_ready_to_seek_cb() is called.
1023  * @post      None
1024  * @exception None
1025  * @remark    Amount of packets for at least one decoded frame must be submitted
1026  *            after calling esplusplayer_prepare_async() or esplusplayer_seek()
1027  *            for invoking esplusplayer_prepare_async_done_cb() or
1028  *            esplusplayer_seek_done_cb() \n
1029  *            This api must be called from a different thread than other apis.
1030  * @see       esplusplayer_set_submit_data_type() \n
1031  *            esplusplayer_es_packet \n
1032  *            esplusplayer_buffer_status_cb() \n
1033  *            esplusplayer_ready_to_prepare_cb() \n
1034  *            esplusplayer_ready_to_seek_cb()
1035  */
1036 esplusplayer_submit_status esplusplayer_submit_packet(
1037     esplusplayer_handle handle, esplusplayer_es_packet* packet);
1038
1039 #ifdef TIZEN_FEATURE_TV
1040 /**
1041  * @brief     Submit encrypted es packet to decode and decrypt audio or video.
1042  * @param     [in] handle : esplusplayer handle.
1043  * @param     [in] packet : es packet pointer.
1044  * @param     [in] drm_info : information to decrypt es packet.
1045  *                            esplusplayer doesn't take ownership. user should
1046  *                            free it. if you deliver it as (null), this api
1047  *                            works as esplusplayer_submit_packet().
1048  * @return    @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1049  *            packet,
1050  *            otherwise @c : fail to submit es packet.
1051  * @code
1052  *            refer to the sample code of esplusplayer_submit_packet();
1053  * @endcode
1054  * @pre       User can submit es packets after
1055  *            esplusplayer_ready_to_prepare_cb() or
1056  *            esplusplayer_ready_to_seek_cb() is called.
1057  * @post      None
1058  * @exception None
1059  * @remark    Amount of packets for at least one decoded frame must be submitted
1060  *            after calling esplusplayer_prepare_async() or esplusplayer_seek()
1061  *            for invoking esplusplayer_prepare_async_done_cb() or
1062  *            esplusplayer_seek_done_cb(). \n
1063  *            To use this api, Must set
1064  * ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA using
1065  * esplusplayer_set_submit_data_type() \n This api must be called from a
1066  * different thread than other apis.
1067  * @see       esplusplayer_es_packet \n
1068  *            esplusplayer_drm_info \n
1069  *            esplusplayer_buffer_status_cb() \n
1070  *            esplusplayer_ready_to_prepare_cb() \n
1071  *            esplusplayer_ready_to_seek_cb() \n
1072  *            esplusplayer_submit_packet()
1073  */
1074 esplusplayer_submit_status esplusplayer_submit_encrypted_packet(
1075     esplusplayer_handle handle, esplusplayer_es_packet* packet,
1076     esplusplayer_drm_info* drm_info);
1077 #endif
1078
1079 /**
1080  * @brief     Generate EOS(End Of Stream) packet explicitly and submit it to the
1081  *            player.
1082  * @param     [in] handle : esplusplayer handle.
1083  * @param     [in] type : stream type which reaches eos.
1084  * @return    @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit EOS
1085  * packet,
1086  *            otherwise @c : fail to submit EOS packet.
1087  * @code
1088  *            esplusplayer_handle esplayer = esplusplayer_create();
1089  *            // ... your codes ...
1090  *            esplusplayer_submit_eos_packet(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1091  *            // ... your codes ...
1092  * @endcode
1093  * @pre       None
1094  * @post      None
1095  * @exception None
1096  */
1097 esplusplayer_submit_status esplusplayer_submit_eos_packet(
1098     esplusplayer_handle handle, esplusplayer_stream_type type);
1099
1100 /**
1101  * @brief     Set audio stream to have contents information.
1102  * @param     [in] handle : esplusplayer handle.
1103  * @param     [in] stream : audio stream pointer.
1104  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1105  *            values will be returned.
1106  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1107  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1108  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1109  * @code
1110  *            esplusplayer_open(esplayer);
1111  *            esplusplayer_audio_stream_info audio_stream;
1112  *            audio_stream.codec_data = nullptr;
1113  *            audio_stream.codec_data_length = 0;
1114  *            esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
1115  *            // ... your codes ...
1116  *            esplusplayer_close(esplayer);
1117  * @endcode
1118  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1119  *            audio stream is deactivated.
1120  * @post      None
1121  * @exception None
1122  * @remark    This API have to be called before calling the
1123  *            esplusplayer_prepare_async().
1124  * @see       esplusplayer_open() \n
1125  *            esplusplayer_audio_stream_info
1126  */
1127 int esplusplayer_set_audio_stream_info(esplusplayer_handle handle,
1128                                        esplusplayer_audio_stream_info* stream);
1129
1130 /**
1131  * @brief     Set video stream to have contents information.
1132  * @param     [in] handle : esplusplayer handle.
1133  * @param     [in] stream : video stream pointer.
1134  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1135  *            values will be returned.
1136  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1137  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1138  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1139  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1140  *            video stream is deactivated.
1141  * @post      None
1142  * @exception None
1143  * @remark    This API have to be called before calling the
1144  *            esplusplayer_prepare_async().
1145  * @see       esplusplayer_audio_stream_info
1146  *            esplusplayer_activate
1147  */
1148 int esplusplayer_set_video_stream_info(esplusplayer_handle handle,
1149                                        esplusplayer_video_stream_info* stream);
1150
1151 /**
1152  * @brief     Get the current playing time of the associated media.
1153  * @param     [in] handle : esplusplayer handle.
1154  * @param     [out] ms : current playing time in milliseconds.
1155  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1156  *            values will be returned.
1157  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1158  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1159  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1160  * @code
1161  *            prepare esplayer done
1162  *            esplusplayer_start(esplayer);
1163  *            // ... your codes ...
1164  *            uint64_t cur_time = 0;
1165  *            esplusplayer_get_playing_time(esplayer, &cur_time);
1166  *            // ... your codes ...
1167  *            esplusplayer_stop(esplayer);
1168  * @endcode
1169  * @pre       The player must be one of #ESPLUSPLAYER_STATE_PAUSE or
1170  *            #ESPLUSPLAYER_STATE_PLAYING.
1171  * @post      None
1172  * @exception None
1173  * @see       esplusplayer_prepare_async()
1174  */
1175 int esplusplayer_get_playing_time(esplusplayer_handle handle, uint64_t* ms);
1176
1177 /**
1178  * @brief     Get dropped frame counts in videosink.
1179  * @param     [in] handle : esplusplayer handle.
1180  * @param     [out] padaptive_info : dropped frame counts.
1181  * @param     [in] adaptive_type : type of adaptive info which APP want to get.
1182  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1183  *            values will be returned.
1184  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1185  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1186  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1187  * @code
1188  *            prepare esplayer done
1189  *            // ... your codes ...
1190  *            uint64_t count = 0;
1191  *            esplusplayer_get_adaptive_info(esplayer,
1192  *                static_cast<void*>(&count),ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_FRAMES);
1193  *            // ... your codes ...
1194  *            esplusplayer_stop(esplayer);
1195  * @endcode
1196  * @pre       The player must be one of #ESPLUSPLAYER_STATE_READY,
1197  *                    #ESPLUSPLAYER_STATE_PAUSE or #ESPLUSPLAYER_STATE_PLAYING.
1198  * @post      None
1199  * @exception None
1200  * @see       esplusplayer_prepare_async()
1201  */
1202 int esplusplayer_get_adaptive_info(
1203     esplusplayer_handle handle, void* padaptive_info,
1204     esplusplayer_adaptive_info_type adaptive_type);
1205
1206 /**
1207  * @brief     Set volume to player
1208  * @param     [in] handle : esplusplayer handle.
1209  * @param     [in] volume : volume level(0 ~ 100).
1210  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1211  *            values will be returned.
1212  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1213  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1214  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1215  * @code
1216  *            esplusplayer_open(esplayer);
1217  *            int vol = 80;
1218  *            esplusplayer_set_volume(esplayer, vol)
1219  *            // ... your codes ...
1220  *            esplusplayer_close(esplayer);
1221  * @endcode
1222  * @pre       The player state must be not #ESPLUSPLAYER_STATE_NONE.
1223  * @post      None
1224  * @exception None
1225  * @see       esplusplayer_open()
1226  */
1227 int esplusplayer_set_volume(esplusplayer_handle handle, const int volume);
1228
1229 /**
1230  * @brief     Get volume from player
1231  * @param     [in] handle : esplusplayer handle.
1232  * @param     [out] volume : volume ptr.
1233  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1234  *            values will be returned.
1235  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1236  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1237  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1238  * @code
1239  *            esplusplayer_open(esplayer);
1240  *            // ... your codes ...
1241  *            int vol = 0;
1242  *            esplusplayer_get_volume(esplayer, &vol)
1243  *            // ... your codes ...
1244  *            esplusplayer_close(esplayer);
1245  * @endcode
1246  * @pre       The player state must be not #ESPLUSPLAYER_STATE_NONE.
1247  * @post      None
1248  * @exception None
1249  * @see       esplusplayer_open()
1250  */
1251 int esplusplayer_get_volume(esplusplayer_handle handle, int* volume);
1252
1253 /**
1254  * @brief     Set decoded video frame buffer type.
1255  * @param     [in] handle : esplusplayer handle.
1256  * @param     [in] type : one of the video decoded buffer type to set .
1257  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1258  *            values will be returned.
1259  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1260  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1261  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1262  * @code
1263  *            esplusplayer_open(esplayer);
1264  *            esplusplayer_set_video_frame_buffer_type(esplayer,
1265  *                ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE);
1266  *            // ... your codes ...
1267  *            esplusplayer_close(esplayer);
1268  * @endcode
1269  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE when type
1270               is not equal to be
1271  ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1272               The player state must be not #ESPLUSPLAYER_STATE_NONE when
1273               type is equal to be
1274  ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1275  * @post      None
1276  * @exception None
1277  * @remark    reference can't support sw codec type.
1278  *            esplusplayer_set_media_packet_video_decoded_cb()
1279  *            esplusplayer_set_video_codec_type()
1280  *            when type is SCALE, the target scale resolution can be set by
1281  *            esplusplayer_set_video_frame_buffer_scale_resolution()
1282  * @see       esplusplayer_open()
1283  */
1284 int esplusplayer_set_video_frame_buffer_type(
1285     esplusplayer_handle handle,
1286     esplusplayer_decoded_video_frame_buffer_type type);
1287
1288 /**
1289  * @brief     Flush buffers for a player.
1290  * @param     [in] handle : esplusplayer handle ptr.
1291  * @param     [in] type : choose which stream data need to be
1292  *            flush,audio/video,if need flush all pipeline can call this API
1293  * twice.
1294  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1295  *            values will be returned.
1296  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1297  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1298  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1299  * @code
1300  *            prepare esplayer done
1301  *            // ... your codes ...
1302  *            esplusplayer_flush(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1303  *            // ... your codes ...
1304  *            esplusplayer_stop(esplayer);
1305  * @endcode
1306  * @pre       The player state should greater than #ESPLUSPLAYER_STATE_IDLE
1307  * @post      None
1308  * @exception None
1309  * @see       esplusplayer_prepare_async()
1310  */
1311 int esplusplayer_flush(esplusplayer_handle handle,
1312                        esplusplayer_stream_type type);
1313
1314 /**
1315  * @brief     Convert the esplusplayer error type to a string.
1316  * @param     [in] type : esplusplayer error type
1317  * @return    @c not nullptr  the converted error string otherwise @c failed to
1318  *            convert the error.
1319  * @code
1320  *            // ... your codes ...
1321  *            const char* error;
1322  *            error = esplusplayer_get_error_string(ESPLUSPLAYER_ERROR_TYPE_NOT_SUPPORTED_FILE);
1323  *            // ... your codes ...
1324  * @endcode
1325  * @pre       None
1326  * @post      None
1327  * @exception None
1328  */
1329 const char* esplusplayer_get_error_string(esplusplayer_error_type type);
1330
1331 /**
1332  * @brief     Sets a callback function to be invoked when an error occurs.
1333  * @param     [in] handle : esplusplayer handle.
1334  * @param     [in] error_cb : the error callback function to register.
1335  * @param     [in] userdata : userdata of esplusplayer_error_cb()
1336  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1337  *            values will be returned.
1338  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1339  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1340  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1341  * @code
1342  *            static void OnError(const esplusplayer_error_type err_code, void*
1343  *                userdata) {
1344  *                //Something you want to do when error occur
1345  *                printf ("OnError\n");
1346  *            }
1347  *            esplusplayer_handle esplayer = esplusplayer_create();
1348  *            esplusplayer_set_error_cb(esplayer, OnError, nullptr);
1349  *            // ... your codes ...
1350  *            esplusplayer_destroy(esplayer);
1351  * @endcode
1352  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1353  *            or #ESPLUSPLAYER_STATE_IDLE.
1354  * @post      esplusplayer_error_cb() will be invoked.
1355  * @exception None
1356  * @remark    esplusplayer_error_cb()
1357  *            if error_cb is set to null, esplusplayer_error_cb() will not be
1358  *            invoked anymore.
1359  */
1360 int esplusplayer_set_error_cb(esplusplayer_handle handle,
1361                               esplusplayer_error_cb error_cb, void* userdata);
1362
1363 /**
1364  * @brief     Set a callback function to be invoked when buffer underrun or
1365  *            overflow is occurred.
1366  * @param     [in] handle : esplusplayer handle.
1367  * @param     [in] buffer_status_cb : the buffer status callback function to
1368  * register.
1369  * @param     [in] userdata : userdata of esplusplayer_buffer_status_cb()
1370  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1371  *            values will be returned.
1372  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1373  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1374  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1375  * @code
1376  *            refer to the sample code of esplusplayer_set_error_cb();
1377  * @endcode
1378  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1379  *            or #ESPLUSPLAYER_STATE_IDLE.
1380  * @post      esplusplayer_buffer_status_cb() will be invoked.
1381  * @exception None
1382  * @remark    esplusplayer_buffer_status_cb()
1383  *            if buffer_status_cb is set to null,
1384  *            esplusplayer_buffer_status_cb() will not be invoked anymore.
1385  */
1386 int esplusplayer_set_buffer_status_cb(
1387     esplusplayer_handle handle, esplusplayer_buffer_status_cb buffer_status_cb,
1388     void* userdata);
1389
1390 /**
1391  * @brief     Set a callback function to be invoked when buffer underrun or
1392  *            overflow is occurred and buffer size in byte will be passed.
1393  * @param     [in] handle : esplusplayer handle.
1394  * @param     [in] buffer_status_cb : the buffer byte status callback function
1395  *            to register.
1396  * @param     [in] userdata : userdata of esplusplayer_buffer_byte_status_cb()
1397  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1398  *            values will be returned.
1399  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1400  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1401  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1402  * @code
1403  *            refer to the sample code of esplusplayer_submit_packet();
1404  * @endcode
1405  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1406  *            or #ESPLUSPLAYER_STATE_IDLE.
1407  * @post      esplusplayer_buffer_byte_status_cb() will be invoked.
1408  * @exception None
1409  * @remark    esplusplayer_buffer_byte_status_cb()
1410  */
1411 int esplusplayer_set_buffer_byte_status_cb(
1412     esplusplayer_handle handle,
1413     esplusplayer_buffer_byte_status_cb buffer_status_cb, void* userdata);
1414
1415 /**
1416  * @brief     Set a callback function to be invoked when buffer underrun or
1417  *            overflow is occurred and buffer size in time will be passed.
1418  * @param     [in] handle : esplusplayer handle.
1419  * @param     [in] buffer_status_cb : the buffer time status callback function
1420  *            to register.
1421  * @param     [in] userdata : userdata of esplusplayer_buffer_time_status_cb()
1422  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1423  *            values will be returned.
1424  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1425  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1426  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1427  * @code
1428               refer to the sample code of esplusplayer_submit_packet();
1429  * @endcode
1430  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1431  *            or #ESPLUSPLAYER_STATE_IDLE.
1432  * @post      esplusplayer_buffer_time_status_cb() will be invoked.
1433  * @exception None
1434  * @remark    esplusplayer_buffer_time_status_cb(),
1435  *            esplusplayer_buffer_time_status_cb() will be invoked only
1436  *            when the duration value of espacket is set.
1437  *            if buffer_status_cb is set to null,
1438  *            esplusplayer_buffer_time_status_cb() will not be invoked anymore.
1439  */
1440 int esplusplayer_set_buffer_time_status_cb(
1441     esplusplayer_handle handle,
1442     esplusplayer_buffer_time_status_cb buffer_status_cb, void* userdata);
1443
1444 /**
1445  * @brief     Set buffer size with different option
1446  * @param     [in] handle : esplusplayer handle.
1447  * @param     [in] option : the option of buffer size.
1448  * @param     [in] size : size of selected buffer option.
1449  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1450  *            values will be returned.
1451  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1452  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1453  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1454  * @code
1455  *            esplusplayer_open(esplayer);
1456  *            esplusplayer_set_buffer_size(esplayer,ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE,10240)
1457  *            // ... your codes ...
1458  *            esplusplayer_close(esplayer);
1459  * @endcode
1460  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1461  * @post      None
1462  * @exception None
1463  * @remark    esplusplayer_buffer_option
1464  * @see       esplusplayer_open()
1465  */
1466 int esplusplayer_set_buffer_size(esplusplayer_handle handle,
1467                                  esplusplayer_buffer_option option,
1468                                  uint64_t size);
1469 /**
1470  * @brief     Set a callback function to be invoked when resource confliction is
1471  * occurred.
1472  * @param     [in] handle : esplusplayer handle.
1473  * @param     [in] resource_conflicted_cb : the resource conflicted callback
1474  *            function to register.
1475  * @param     [in] userdata : userdata of resource_conflicted_cb()
1476  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1477  *            values will be returned.
1478  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1479  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1480  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1481  * @code
1482  *            refer to the sample code of esplusplayer_set_error_cb();
1483  * @endcode
1484  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1485  *            or #ESPLUSPLAYER_STATE_IDLE.
1486  * @post      esplusplayer_resource_conflicted_cb() will be invoked.
1487  * @exception None
1488  * @remark    esplusplayer_resource_conflicted_cb()
1489  *            if resource_conflicted_cb is set to null,
1490  *            esplusplayer_resource_conflicted_cb() will not be invoked
1491  *            anymore.
1492  */
1493 int esplusplayer_set_resource_conflicted_cb(
1494     esplusplayer_handle handle,
1495     esplusplayer_resource_conflicted_cb resource_conflicted_cb, void* userdata);
1496
1497 /**
1498  * @brief     Set a callback function to be invoked when player has reached the
1499  *            end of stream.
1500  * @param     [in] handle : esplusplayer handle.
1501  * @param     [in] eos_cb : the eos callback function to register.
1502  * @param     [in] userdata : userdata of esplusplayer_eos_cb()
1503  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1504  *            values will be returned.
1505  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1506  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1507  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1508  * @code
1509  *            refer to the sample code of esplusplayer_set_error_cb();
1510  * @endcode
1511  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1512  *            or #ESPLUSPLAYER_STATE_IDLE.
1513  * @post      esplusplayer_eos_cb() will be invoked.
1514  * @exception None
1515  * @remark    esplusplayer_eos_cb()
1516  *            if eos_cb is set to null, esplusplayer_eos_cb() will not be
1517  *            invoked anymore.
1518  */
1519 int esplusplayer_set_eos_cb(esplusplayer_handle handle,
1520                             esplusplayer_eos_cb eos_cb, void* userdata);
1521
1522 /**
1523  * @brief     Set a callback function to be invoked when player is prepared to
1524  *            receive es packets after calling esplusplayer_prepare_async().
1525  * @param     [in] handle : esplusplayer handle.
1526  * @param     [in] ready_to_prepare_cb : the ready to prepare callback function
1527  *            to register.
1528  * @param     [in] userdata : userdata of ready_to_prepare_cb()
1529  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1530  *            values will be returned.
1531  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1532  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1533  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1534  * @code
1535  *            refer to the sample code of esplusplayer_submit_packet();
1536  * @endcode
1537  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1538  *            or #ESPLUSPLAYER_STATE_IDLE.
1539  * @post      None
1540  * @exception None
1541  * @remark    esplusplayer_prepare_async()
1542  *            if ready_to_prepare_cb is set to null,
1543  *            esplusplayer_ready_to_prepare_cb() will not be invoked anymore.
1544  */
1545 int esplusplayer_set_ready_to_prepare_cb(
1546     esplusplayer_handle handle,
1547     esplusplayer_ready_to_prepare_cb ready_to_prepare_cb, void* userdata);
1548
1549 /**
1550  * @brief     Set a callback function to be invoked when player is prepared to
1551  *            be started.
1552  * @param     [in] handle : esplusplayer handle.
1553  * @param     [in] prepare_async_done_cb : the prepare async done callback
1554  * function to register.
1555  * @param     [in] userdata : userdata of prepare_async_done_cb()
1556  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1557  *            values will be returned.
1558  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1559  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1560  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1561  * @code
1562  *            refer to the sample code of plusplayer_prepare_async();
1563  * @endcode
1564  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1565  *            or #ESPLUSPLAYER_STATE_IDLE.
1566  * @post      esplusplayer_prepare_async_done_cb() will be invoked.
1567  * @exception It is prohibited to call any player APIs at
1568  *            esplusplayer_prepare_async_done_cb callback.
1569  * @remark    esplusplayer_prepare_async_done_cb()
1570  *            if prepare_async_done_cb is set to null,
1571  *            esplusplayer_prepare_async_done_cb() will not be
1572  *            invoked anymore.
1573  * @see       plusplayer_prepare_async
1574  */
1575 int esplusplayer_set_prepare_async_done_cb(
1576     esplusplayer_handle handle,
1577     esplusplayer_prepare_async_done_cb prepare_async_done_cb, void* userdata);
1578
1579 /**
1580  * @brief     Set a callback function to be invoked when player is prepared to
1581  *            be started.
1582  * @param     [in] handle : esplusplayer handle.
1583  * @param     [in] seek_done_cb : the seek done callback function to register.
1584  * @param     [in] userdata : userdata of esplusplayer_seek_done_cb()
1585  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1586  *            values will be returned.
1587  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1588  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1589  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1590  * @code
1591  *            refer to the sample code of esplusplayer_set_error_cb();
1592  * @endcode
1593  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1594  *            or #ESPLUSPLAYER_STATE_IDLE.
1595  * @post      esplusplayer_seek_done_cb() will be invoked.
1596  *            if seek_done_cb is set to null, esplusplayer_seek_done_cb() will
1597  *            not be invoked anymore.
1598  * @exception None
1599  */
1600 int esplusplayer_set_seek_done_cb(esplusplayer_handle handle,
1601                                   esplusplayer_seek_done_cb seek_done_cb,
1602                                   void* userdata);
1603
1604 /**
1605  * @brief     Set a callback function to be invoked when player is prepared to
1606  *            receive es packets after flushing all submitted es packets for
1607  *            seek.
1608  * @param     [in] handle : esplusplayer handle.
1609  * @param     [in] ready_to_seek_cb : the ready to seek callback function to
1610  *            register.
1611  * @param     [in] userdata : userdata of esplusplayer_ready_to_seek_cb()
1612  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1613  *            values will be returned.
1614  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1615  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1616  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1617  * @code
1618  *            refer to the sample code of esplusplayer_set_error_cb();
1619  * @endcode
1620  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1621  *            or #ESPLUSPLAYER_STATE_IDLE.
1622  * @post      None
1623  * @exception None
1624  * @remark    esplusplayer_seek()
1625  *            if ready_to_seek_cb is set to null, esplusplayer_ready_to_seek_cb()
1626  *            will not be invoked anymore.
1627  */
1628 int esplusplayer_set_ready_to_seek_cb(
1629     esplusplayer_handle handle, esplusplayer_ready_to_seek_cb ready_to_seek_cb,
1630     void* userdata);
1631
1632 /**
1633  * @brief     Set a callback function to be invoked when player decoded video
1634  *            frame. A video frame can be retrieved using a registered callback.
1635  * @param     [in] handle : esplusplayer handle.
1636  * @param     [in] media_packet_video_decoded_cb : the media packet video
1637  * decoded callback function to register.
1638  * @param     [in] userdata : userdata of
1639  * esplusplayer_set_media_packet_video_decoded_cb()
1640  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1641  *            values will be returned.
1642  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1643  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1644  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1645  * @code
1646  *            refer to the sample code of esplusplayer_set_error_cb();
1647  * @endcode
1648  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1649  *            or #ESPLUSPLAYER_STATE_IDLE.
1650  * @post      None
1651  * @exception None
1652  * @remark    esplusplayer_set_video_frame_buffer_type()
1653  *            if media_packet_video_decoded_cb is set to null,
1654  *            esplusplayer_error_cb() will not be invoked anymore.
1655  *            media packets have to be released by calling
1656  *            esplusplayer_decoded_buffer_destroy().
1657  * @see       esplusplayer_set_video_frame_buffer_scale_resolution
1658  */
1659 int esplusplayer_set_media_packet_video_decoded_cb(
1660     esplusplayer_handle handle,
1661     esplusplayer_media_packet_video_decoded_cb media_packet_video_decoded_cb,
1662     void* userdata);
1663
1664 /**
1665  * @brief     Set closed caption callback function.
1666  * @description   In this function set closed caption callback to handle the
1667  *            closed caption. If there is closed caption to display,
1668  *            esplusplayer_closed_caption_cb will be called to notify there
1669  *            is closed caption to display.
1670  * @param     [in] handle : esplusplayer handle ptr.
1671  * @param     [in] closed_caption_cb :  the closed caption callback  function to
1672  * register.
1673  * @param     [in] userdata : userdata of esplusplayer_closed_caption_cb
1674  *            callback function.
1675  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1676  *            values will be returned.
1677  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1678  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1679  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1680  * @code
1681  *            refer to the sample code of esplusplayer_set_error_cb();
1682  * @endcode
1683  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1684  *            or #ESPLUSPLAYER_STATE_IDLE.
1685  * @post      When there is closed caption data, call
1686  *            esplusplayer_closed_caption_cb to notify that there is closed
1687  *            caption needed to be displayed.
1688  * @exception None
1689  * @remark    esplusplayer_closed_caption_cb \n
1690  *            [in] data : closed caption data \n
1691  *            [in] size : length of closed caption data \n
1692  *            [in] userdata : userdata of esplusplayer_closed_caption_cb
1693  *            callback function.
1694  *            if closed_caption_cb is set to null, esplusplayer_closed_caption_cb()
1695  *            will not be invoked anymore.
1696  */
1697 int esplusplayer_set_closed_caption_cb(
1698     esplusplayer_handle handle,
1699     esplusplayer_closed_caption_cb closed_caption_cb, void* userdata);
1700
1701 /**
1702  * @brief     Set a callback function to be invoked when the flush operation is
1703  *            done.
1704  * @param     [in] handle : esplusplayer handle.
1705  * @param     [in] flush_done_cb : the flush done callback function to register.
1706  * @param     [in] userdata : userdata of esplusplayer_flush_done_cb()
1707  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1708  *            values will be returned.
1709  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1710  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1711  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1712  * @code
1713  *            refer to the sample code of esplusplayer_set_error_cb();
1714  * @endcode
1715  * @pre       This api should be called before esplusplayer_flush() is called
1716  * @post      esplusplayer_flush_done_cb() will be invoked.
1717  * @exception None
1718  * @remark    called before esplusplayer_flush().
1719  *            if flush_done_cb is set to null, esplusplayer_error_cb() will
1720  *            not be invoked anymore.
1721  */
1722 int esplusplayer_set_flush_done_cb(esplusplayer_handle handle,
1723                                    esplusplayer_flush_done_cb flush_done_cb,
1724                                    void* userdata);
1725 /**
1726  * @brief     Set a callback function to be invoked when a specific event
1727  *            occurs.
1728  * @param     [in] handle : esplusplayer handle.
1729  * @param     [in] event_cb : the callback function to register.
1730  * @param     [in] userdata : userdata of esplusplayer_event_cb()
1731  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1732  *            values will be returned.
1733  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1734  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1735  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1736  * @code
1737  *            refer to the sample code of esplusplayer_set_error_cb();
1738  * @endcode
1739  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE
1740  *            or #ESPLUSPLAYER_STATE_IDLE.
1741  * @post      esplusplayer_event_cb() will be invoked.
1742  * @exception None
1743  * @remark    esplusplayer_set_event_cb()
1744  *            if event_cb is set to null, esplusplayer_event_cb() will not be
1745  *            invoked anymore.
1746  */
1747 int esplusplayer_set_event_cb(esplusplayer_handle handle,
1748                               esplusplayer_event_cb event_cb, void* userdata);
1749 /**
1750  * @brief     Provided api for destroying decoded buffer.
1751  * @param     [in] handle : esplusplayer handle.
1752  * @param     [in] packet : the decoded buffer.
1753  * @return    @c one of esplusplayer_error_type values will be returned.
1754  * @pre       The player state can be greater than #ESPLUSPLAYER_STATE_IDLE.
1755  * @post      esplusplayer_decoded_buffer_destroy will be invoked for video
1756  *            texturing
1757  * @exception None
1758  * @remark    esplusplayer_decoded_buffer_destroy().
1759  */
1760 int esplusplayer_decoded_buffer_destroy(
1761     esplusplayer_handle handle, esplusplayer_decoded_video_packet* packet);
1762
1763 /**
1764  * @brief     Provided api for setting low latency mode, multiple modes can be
1765  *            set to duplicate.
1766  * @param     [in] handle : esplusplayer handle.
1767  * @param     [in] mode : one of the low latency mode to set.
1768  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1769  *            values will be returned.
1770  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1771  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1772  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1773  * @code
1774  *            esplusplayer_open(esplayer);
1775  *            esplusplayer_set_low_latency_mode(esplayer, ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
1776  *            // ... your codes ...
1777  *            esplusplayer_close(esplayer);
1778  * @endcode
1779  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1780  * @post      None
1781  * @exception None
1782  * @remark    Public supports #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL only.
1783  *            No operation is performed and #ESPLUSPLAYER_ERROR_TYPE_NONE will be returned,
1784  *            if @a mode is not #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL to make compatible with TV API.
1785  * @see       esplusplayer_open()
1786  */
1787 int esplusplayer_set_low_latency_mode(esplusplayer_handle handle,
1788                                       esplusplayer_low_latency_mode mode);
1789
1790 /**
1791  * @brief     Provided api for setting unlimited max buffer mode, the player
1792  *            does not limit es packet transmission although in buffer overrun
1793  * status
1794  * @param     [in] handle : esplusplayer handle.
1795  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1796  *            values will be returned.
1797  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1798  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1799  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1800  * @code
1801  *            esplusplayer_open(esplayer);
1802  *            esplusplayer_set_unlimited_max_buffer_mode(esplayer);
1803  *            // ... your codes ...
1804  *            esplusplayer_close(esplayer);
1805  * @endcode
1806  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1807  * @post      None
1808  * @exception None
1809  * @remark    esplusplayer_set_unlimited_max_buffer_mode().
1810  *            esplusplayer_buffer_status_cb() will be invoked in
1811  *            overrun/underrun buffer status. but
1812  *            esplusplayer_submit_packet() /
1813  *            esplusplayer_submit_encrypted_packet()
1814  *            does not return ESPLUSPLAYER_SUBMIT_STATUS_FULL
1815  * @see       esplusplayer_open() \n
1816  *            esplusplayer_submit_packet() \n
1817  *            esplusplayer_submit_encrypted_packet()
1818  */
1819 int esplusplayer_set_unlimited_max_buffer_mode(esplusplayer_handle handle);
1820
1821 /**
1822  * @brief     Provided api for setting audio codec type for playback.
1823  * @param     [in] handle : esplusplayer handle.
1824  * @param     [in] type : codec type(hardware/software).
1825  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1826  *            values will be returned.
1827  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1828  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1829  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1830  * @code
1831  *            esplusplayer_open(esplayer);
1832  *            esplusplayer_set_audio_codec_type(esplayer,ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW);
1833  *            // ... your codes ...
1834  *            esplusplayer_close(esplayer);
1835  * @endcode
1836  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1837               When the audio stream is not set or deactivated, it can be set
1838               in #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
1839               #ESPLUSPLAYER_STATE_PLAYING. The set codec type will be
1840               applied when esplusplayer_activate() is called.
1841  * @post      None
1842  * @exception None
1843  * @see       esplusplayer_open() \n
1844  *            esplusplayer_deactivate() \n
1845               esplusplayer_activate() \n
1846               esplusplayer_set_audio_stream_info()
1847  */
1848 int esplusplayer_set_audio_codec_type(esplusplayer_handle handle,
1849                                       esplusplayer_audio_codec_type type);
1850 /**
1851  * @brief     Provided api for setting video codec type for playback.
1852  * @param     [in] handle : esplusplayer handle.
1853  * @param     [in] type : codec type(hardware/software).
1854  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1855  *            values will be returned.
1856  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1857  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1858  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1859  * @code
1860  *            esplusplayer_open(esplayer);
1861  *            esplusplayer_set_video_codec_type(esplayer,ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW);
1862  *            // ... your codes ...
1863  *            esplusplayer_close(esplayer);
1864  * @endcode
1865  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1866               When the video stream is not set or deactivated, it can be set
1867               in #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
1868               #ESPLUSPLAYER_STATE_PLAYING. The set codec type will be
1869               applied when esplusplayer_activate() is called.
1870  * @post      None
1871  * @exception None
1872  * @see       esplusplayer_open() \n
1873  *            esplusplayer_deactivate() \n
1874               esplusplayer_activate() \n
1875               esplusplayer_set_video_stream_info()
1876  */
1877 int esplusplayer_set_video_codec_type(esplusplayer_handle handle,
1878                                       esplusplayer_video_codec_type type);
1879 /**
1880  * @brief     Provided api for setting render time offset
1881  * @param     [in] handle : esplusplayer handle ptr.
1882  * @param     [in] type : stream type
1883  * @param     [in] offset : offset (in milliseconds).
1884  *                          G_MININT64 <= offset * 1000000 <= G_MAXINT64
1885  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1886  *            values will be returned.
1887  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1888  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1889  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1890  * @code
1891  *            esplusplayer_open(esplayer);
1892  *            esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
1893  *            prepare esplayer
1894  *            // ... your codes ...
1895  *            int64_t set_offset = 10;
1896  *            esplusplayer_set_render_time_offset(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
1897  *                                                set_offset);
1898  *            int64_t get_offset = 0;
1899  *            esplusplayer_get_render_time_offset(esplayer_,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
1900  *                                                &get_offset);
1901  *            // ... your codes ...
1902  *            esplusplayer_close(esplayer);
1903  * @endcode
1904  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_READY,
1905  *            #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
1906  *            It have to be set to low latency mode. (all mode except
1907  *            # ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC)
1908  * @remark    esplusplayer_set_low_latency_mode().
1909  * @post      None
1910  * @exception None
1911  * @see       esplusplayer_open()
1912  *            esplusplayer_get_render_time_offset()
1913  */
1914 int esplusplayer_set_render_time_offset(esplusplayer_handle handle,
1915                                         esplusplayer_stream_type type,
1916                                         int64_t offset);
1917 /**
1918  * @brief     Provided api for getting render time offset
1919  * @param     [in] handle : esplusplayer handle ptr.
1920  * @param     [in] type : stream type
1921  * @param     [in] offset : offset ptr (in milliseconds).
1922  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1923  *            values will be returned.
1924  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1925  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1926  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1927  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_READY,
1928  *            #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
1929  *            It have to be set to low latency mode.
1930  * @remark    esplusplayer_set_low_latency_mode().
1931  * @post      None
1932  * @exception None
1933  * see        esplusplayer_set_render_time_offset()
1934  */
1935 int esplusplayer_get_render_time_offset(esplusplayer_handle handle,
1936                                         esplusplayer_stream_type type,
1937                                         int64_t* offset);
1938 /**
1939  * @brief     Provided api for enabling video hole.
1940  * @param     [in] handle : esplusplayer handle.
1941  * @param     [in] value : the value of video hole.
1942  *            (@c true = video hole enabled, @c false = video hole disabled)
1943  * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of esplusplayer_error_type
1944  *            values will be returned.
1945  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1946  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1947  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1948  * @code
1949  *            esplusplayer_open(esplayer);
1950  *            esplusplayer_enable_video_hole(esplayer, false);
1951  *            // ... your codes ...
1952  *            esplusplayer_close(esplayer);
1953  * @endcode
1954  * @pre       The player state must not be #ESPLUSPLAYER_STATE_NONE.
1955  * @remark    To disable video hole, esplusplayer_decoded_video_frame_buffer_type() must
1956  *            not be set to #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE.
1957  *            To enable video hole, esplusplayer_set_display() must be set to #ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY
1958  * @post      None
1959  * @exception None
1960  * @see       esplusplayer_set_video_frame_buffer_type()
1961  *            esplusplayer_set_media_packet_video_decoded_cb()
1962  */
1963 int esplusplayer_enable_video_hole(esplusplayer_handle handle, const bool value);
1964
1965 #ifdef __cplusplus
1966 }
1967 #endif
1968
1969 #endif  // __PLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__