2 * @file esplusplayer_capi.h
3 * @brief EsPlusPlayer api c version
4 * @interfacetype Platform
5 * @privlevel None-privilege
10 * @remark This is esplusplayer api header implemented as C style to
11 * avoid binary compatibility issues.
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.
27 #ifndef __PLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
28 #define __PLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
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"
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,
51 typedef void (*esplusplayer_buffer_byte_status_cb)(
52 const esplusplayer_stream_type, const esplusplayer_buffer_status, uint64_t,
54 typedef void (*esplusplayer_buffer_time_status_cb)(
55 const esplusplayer_stream_type, const esplusplayer_buffer_status, uint64_t,
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,
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,
69 typedef void (*esplusplayer_flush_done_cb)(void*);
70 typedef void (*esplusplayer_event_cb)(const esplusplayer_event_type,
71 const esplusplayer_event_msg, void*);
73 typedef void* esplusplayer_handle;
76 * @brief Enumerations for the Adaptive info type
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;
86 * @brief Enumerations for low latency mode
87 * @remark Public supports #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL only.
90 ESPLUSPLAYER_LOW_LATENCY_MODE_NONE = 0x0000,
92 * @description to support audio fast decoding/rendering
94 ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO = 0x0001,
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
100 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO = 0x0010,
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.
111 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO_DISTORTION_CONCEALMENT =
112 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO | 0x0020,
114 * @description to disable clock sync and a/v sync when rendering. it
115 * includes #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL.
117 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC = 0x0100,
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.)
126 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL = 0x0200,
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.
134 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY = 0x1000,
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.
145 ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE =
146 ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO |
147 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO | 0x2000,
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
156 * #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY and
157 * #ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE
158 * The mode use lower video quality.
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;
165 * @brief Enumerations for esplusplayer audio codec type
169 * @description hardware codec can only be selected, default type
171 ESPLUSPLAYER_AUDIO_CODEC_TYPE_HW,
173 * @description software codec can only be selected
175 ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW,
176 ESPLUSPLAYER_AUDIO_CODEC_TYPE_MAX
177 } esplusplayer_audio_codec_type;
180 * @brief Enumerations for esplusplayer video codec type
184 * @description hardware codec can only be selected, default type
186 ESPLUSPLAYER_VIDEO_CODEC_TYPE_HW,
188 * @description software codec can only be selected
190 ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW,
192 * @description hardware codec using n-decoding mode can only be selected.
193 It must set display type to mixer type by display setting
195 esplusplayer_set_display()
197 ESPLUSPLAYER_VIDEO_CODEC_TYPE_HW_N_DECODING,
198 ESPLUSPLAYER_VIDEO_CODEC_TYPE_MAX
200 } esplusplayer_video_codec_type;
202 * @brief Enumerations for esplusplayer audio easing type
207 * @description audio easing function type is linear
209 ESPLUSPLAYER_AUDIO_EASING_LINEAR,
211 * @description audio easing function type is incubic
213 ESPLUSPLAYER_AUDIO_EASING_INCUBIC,
215 * @description audio easing function type is outcubic
217 ESPLUSPLAYER_AUDIO_EASING_OUTCUBIC,
219 * @description audio easing function type is none
221 ESPLUSPLAYER_AUDIO_EASING_NONE
222 } esplusplayer_audio_easing_type;
225 * @brief Enumerations for esplusplayer resource type
230 * @description video renderer type
232 ESPLUSPLAYER_RSC_TYPE_VIDEO_RENDERER
233 } esplusplayer_rsc_type;
236 * @brief Enumerations for advanced video quality type
241 * @description advanced picture quality for video call
243 ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_VIDEO_CALL,
245 * @description advanced picture quality for usb camera
247 ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_USB_CAMERA
248 } esplusplayer_advanced_picture_quality_type;
252 * @description the minimum frame number in case of mid latency
254 int mid_latency_threshold;
256 * @description the minimum frame number in case of high latency
258 int high_latency_threshold;
259 } esplusplayer_latency_threshold;
262 * @brief rational number numerator/denominator
266 * @description the numerator value
270 * @description the denominator value
273 } esplusplayer_rational;
276 * @brief resource allocate policy
280 * @description exclusive policy, RM will return the requested resources,
283 ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE = 0,
285 * @description conditional policy, when trying to allocate resources and
286 * available resources are not left, RM will return fail.
288 ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE_CONDITIONAL
289 } esplusplayer_rsc_alloc_policy;
292 * @brief Enumerations for the status of getting decoded video frame
296 /** @brief successfully decoded video frame acquired. */
297 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_SUCCESS,
298 /** @brief it means app has to return the video before getting decoded
301 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_REMAINING_BUFFER,
303 * @brief there is no filled video frame yet.
305 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_FILLED_BUFFER,
307 * @brief internal error
309 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN
310 } esplusplayer_get_decoded_video_frame_status_type;
313 * @brief Create a esplusplayer handle.
315 * @return return esplusplayer handle pointer.
317 * esplusplayer_handle esplayer = esplusplayer_create();
318 * // ... your codes ...
319 * esplusplayer_destroy(esplayer);
322 * @post The player state will be #ESPLUSPLAYER_STATE_NONE.
325 esplusplayer_handle esplusplayer_create();
328 * @brief Open esplusplayer handle.
329 * @param [in] handle : esplusplayer handle
330 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
331 * values will be returned.
332 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
333 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
334 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
336 * esplusplayer_handle esplayer = esplusplayer_create();
337 * esplusplayer_open(esplayer);
338 * // ... your codes ...
339 * esplusplayer_close(esplayer);
340 * esplusplayer_destroy(esplayer);
342 * @pre The player state must be #ESPLUSPLAYER_STATE_NONE.
343 * @post The player state will be #ESPLUSPLAYER_STATE_IDLE.
345 * @see esplusplayer_close()
347 int esplusplayer_open(esplusplayer_handle handle);
350 * @brief Release all the player resources and all setting except callback
352 * @param [in] handle : esplusplayer handle.
353 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
354 * values will be returned.
355 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
356 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
357 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
358 * @pre The player state must be all of #esplusplayer_state except
359 * #ESPLUSPLAYER_STATE_NONE.
360 * @post The player state will be #ESPLUSPLAYER_STATE_NONE.
362 * @see esplusplayer_open()
364 int esplusplayer_close(esplusplayer_handle handle);
367 * @brief Release player handle.
368 * @param [in] handle : esplusplayer handle.
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
375 * refer to the sample code of esplusplayer_create()
377 * @pre The player state must be #ESPLUSPLAYER_STATE_NONE
378 * @post player handle will be removed.
380 * @see esplusplayer_create()
382 int esplusplayer_destroy(esplusplayer_handle handle);
385 * @brief Flush the specific buffered stream data and release TV resource
387 * @remark To activate, the stream must be set again.
388 * @param [in] handle : esplusplayer handle.
389 * @param [in] type : stream type which user want to deactivate.
390 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
391 * values will be returned.
392 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
393 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
394 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
396 refer to the sample code of esplusplayer_activate()
398 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY
399 * @post The player state is same as before calling
400 * esplusplayer_deactivate(). The deactivated stream will stop
401 * rendering and release the decoder, renderer resources.
403 * @see esplusplayer_activate
405 int esplusplayer_deactivate(esplusplayer_handle handle,
406 esplusplayer_stream_type type);
409 * @brief Reprepare for the specific stream playback.
410 * @remark There must be active stream to prepare playback.
411 * @param [in] handle : esplusplayer handle.
412 * @param [in] type : stream type which user want to activate.
413 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
414 * values will be returned.
415 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
416 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
417 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
419 * prepare esplayer done
420 * // ... your codes ...
421 * esplusplayer_deactivate(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
422 * esplusplayer_video_stream_info stream;
423 * stream.width = 640;
424 * stream.height = 352;
425 * stream.mime_type = ESPLUSPLAYER_VIDEO_MIME_TYPE_H264;
426 * stream.framerate_num = 30;
427 * stream.framerate_den = 1;
428 * esplusplayer_set_video_stream_info(esplayer, &stream);
429 * esplusplayer_activate(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
430 * // ... your codes ...
431 * esplusplayer_close(esplayer);
432 * esplusplayer_destroy(esplayer);
434 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY
435 * @post The player state is same as before calling
436 * esplusplayer_activate(). Rebuild pipeline to render the stream.
438 * @see esplusplayer_prepare_async()
440 int esplusplayer_activate(esplusplayer_handle handle,
441 esplusplayer_stream_type type);
444 * @brief Prepare the player for playback, asynchronously.
445 * @param [in] handle : esplusplayer handle.
446 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
447 * values will be returned.
448 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
449 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
450 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
452 * static void OnPrepareDone(bool ret, void* userdata) {
453 * //Something you want to do when prepare done, but, we strongly
454 * //recommend DO NOT CALL PLAYER APIs in this callback
455 * printf("OnPrepareDone\n");
457 * esplusplayer_handle esplayer = esplusplayer_create();
458 * esplusplayer_set_prepare_async_done_cb(esplayer, OnPrepareDone,nullptr);
459 * esplusplayer_open(esplayer);
460 * esplusplayer_prepare_async(esplayer);
461 * // ... your codes ...
462 * esplusplayer_close(esplayer);
463 * esplusplayer_destroy(esplayer);
465 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE. \n
466 * Call at least one of esplusplayer_set_video_stream_info() or
467 * esplusplayer_set_audio_stream_info(). \n
468 * @post It invokes esplusplayer_prepare_async_done_cb() when prepare is
470 * Prepare result can be succeeded or not at this moment. \n
471 * If the result is succeeded, the player state will be
472 * #ESPLUSPLAYER_STATE_READY and one frame will be displayed
473 * unless esplusplayer_set_display_visible() is set to @c false.
475 * @remark esplusplayer_prepare_async_done_cb() can be invoked only when as
476 * many es packets as at least one decoded frame is submitted. \n
477 * The player can receive es packets after
478 * esplusplayer_ready_to_seek_cb() is called.
479 * @see esplusplayer_open() \n
480 * esplusplayer_stop() \n
481 * esplusplayer_submit_packet() \n
482 * esplusplayer_ready_to_prepare_cb() \n
483 * esplusplayer_close()
485 int esplusplayer_prepare_async(esplusplayer_handle handle);
488 * @brief Start playback.
489 * @param [in] handle : esplusplayer handle.
490 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
491 * values will be returned.
492 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
493 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
494 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
496 * prepare esplayer done
497 * esplusplayer_start(esplayer);
498 * // ... your codes ...
499 * esplusplayer_stop(esplayer);
501 * @pre The player state should be #ESPLUSPLAYER_STATE_READY.
502 * @post The player state will be #ESPLUSPLAYER_STATE_PLAYING.
504 * @see esplusplayer_open() \n
505 * esplusplayer_prepare_async() \n
506 * esplusplayer_stop() \n
507 * esplusplayer_close()
509 int esplusplayer_start(esplusplayer_handle handle);
512 * @brief Stop playing media content.
513 * @param [in] handle : esplusplayer handle.
514 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
515 * values will be returned.
516 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
517 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
518 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
520 * prepare esplayer done
521 * // ... your codes ...
522 * esplusplayer_stop(esplayer);
523 * // ... your codes ...
524 * esplusplayer_close(esplayer);
526 * @pre The player state must be all of #esplusplayer_state except
527 * #ESPLUSPLAYER_STATE_NONE.
528 * @post The player state will be #ESPLUSPLAYER_STATE_IDLE.
530 * @remark esplusplayer_close() must be called once after player is stopped
531 * @see esplusplayer_open() \n
532 * esplusplayer_prepare_async() \n
533 * esplusplayer_start() \n
534 * esplusplayer_pause() \n
535 * esplusplayer_resume() \n
536 * esplusplayer_close()
538 int esplusplayer_stop(esplusplayer_handle handle);
541 * @brief Pause playing media content.
542 * @param [in] handle : esplusplayer handle.
543 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
544 * values will be returned.
545 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
546 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
547 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
549 * prepare esplayer done
550 * // ... your codes ...
551 * esplusplayer_pause(esplayer);
552 * // ... your codes ...
553 * esplusplayer_stop(esplayer);
555 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
556 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
557 * @post The player state will be #ESPLUSPLAYER_STATE_PAUSE.
559 * @see esplusplayer_start() \n
560 * esplusplayer_resume() \n
561 * esplusplayer_prepare_async()
563 int esplusplayer_pause(esplusplayer_handle handle);
566 * @brief Resume playing media content.
567 * @param [in] handle : esplusplayer handle.
568 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
569 * values will be returned.
570 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
571 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
572 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
574 * prepare esplayer done
575 * // ... your codes ...
576 * esplusplayer_pause(esplayer);
577 * // ... your codes ...
578 * esplusplayer_resume(esplayer);
579 * // ... your codes ...
580 * esplusplayer_stop(esplayer);
582 * @pre The player state must be one of #ESPLUSPLAYER_STATE_PAUSED or
583 * #ESPLUSPLAYER_STATE_PLAYING.
584 * @post The player state will be #ESPLUSPLAYER_STATE_PLAYING.
586 * @see esplusplayer_start() \n
587 * esplusplayer_pause() \n
588 * esplusplayer_prepare_async()
590 int esplusplayer_resume(esplusplayer_handle handle);
593 * @brief Set playback rate.
594 * @param [in] handle : esplusplayer handle.
595 * @param [in] playback_rate : the playback rate from 0.0 to 2.0.
596 * @param [in] audio_mute : the audio is mute on/off, true: mute on, false:
598 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
599 * values will be returned.
600 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
601 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
602 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
604 * prepare esplayer done
605 * // ... your codes ...
606 * esplusplayer_set_playback_rate(esplayer,2,true);
607 * // ... your codes ...
608 * esplusplayer_stop(esplayer);
610 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
611 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING. \n
612 * User has to push the data as fast as playback rate.
615 * @see esplusplayer_prepare_async()
617 int esplusplayer_set_playback_rate(esplusplayer_handle handle,
618 const double playback_rate,
619 const bool audio_mute);
622 * @brief Seek for playback, asynchronously.
623 * @param [in] handle : esplusplayer handle.
624 * @param [in] time_ms : seek time in milliseconds
625 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
626 * values will be returned.
627 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
628 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
629 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
631 * prepare esplayer done
632 * // ... your codes ...
633 * const uint64_t ms_to_seek = 0;
634 * esplusplayer_seek(esplayer,ms_to_seek);
635 * // ... your codes ...
636 * esplusplayer_stop(esplayer);
638 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
639 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
640 * In ESPLUSPLAYER_STATE_IDLE, this api can be called exceptionally
641 * between esplusplayer_open() and esplusplayer_prepare_async().
642 * the start time of playback can be set explicitly when starting
643 * first playback. In this case, esplusplayer_set_seek_done_cb is not
647 * @remark esplusplayer_set_seek_done_cb() will be invoked if seek operation
649 * Seek result can be succeeded or not at this moment. \n
650 * esplusplayer_set_seek_done_cb() can be invoked only when as many
651 * es packets as at least one decoded frame is submitted. \n
652 * The player can receive es packets from seek time after
653 * esplusplayer_ready_to_seek_cb() is invoked.
654 * @see esplusplayer_ready_to_seek_cb() \n
655 * esplusplayer_prepare_async()
657 int esplusplayer_seek(esplusplayer_handle handle, uint64_t time_ms);
660 * @brief Set the video display.
661 * @param [in] handle : esplusplayer handle.
662 * @param [in] type : display type.
663 * @param [in] window : the handle to display window.
664 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
665 * values will be returned.
666 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
667 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
668 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
670 * esplusplayer_open(esplayer);
671 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
672 * // ... your codes ...
673 * esplusplayer_close(esplayer);
675 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
678 * @remark Esplusplayer is not supporting changing display. \n
679 * This API have to be called before calling
680 * esplusplayer_prepare_async() to reflect the display type.
681 * @see esplusplayer_open() \n
682 * esplusplayer_set_display_mode() \n
683 * esplusplayer_set_display_roi() \n
684 * esplusplayer_set_display_visible()
686 int esplusplayer_set_display(esplusplayer_handle handle,
687 esplusplayer_display_type type, void* window);
689 #ifdef TIZEN_FEATURE_TV
691 * @brief Set the video display.
692 * @param [in] handle : esplusplayer handle.
693 * @param [in] type : display type.
694 * @param [in] subsurface : the ecore wayland subsurface handle.
695 * @param [in] x : the x coordinate of subsurface.
696 * @param [in] y : the y coordinate of subsurface.
697 * @param [in] width : the width of subsurface.
698 * @param [in] height : the height of subsurface.
699 * @return @c one of esplusplayer_error_type values will be returned.
700 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
704 * @see esplusplayer_set_display_mode() \n
705 * esplusplayer_set_display_roi() \n
706 * esplusplayer_set_display_visible()
708 int esplusplayer_set_display_ecore_subsurface(esplusplayer_handle handle,
709 esplusplayer_display_type type,
710 void* subsurface, int x, int y,
711 int width, int height);
715 * @brief Set the video display mode.
716 * @param [in] handle : esplusplayer handle.
717 * @param [in] mode : display mode.
718 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
719 * values will be returned.
720 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
721 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
722 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
724 * esplusplayer_open(esplayer);
725 * esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
726 * // ... your codes ...
727 * esplusplayer_close(esplayer);
729 * @pre The player state can be all of #esplusplayer_state except
730 * #ESPLUSPLAYER_STATE_NONE.
733 * @remark If no display is set, no operation is performed.
734 * @see esplusplayer_open() \n
735 * esplusplayer_set_display_mode() \n
736 * esplusplayer_set_display_roi() \n
737 * esplusplayer_set_display_visible()
739 int esplusplayer_set_display_mode(esplusplayer_handle handle,
740 esplusplayer_display_mode mode);
743 * @brief Set the ROI(Region Of Interest) area of display.
744 * @param [in] handle : esplusplayer handle.
745 * @param [in] x : var startPointX in src video area.
746 * @param [in] y : var startPointY in src video area.
747 * @param [in] width : width of display in src video area.
748 * @param [in] height : height of display in src video area.
749 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
750 * values will be returned.
751 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
752 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
753 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
755 * esplusplayer_open(esplayer);
756 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
757 * esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
758 * esplusplayer_set_display_roi(esplayer,0,0,600,500);
759 * // ... your codes ...
760 * esplusplayer_close(esplayer);
762 * @pre The player state can be all of #esplusplayer_state except
763 * #ESPLUSPLAYER_STATE_NONE. \n
764 * Before set display ROI, #ESPLUSPLAYER_DISPLAY_MODE_DST_ROI
765 * must be set with esplusplayer_set_display_mode().
768 * @remark The minimum value of width and height are 1.
769 * @see esplusplayer_open() \n
770 * esplusplayer_set_display() \n
771 * esplusplayer_set_display_mode() \n
772 * esplusplayer_set_display_visible()
774 int esplusplayer_set_display_roi(esplusplayer_handle handle, int x, int y,
775 int width, int height);
778 * @brief Set the Crop Area(Region Of Src ratio) area of display.
779 * @param [in] handle : esplusplayer handle.
780 * @param [in] scale_x: x label ratio in src video area.
781 * @param [in] scale_y: y label ratio in src video area.
782 * @param [in] scale_w: width ratio in src video area.
783 * @param [in] scale_h: height ratio in src video area.
784 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
785 * values will be returned.
786 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
787 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
788 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
790 * esplusplayer_open(esplayer);
791 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
792 * esplusplayer_set_video_roi(esplayer,0,0,0.5,0.5);
793 * // ... your codes ...
794 * esplusplayer_close(esplayer);
796 * @pre The player state can be all of #esplusplayer_state except
797 * #ESPLUSPLAYER_STATE_NONE. \n
800 * @remark The minimum value of input are 0,maximum value is 1.
801 * @see esplusplayer_open() \n
802 * esplusplayer_set_display() \n
803 * esplusplayer_set_display_visible()
805 int esplusplayer_set_video_roi(esplusplayer_handle handle, double scale_x,
806 double scale_y, double scale_w, double scale_h);
809 * @brief Set the visibility of the video display.
810 * @param [in] handle : esplusplayer handle.
811 * @param [in] visible : the visibility of the display.
812 * (@c true = visible, @c false = non-visible)
813 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
814 * values will be returned.
815 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
816 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
817 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
819 * esplusplayer_open(esplayer);
820 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
821 * esplusplayer_set_display_visible(esplayer,false);
822 * // ... your codes ...
823 * esplusplayer_close(esplayer);
825 * @pre The player state can be all of #esplusplayer_state except
826 * #ESPLUSPLAYER_STATE_NONE.
829 * @see esplusplayer_open() \n
830 * esplusplayer_set_display()
832 int esplusplayer_set_display_visible(esplusplayer_handle handle, bool visible);
835 * @brief Set the rotate angle of the video display.
836 * @param [in] handle : esplusplayer handle.
837 * @param [in] rotation : the rotate angle of the display.
838 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
839 * values will be returned.
840 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
841 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
842 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
844 * esplusplayer_open(esplayer);
845 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
846 * esplusplayer_set_display_rotation(esplayer_,ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_90);
847 * // ... your codes ...
848 * esplusplayer_close(esplayer);
850 * @pre The player state can be all of #esplusplayer_state except
851 * #ESPLUSPLAYER_STATE_NONE.
852 * @post this API worked only when video sink created.
854 * @see esplusplayer_open() \n
855 * esplusplayer_set_display()
857 int esplusplayer_set_display_rotation(
858 esplusplayer_handle handle, esplusplayer_display_rotation_type rotation);
861 * @brief Get the rotate angle of the video display.
862 * @param [in] handle : esplusplayer handle.
863 * @param [out] rotation : the rotate angle of the display which want to
865 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
866 * values will be returned.
867 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
868 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
869 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
871 * esplusplayer_open(esplayer);
872 * esplusplayer_set_display_rotation(esplayer,ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_90);
873 * esplusplayer_display_rotation_type rotation_get = ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_NONE;
874 * // ... your codes ...
875 * esplusplayer_get_display_rotation(esplayer,&rotation_get);
876 * // ... your codes ...
877 * esplusplayer_close(esplayer);
879 * @pre The player state can be all of #esplusplayer_state except
880 * #ESPLUSPLAYER_STATE_NONE.
881 * @post this API worked only when video sink created.
883 * @see esplusplayer_open() \n
884 * esplusplayer_set_display_rotation()
886 int esplusplayer_get_display_rotation(
887 esplusplayer_handle handle, esplusplayer_display_rotation_type* rotation);
890 * @brief Set whether to send decrypted es packets in the trust zone or
891 * encrypted es packets.
892 * @param [in] handle : esplusplayer handle.
893 * @param [in] type : whether to use trust zone memory or encrypted data
894 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
895 * values will be returned.
896 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
897 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
898 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
900 * esplusplayer_open(esplayer);
901 * esplusplayer_set_submit_data_type(esplayer,ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA);
902 * // ... your codes ...
903 * esplusplayer_close(esplayer);
905 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
908 * @remark This API have to be called before calling
909 * esplusplayer_prepare_async(). \n
910 * If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA use
911 * esplusplayer_submit_packet() to send clean packets. \n
912 * If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA, use
913 * esplusplayer_submit_encrypted_packet() to send encrypted packets.
914 * @see esplusplayer_open() \n
915 * esplusplayer_submit_encrypted_packet() \n
916 * esplusplayer_submit_data_type
918 int esplusplayer_set_submit_data_type(esplusplayer_handle handle,
919 esplusplayer_submit_data_type type);
922 * @brief Set on mute of the audio sound.
923 * @param [in] handle : esplusplayer handle.
924 * @param [in] mute : on mute of the sound.
925 * (@c true = mute, @c false = non-mute)
926 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of esplusplayer_error_type
927 * values will be returned.
928 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
929 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
930 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
932 * esplusplayer_open(esplayer);
933 * esplusplayer_set_audio_mute(esplayer, true);
934 * // ... your codes ...
935 * esplusplayer_close(esplayer);
937 * @pre The player state can be all of #esplusplayer_state except
938 * #ESPLUSPLAYER_STATE_NONE.
941 * @see esplusplayer_open()
943 int esplusplayer_set_audio_mute(esplusplayer_handle handle, bool mute);
946 * @brief Get current state of player.
947 * @param [in] handle : esplusplayer handle.
948 * @return current #esplusplayer_state of player.
950 * esplusplayer_handle esplayer = esplusplayer_create();
951 * // ... your codes ...
952 * esplusplayer_state ret = esplusplayer_get_state(esplayer);
953 * // ... your codes ...
954 * esplusplayer_destroy(esplayer);
960 esplusplayer_state esplusplayer_get_state(esplusplayer_handle handle);
963 * @brief Submit es packet to decode audio or video.
964 * @param [in] handle : esplusplayer handle.
965 * @param [in] packet : es packet pointer.
966 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
968 * otherwise @c : fail to submit es packet.
970 * static void OnPrepareDone(bool ret, void* userdata) {
971 * // ... your codes ...
972 * printf ("OnPrepareDone\n");
974 * static void OnReadyToPrepare(const esplusplayer_stream_type type,void* userdata) {
975 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
976 * //Something you want to do when feed es video stream is allowed
978 * //Something you want to do when feed es audio stream is allowed
980 * //Something you want to do when OnReadyToPrepare
981 * printf ("OnReadyToPrepare\n");
983 * static void OnBufferByteStatus(const esplusplayer_stream_type type,
984 * const esplusplayer_buffer_status status,
985 * uint64_t byte_size, void* userdata) {
986 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
987 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
988 * //Something you want to do when es video buffer is enough
990 * //Something you want to do when es video buffer is not enough
993 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
994 * //Something you want to do when es audio buffer is enough
996 * //Something you want to do when es audio buffer is not enough
999 * //Something you want to do when OnBufferByteStatus
1000 * printf ("OnBufferByteStatus\n");
1002 * static void OnBufferTimeStatus(const esplusplayer_stream_type type,
1003 * const esplusplayer_buffer_status status,
1004 * uint64_t time_size,void* userdata) {
1005 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
1006 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1007 * //Something you want to do when es video buffer is enough
1009 * //Something you want to do when es video buffer is not enough
1012 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1013 * //Something you want to do when es audio buffer is enough
1015 * //Something you want to do when es audio buffer is not enough
1018 * //Something you want to do when OnBufferTimeStatus
1019 * printf ("OnBufferTimeStatus\n");
1021 * void FeedEsPacket(esplusplayer_handle player,esplusplayer_es_packet pkt) {
1022 * // ... your codes ...
1023 * if(feed is allowed && buffer is enough) {
1024 * esplusplayer_submit_packet(player, &pkt);
1026 * // ... your codes ...
1028 * esplusplayer_handle esplayer = esplusplayer_create();
1029 * esplusplayer_set_prepare_async_done_cb(esplayer,OnPrepareDone,&esplayer);
1030 * esplusplayer_set_ready_to_prepare_cb(esplayer,OnReadyToPrepare,&esplayer);
1031 * esplusplayer_set_buffer_byte_status_cb(esplayer,OnBufferByteStatus,&esplayer);
1032 * esplusplayer_set_buffer_time_status_cb(esplayer,OnBufferTimeStatus,&esplayer);
1033 * esplusplayer_open(esplayer);
1034 * esplusplayer_prepare_async(esplayer);
1035 * // ... your codes ...
1036 * //FeedEsPacket()(call a new thread to do this)
1037 * // ... your codes ...
1038 * esplusplayer_close(esplayer);
1039 * esplusplayer_destroy(esplayer);
1041 * @pre User can submit es packets after
1042 * esplusplayer_ready_to_prepare_cb() or
1043 * esplusplayer_ready_to_seek_cb() is called.
1046 * @remark Amount of packets for at least one decoded frame must be submitted
1047 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1048 * for invoking esplusplayer_prepare_async_done_cb() or
1049 * esplusplayer_seek_done_cb() \n
1050 * This api must be called from a different thread than other apis.
1051 * @see esplusplayer_set_submit_data_type() \n
1052 * esplusplayer_es_packet \n
1053 * esplusplayer_buffer_status_cb() \n
1054 * esplusplayer_ready_to_prepare_cb() \n
1055 * esplusplayer_ready_to_seek_cb()
1057 esplusplayer_submit_status esplusplayer_submit_packet(
1058 esplusplayer_handle handle, esplusplayer_es_packet* packet);
1060 #ifdef TIZEN_FEATURE_TV
1062 * @brief Submit encrypted es packet to decode and decrypt audio or video.
1063 * @param [in] handle : esplusplayer handle.
1064 * @param [in] packet : es packet pointer.
1065 * @param [in] drm_info : information to decrypt es packet.
1066 * esplusplayer doesn't take ownership. user should
1067 * free it. if you deliver it as (null), this api
1068 * works as esplusplayer_submit_packet().
1069 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1071 * otherwise @c : fail to submit es packet.
1073 * refer to the sample code of esplusplayer_submit_packet();
1075 * @pre User can submit es packets after
1076 * esplusplayer_ready_to_prepare_cb() or
1077 * esplusplayer_ready_to_seek_cb() is called.
1080 * @remark Amount of packets for at least one decoded frame must be submitted
1081 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1082 * for invoking esplusplayer_prepare_async_done_cb() or
1083 * esplusplayer_seek_done_cb(). \n
1084 * To use this api, Must set
1085 * ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA using
1086 * esplusplayer_set_submit_data_type() \n This api must be called from a
1087 * different thread than other apis.
1088 * @see esplusplayer_es_packet \n
1089 * esplusplayer_drm_info \n
1090 * esplusplayer_buffer_status_cb() \n
1091 * esplusplayer_ready_to_prepare_cb() \n
1092 * esplusplayer_ready_to_seek_cb() \n
1093 * esplusplayer_submit_packet()
1095 esplusplayer_submit_status esplusplayer_submit_encrypted_packet(
1096 esplusplayer_handle handle, esplusplayer_es_packet* packet,
1097 esplusplayer_drm_info* drm_info);
1101 * @brief Generate EOS(End Of Stream) packet explicitly and submit it to the
1103 * @param [in] handle : esplusplayer handle.
1104 * @param [in] type : stream type which reaches eos.
1105 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit EOS
1107 * otherwise @c : fail to submit EOS packet.
1109 * esplusplayer_handle esplayer = esplusplayer_create();
1110 * // ... your codes ...
1111 * esplusplayer_submit_eos_packet(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1112 * // ... your codes ...
1118 esplusplayer_submit_status esplusplayer_submit_eos_packet(
1119 esplusplayer_handle handle, esplusplayer_stream_type type);
1122 * @brief Set audio stream to have contents information.
1123 * @param [in] handle : esplusplayer handle.
1124 * @param [in] stream : audio stream pointer.
1125 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1126 * values will be returned.
1127 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1128 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1129 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1131 * esplusplayer_open(esplayer);
1132 * esplusplayer_audio_stream_info audio_stream;
1133 * audio_stream.codec_data = nullptr;
1134 * audio_stream.codec_data_length = 0;
1135 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
1136 * // ... your codes ...
1137 * esplusplayer_close(esplayer);
1139 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1140 * audio stream is deactivated.
1143 * @remark This API have to be called before calling the
1144 * esplusplayer_prepare_async().
1145 * @see esplusplayer_open() \n
1146 * esplusplayer_audio_stream_info
1148 int esplusplayer_set_audio_stream_info(esplusplayer_handle handle,
1149 esplusplayer_audio_stream_info* stream);
1152 * @brief Set video stream to have contents information.
1153 * @param [in] handle : esplusplayer handle.
1154 * @param [in] stream : video stream pointer.
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 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1161 * video stream is deactivated.
1164 * @remark This API have to be called before calling the
1165 * esplusplayer_prepare_async().
1166 * @see esplusplayer_audio_stream_info
1167 * esplusplayer_activate
1169 int esplusplayer_set_video_stream_info(esplusplayer_handle handle,
1170 esplusplayer_video_stream_info* stream);
1173 * @brief Get the current playing time of the associated media.
1174 * @param [in] handle : esplusplayer handle.
1175 * @param [out] ms : current playing time in milliseconds.
1176 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1177 * values will be returned.
1178 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1179 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1180 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1182 * prepare esplayer done
1183 * esplusplayer_start(esplayer);
1184 * // ... your codes ...
1185 * uint64_t cur_time = 0;
1186 * esplusplayer_get_playing_time(esplayer, &cur_time);
1187 * // ... your codes ...
1188 * esplusplayer_stop(esplayer);
1190 * @pre The player must be one of #ESPLUSPLAYER_STATE_PAUSE or
1191 * #ESPLUSPLAYER_STATE_PLAYING.
1194 * @see esplusplayer_prepare_async()
1196 int esplusplayer_get_playing_time(esplusplayer_handle handle, uint64_t* ms);
1199 * @brief Get dropped frame counts in videosink.
1200 * @param [in] handle : esplusplayer handle.
1201 * @param [out] padaptive_info : dropped frame counts.
1202 * @param [in] adaptive_type : type of adaptive info which APP want to get.
1203 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1204 * values will be returned.
1205 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1206 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1207 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1209 * prepare esplayer done
1210 * // ... your codes ...
1211 * uint64_t count = 0;
1212 * esplusplayer_get_adaptive_info(esplayer,
1213 * static_cast<void*>(&count),ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_FRAMES);
1214 * // ... your codes ...
1215 * esplusplayer_stop(esplayer);
1217 * @pre The player must be one of #ESPLUSPLAYER_STATE_READY,
1218 * #ESPLUSPLAYER_STATE_PAUSE or #ESPLUSPLAYER_STATE_PLAYING.
1221 * @see esplusplayer_prepare_async()
1223 int esplusplayer_get_adaptive_info(
1224 esplusplayer_handle handle, void* padaptive_info,
1225 esplusplayer_adaptive_info_type adaptive_type);
1228 * @brief Set volume to player
1229 * @param [in] handle : esplusplayer handle.
1230 * @param [in] volume : volume level(0 ~ 100).
1231 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1232 * values will be returned.
1233 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1234 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1235 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1237 * esplusplayer_open(esplayer);
1239 * esplusplayer_set_volume(esplayer, vol)
1240 * // ... your codes ...
1241 * esplusplayer_close(esplayer);
1243 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1246 * @see esplusplayer_open()
1248 int esplusplayer_set_volume(esplusplayer_handle handle, const int volume);
1251 * @brief Get volume from player
1252 * @param [in] handle : esplusplayer handle.
1253 * @param [out] volume : volume ptr.
1254 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1255 * values will be returned.
1256 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1257 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1258 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1260 * esplusplayer_open(esplayer);
1261 * // ... your codes ...
1263 * esplusplayer_get_volume(esplayer, &vol)
1264 * // ... your codes ...
1265 * esplusplayer_close(esplayer);
1267 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1270 * @see esplusplayer_open()
1272 int esplusplayer_get_volume(esplusplayer_handle handle, int* volume);
1275 * @brief Set decoded video frame buffer type.
1276 * @param [in] handle : esplusplayer handle.
1277 * @param [in] type : one of the video decoded buffer type to set .
1278 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1279 * values will be returned.
1280 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1281 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1282 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1284 * esplusplayer_open(esplayer);
1285 * esplusplayer_set_video_frame_buffer_type(esplayer,
1286 * ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE);
1287 * // ... your codes ...
1288 * esplusplayer_close(esplayer);
1290 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE when type
1292 ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1293 The player state must be not #ESPLUSPLAYER_STATE_NONE when
1295 ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1298 * @remark reference can't support sw codec type.
1299 * esplusplayer_set_media_packet_video_decoded_cb()
1300 * esplusplayer_set_video_codec_type()
1301 * when type is SCALE, the target scale resolution can be set by
1302 * esplusplayer_set_video_frame_buffer_scale_resolution()
1303 * @see esplusplayer_open()
1305 int esplusplayer_set_video_frame_buffer_type(
1306 esplusplayer_handle handle,
1307 esplusplayer_decoded_video_frame_buffer_type type);
1310 * @brief Flush buffers for a player.
1311 * @param [in] handle : esplusplayer handle ptr.
1312 * @param [in] type : choose which stream data need to be
1313 * flush,audio/video,if need flush all pipeline can call this API
1315 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1316 * values will be returned.
1317 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1318 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1319 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1321 * prepare esplayer done
1322 * // ... your codes ...
1323 * esplusplayer_flush(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1324 * // ... your codes ...
1325 * esplusplayer_stop(esplayer);
1327 * @pre The player state should greater than #ESPLUSPLAYER_STATE_IDLE
1330 * @see esplusplayer_prepare_async()
1332 int esplusplayer_flush(esplusplayer_handle handle,
1333 esplusplayer_stream_type type);
1336 * @brief Convert the esplusplayer error type to a string.
1337 * @param [in] type : esplusplayer error type
1338 * @return @c not nullptr the converted error string otherwise @c failed to
1339 * convert the error.
1341 * // ... your codes ...
1342 * const char* error;
1343 * error = esplusplayer_get_error_string(ESPLUSPLAYER_ERROR_TYPE_NOT_SUPPORTED_FILE);
1344 * // ... your codes ...
1350 const char* esplusplayer_get_error_string(esplusplayer_error_type type);
1353 * @brief Sets a callback function to be invoked when an error occurs.
1354 * @param [in] handle : esplusplayer handle.
1355 * @param [in] error_cb : the error callback function to register.
1356 * @param [in] userdata : userdata of esplusplayer_error_cb()
1357 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1358 * values will be returned.
1359 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1360 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1361 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1363 * static void OnError(const esplusplayer_error_type err_code, void*
1365 * //Something you want to do when error occur
1366 * printf ("OnError\n");
1368 * esplusplayer_handle esplayer = esplusplayer_create();
1369 * esplusplayer_set_error_cb(esplayer, OnError, nullptr);
1370 * // ... your codes ...
1371 * esplusplayer_destroy(esplayer);
1373 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1374 * or #ESPLUSPLAYER_STATE_IDLE.
1375 * @post esplusplayer_error_cb() will be invoked.
1377 * @remark esplusplayer_error_cb()
1378 * if error_cb is set to null, esplusplayer_error_cb() will not be
1381 int esplusplayer_set_error_cb(esplusplayer_handle handle,
1382 esplusplayer_error_cb error_cb, void* userdata);
1385 * @brief Set a callback function to be invoked when buffer underrun or
1386 * overflow is occurred.
1387 * @param [in] handle : esplusplayer handle.
1388 * @param [in] buffer_status_cb : the buffer status callback function to
1390 * @param [in] userdata : userdata of esplusplayer_buffer_status_cb()
1391 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1392 * values will be returned.
1393 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1394 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1395 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1397 * refer to the sample code of esplusplayer_set_error_cb();
1399 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1400 * or #ESPLUSPLAYER_STATE_IDLE.
1401 * @post esplusplayer_buffer_status_cb() will be invoked.
1403 * @remark esplusplayer_buffer_status_cb()
1404 * if buffer_status_cb is set to null,
1405 * esplusplayer_buffer_status_cb() will not be invoked anymore.
1407 int esplusplayer_set_buffer_status_cb(
1408 esplusplayer_handle handle, esplusplayer_buffer_status_cb buffer_status_cb,
1412 * @brief Set a callback function to be invoked when buffer underrun or
1413 * overflow is occurred and buffer size in byte will be passed.
1414 * @param [in] handle : esplusplayer handle.
1415 * @param [in] buffer_status_cb : the buffer byte status callback function
1417 * @param [in] userdata : userdata of esplusplayer_buffer_byte_status_cb()
1418 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1419 * values will be returned.
1420 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1421 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1422 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1424 * refer to the sample code of esplusplayer_submit_packet();
1426 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1427 * or #ESPLUSPLAYER_STATE_IDLE.
1428 * @post esplusplayer_buffer_byte_status_cb() will be invoked.
1430 * @remark esplusplayer_buffer_byte_status_cb()
1432 int esplusplayer_set_buffer_byte_status_cb(
1433 esplusplayer_handle handle,
1434 esplusplayer_buffer_byte_status_cb buffer_status_cb, void* userdata);
1437 * @brief Set a callback function to be invoked when buffer underrun or
1438 * overflow is occurred and buffer size in time will be passed.
1439 * @param [in] handle : esplusplayer handle.
1440 * @param [in] buffer_status_cb : the buffer time status callback function
1442 * @param [in] userdata : userdata of esplusplayer_buffer_time_status_cb()
1443 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1444 * values will be returned.
1445 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1446 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1447 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1449 refer to the sample code of esplusplayer_submit_packet();
1451 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1452 * or #ESPLUSPLAYER_STATE_IDLE.
1453 * @post esplusplayer_buffer_time_status_cb() will be invoked.
1455 * @remark esplusplayer_buffer_time_status_cb(),
1456 * esplusplayer_buffer_time_status_cb() will be invoked only
1457 * when the duration value of espacket is set.
1458 * if buffer_status_cb is set to null,
1459 * esplusplayer_buffer_time_status_cb() will not be invoked anymore.
1461 int esplusplayer_set_buffer_time_status_cb(
1462 esplusplayer_handle handle,
1463 esplusplayer_buffer_time_status_cb buffer_status_cb, void* userdata);
1466 * @brief Set buffer size with different option
1467 * @param [in] handle : esplusplayer handle.
1468 * @param [in] option : the option of buffer size.
1469 * @param [in] size : size of selected buffer option.
1470 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1471 * values will be returned.
1472 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1473 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1474 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1476 * esplusplayer_open(esplayer);
1477 * esplusplayer_set_buffer_size(esplayer,ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE,10240)
1478 * // ... your codes ...
1479 * esplusplayer_close(esplayer);
1481 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1484 * @remark esplusplayer_buffer_option
1485 * @see esplusplayer_open()
1487 int esplusplayer_set_buffer_size(esplusplayer_handle handle,
1488 esplusplayer_buffer_option option,
1491 * @brief Set a callback function to be invoked when resource confliction is
1493 * @param [in] handle : esplusplayer handle.
1494 * @param [in] resource_conflicted_cb : the resource conflicted callback
1495 * function to register.
1496 * @param [in] userdata : userdata of resource_conflicted_cb()
1497 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1498 * values will be returned.
1499 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1500 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1501 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1503 * refer to the sample code of esplusplayer_set_error_cb();
1505 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1506 * or #ESPLUSPLAYER_STATE_IDLE.
1507 * @post esplusplayer_resource_conflicted_cb() will be invoked.
1509 * @remark esplusplayer_resource_conflicted_cb()
1510 * if resource_conflicted_cb is set to null,
1511 * esplusplayer_resource_conflicted_cb() will not be invoked
1514 int esplusplayer_set_resource_conflicted_cb(
1515 esplusplayer_handle handle,
1516 esplusplayer_resource_conflicted_cb resource_conflicted_cb, void* userdata);
1519 * @brief Set a callback function to be invoked when player has reached the
1521 * @param [in] handle : esplusplayer handle.
1522 * @param [in] eos_cb : the eos callback function to register.
1523 * @param [in] userdata : userdata of esplusplayer_eos_cb()
1524 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1525 * values will be returned.
1526 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1527 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1528 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1530 * refer to the sample code of esplusplayer_set_error_cb();
1532 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1533 * or #ESPLUSPLAYER_STATE_IDLE.
1534 * @post esplusplayer_eos_cb() will be invoked.
1536 * @remark esplusplayer_eos_cb()
1537 * if eos_cb is set to null, esplusplayer_eos_cb() will not be
1540 int esplusplayer_set_eos_cb(esplusplayer_handle handle,
1541 esplusplayer_eos_cb eos_cb, void* userdata);
1544 * @brief Set a callback function to be invoked when player is prepared to
1545 * receive es packets after calling esplusplayer_prepare_async().
1546 * @param [in] handle : esplusplayer handle.
1547 * @param [in] ready_to_prepare_cb : the ready to prepare callback function
1549 * @param [in] userdata : userdata of ready_to_prepare_cb()
1550 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1551 * values will be returned.
1552 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1553 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1554 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1556 * refer to the sample code of esplusplayer_submit_packet();
1558 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1559 * or #ESPLUSPLAYER_STATE_IDLE.
1562 * @remark esplusplayer_prepare_async()
1563 * if ready_to_prepare_cb is set to null,
1564 * esplusplayer_ready_to_prepare_cb() will not be invoked anymore.
1566 int esplusplayer_set_ready_to_prepare_cb(
1567 esplusplayer_handle handle,
1568 esplusplayer_ready_to_prepare_cb ready_to_prepare_cb, void* userdata);
1571 * @brief Set a callback function to be invoked when player is prepared to
1573 * @param [in] handle : esplusplayer handle.
1574 * @param [in] prepare_async_done_cb : the prepare async done callback
1575 * function to register.
1576 * @param [in] userdata : userdata of prepare_async_done_cb()
1577 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1578 * values will be returned.
1579 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1580 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1581 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1583 * refer to the sample code of plusplayer_prepare_async();
1585 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1586 * or #ESPLUSPLAYER_STATE_IDLE.
1587 * @post esplusplayer_prepare_async_done_cb() will be invoked.
1588 * @exception It is prohibited to call any player APIs at
1589 * esplusplayer_prepare_async_done_cb callback.
1590 * @remark esplusplayer_prepare_async_done_cb()
1591 * if prepare_async_done_cb is set to null,
1592 * esplusplayer_prepare_async_done_cb() will not be
1594 * @see plusplayer_prepare_async
1596 int esplusplayer_set_prepare_async_done_cb(
1597 esplusplayer_handle handle,
1598 esplusplayer_prepare_async_done_cb prepare_async_done_cb, void* userdata);
1601 * @brief Set a callback function to be invoked when player is prepared to
1603 * @param [in] handle : esplusplayer handle.
1604 * @param [in] seek_done_cb : the seek done callback function to register.
1605 * @param [in] userdata : userdata of esplusplayer_seek_done_cb()
1606 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1607 * values will be returned.
1608 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1609 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1610 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1612 * refer to the sample code of esplusplayer_set_error_cb();
1614 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1615 * or #ESPLUSPLAYER_STATE_IDLE.
1616 * @post esplusplayer_seek_done_cb() will be invoked.
1617 * if seek_done_cb is set to null, esplusplayer_seek_done_cb() will
1618 * not be invoked anymore.
1621 int esplusplayer_set_seek_done_cb(esplusplayer_handle handle,
1622 esplusplayer_seek_done_cb seek_done_cb,
1626 * @brief Set a callback function to be invoked when player is prepared to
1627 * receive es packets after flushing all submitted es packets for
1629 * @param [in] handle : esplusplayer handle.
1630 * @param [in] ready_to_seek_cb : the ready to seek callback function to
1632 * @param [in] userdata : userdata of esplusplayer_ready_to_seek_cb()
1633 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1634 * values will be returned.
1635 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1636 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1637 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1639 * refer to the sample code of esplusplayer_set_error_cb();
1641 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1642 * or #ESPLUSPLAYER_STATE_IDLE.
1645 * @remark esplusplayer_seek()
1646 * if ready_to_seek_cb is set to null, esplusplayer_ready_to_seek_cb()
1647 * will not be invoked anymore.
1649 int esplusplayer_set_ready_to_seek_cb(
1650 esplusplayer_handle handle, esplusplayer_ready_to_seek_cb ready_to_seek_cb,
1654 * @brief Set a callback function to be invoked when player decoded video
1655 * frame. A video frame can be retrieved using a registered callback.
1656 * @param [in] handle : esplusplayer handle.
1657 * @param [in] media_packet_video_decoded_cb : the media packet video
1658 * decoded callback function to register.
1659 * @param [in] userdata : userdata of
1660 * esplusplayer_set_media_packet_video_decoded_cb()
1661 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1662 * values will be returned.
1663 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1664 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1665 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1667 * refer to the sample code of esplusplayer_set_error_cb();
1669 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1670 * or #ESPLUSPLAYER_STATE_IDLE.
1673 * @remark esplusplayer_set_video_frame_buffer_type()
1674 * if media_packet_video_decoded_cb is set to null,
1675 * esplusplayer_error_cb() will not be invoked anymore.
1676 * media packets have to be released by calling
1677 * esplusplayer_decoded_buffer_destroy().
1678 * @see esplusplayer_set_video_frame_buffer_scale_resolution
1680 int esplusplayer_set_media_packet_video_decoded_cb(
1681 esplusplayer_handle handle,
1682 esplusplayer_media_packet_video_decoded_cb media_packet_video_decoded_cb,
1686 * @brief Set closed caption callback function.
1687 * @description In this function set closed caption callback to handle the
1688 * closed caption. If there is closed caption to display,
1689 * esplusplayer_closed_caption_cb will be called to notify there
1690 * is closed caption to display.
1691 * @param [in] handle : esplusplayer handle ptr.
1692 * @param [in] closed_caption_cb : the closed caption callback function to
1694 * @param [in] userdata : userdata of esplusplayer_closed_caption_cb
1695 * callback function.
1696 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1697 * values will be returned.
1698 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1699 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1700 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1702 * refer to the sample code of esplusplayer_set_error_cb();
1704 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1705 * or #ESPLUSPLAYER_STATE_IDLE.
1706 * @post When there is closed caption data, call
1707 * esplusplayer_closed_caption_cb to notify that there is closed
1708 * caption needed to be displayed.
1710 * @remark esplusplayer_closed_caption_cb \n
1711 * [in] data : closed caption data \n
1712 * [in] size : length of closed caption data \n
1713 * [in] userdata : userdata of esplusplayer_closed_caption_cb
1714 * callback function.
1715 * if closed_caption_cb is set to null, esplusplayer_closed_caption_cb()
1716 * will not be invoked anymore.
1718 int esplusplayer_set_closed_caption_cb(
1719 esplusplayer_handle handle,
1720 esplusplayer_closed_caption_cb closed_caption_cb, void* userdata);
1723 * @brief Set a callback function to be invoked when the flush operation is
1725 * @param [in] handle : esplusplayer handle.
1726 * @param [in] flush_done_cb : the flush done callback function to register.
1727 * @param [in] userdata : userdata of esplusplayer_flush_done_cb()
1728 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1729 * values will be returned.
1730 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1731 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1732 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1734 * refer to the sample code of esplusplayer_set_error_cb();
1736 * @pre This api should be called before esplusplayer_flush() is called
1737 * @post esplusplayer_flush_done_cb() will be invoked.
1739 * @remark called before esplusplayer_flush().
1740 * if flush_done_cb is set to null, esplusplayer_error_cb() will
1741 * not be invoked anymore.
1743 int esplusplayer_set_flush_done_cb(esplusplayer_handle handle,
1744 esplusplayer_flush_done_cb flush_done_cb,
1747 * @brief Set a callback function to be invoked when a specific event
1749 * @param [in] handle : esplusplayer handle.
1750 * @param [in] event_cb : the callback function to register.
1751 * @param [in] userdata : userdata of esplusplayer_event_cb()
1752 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1753 * values will be returned.
1754 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1755 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1756 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1758 * refer to the sample code of esplusplayer_set_error_cb();
1760 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1761 * or #ESPLUSPLAYER_STATE_IDLE.
1762 * @post esplusplayer_event_cb() will be invoked.
1764 * @remark esplusplayer_set_event_cb()
1765 * if event_cb is set to null, esplusplayer_event_cb() will not be
1768 int esplusplayer_set_event_cb(esplusplayer_handle handle,
1769 esplusplayer_event_cb event_cb, void* userdata);
1771 * @brief Provided api for destroying decoded buffer.
1772 * @param [in] handle : esplusplayer handle.
1773 * @param [in] packet : the decoded buffer.
1774 * @return @c one of esplusplayer_error_type values will be returned.
1775 * @pre The player state can be greater than #ESPLUSPLAYER_STATE_IDLE.
1776 * @post esplusplayer_decoded_buffer_destroy will be invoked for video
1779 * @remark esplusplayer_decoded_buffer_destroy().
1781 int esplusplayer_decoded_buffer_destroy(
1782 esplusplayer_handle handle, esplusplayer_decoded_video_packet* packet);
1785 * @brief Provided api for setting low latency mode, multiple modes can be
1787 * @param [in] handle : esplusplayer handle.
1788 * @param [in] mode : one of the low latency mode to set.
1789 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1790 * values will be returned.
1791 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1792 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1793 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1795 * esplusplayer_open(esplayer);
1796 * esplusplayer_set_low_latency_mode(esplayer, ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
1797 * // ... your codes ...
1798 * esplusplayer_close(esplayer);
1800 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1803 * @remark Public supports #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL only.
1804 * No operation is performed and #ESPLUSPLAYER_ERROR_TYPE_NONE will be returned,
1805 * if @a mode is not #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL to make compatible with TV API.
1806 * @see esplusplayer_open()
1808 int esplusplayer_set_low_latency_mode(esplusplayer_handle handle,
1809 esplusplayer_low_latency_mode mode);
1812 * @brief Provided api for setting unlimited max buffer mode, the player
1813 * does not limit es packet transmission although in buffer overrun
1815 * @param [in] handle : esplusplayer handle.
1816 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1817 * values will be returned.
1818 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1819 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1820 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1822 * esplusplayer_open(esplayer);
1823 * esplusplayer_set_unlimited_max_buffer_mode(esplayer);
1824 * // ... your codes ...
1825 * esplusplayer_close(esplayer);
1827 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1830 * @remark esplusplayer_set_unlimited_max_buffer_mode().
1831 * esplusplayer_buffer_status_cb() will be invoked in
1832 * overrun/underrun buffer status. but
1833 * esplusplayer_submit_packet() /
1834 * esplusplayer_submit_encrypted_packet()
1835 * does not return ESPLUSPLAYER_SUBMIT_STATUS_FULL
1836 * @see esplusplayer_open() \n
1837 * esplusplayer_submit_packet() \n
1838 * esplusplayer_submit_encrypted_packet()
1840 int esplusplayer_set_unlimited_max_buffer_mode(esplusplayer_handle handle);
1843 * @brief Provided api for setting audio codec type for playback.
1844 * @param [in] handle : esplusplayer handle.
1845 * @param [in] type : codec type(hardware/software).
1846 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1847 * values will be returned.
1848 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1849 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1850 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1852 * esplusplayer_open(esplayer);
1853 * esplusplayer_set_audio_codec_type(esplayer,ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW);
1854 * // ... your codes ...
1855 * esplusplayer_close(esplayer);
1857 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1858 When the audio stream is not set or deactivated, it can be set
1859 in #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
1860 #ESPLUSPLAYER_STATE_PLAYING. The set codec type will be
1861 applied when esplusplayer_activate() is called.
1864 * @see esplusplayer_open() \n
1865 * esplusplayer_deactivate() \n
1866 esplusplayer_activate() \n
1867 esplusplayer_set_audio_stream_info()
1869 int esplusplayer_set_audio_codec_type(esplusplayer_handle handle,
1870 esplusplayer_audio_codec_type type);
1872 * @brief Provided api for setting video codec type for playback.
1873 * @param [in] handle : esplusplayer handle.
1874 * @param [in] type : codec type(hardware/software).
1875 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1876 * values will be returned.
1877 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1878 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1879 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1881 * esplusplayer_open(esplayer);
1882 * esplusplayer_set_video_codec_type(esplayer,ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW);
1883 * // ... your codes ...
1884 * esplusplayer_close(esplayer);
1886 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1887 When the video stream is not set or deactivated, it can be set
1888 in #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
1889 #ESPLUSPLAYER_STATE_PLAYING. The set codec type will be
1890 applied when esplusplayer_activate() is called.
1893 * @see esplusplayer_open() \n
1894 * esplusplayer_deactivate() \n
1895 esplusplayer_activate() \n
1896 esplusplayer_set_video_stream_info()
1898 int esplusplayer_set_video_codec_type(esplusplayer_handle handle,
1899 esplusplayer_video_codec_type type);
1901 * @brief Provided api for setting render time offset
1902 * @param [in] handle : esplusplayer handle ptr.
1903 * @param [in] type : stream type
1904 * @param [in] offset : offset (in milliseconds).
1905 * G_MININT64 <= offset * 1000000 <= G_MAXINT64
1906 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of esplusplayer_error_type
1907 * values will be returned.
1908 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1909 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1910 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1912 * esplusplayer_open(esplayer);
1913 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
1915 * // ... your codes ...
1916 * int64_t set_offset = 10;
1917 * esplusplayer_set_render_time_offset(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
1919 * int64_t get_offset = 0;
1920 * esplusplayer_get_render_time_offset(esplayer_,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
1922 * // ... your codes ...
1923 * esplusplayer_close(esplayer);
1925 * @pre The player state must be set to #ESPLUSPLAYER_STATE_READY,
1926 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
1927 * It have to be set to low latency mode. (all mode except
1928 * # ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC)
1929 * @remark esplusplayer_set_low_latency_mode().
1932 * @see esplusplayer_open()
1933 * esplusplayer_get_render_time_offset()
1935 int esplusplayer_set_render_time_offset(esplusplayer_handle handle,
1936 esplusplayer_stream_type type,
1939 * @brief Provided api for getting render time offset
1940 * @param [in] handle : esplusplayer handle ptr.
1941 * @param [in] type : stream type
1942 * @param [in] offset : offset ptr (in milliseconds).
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 * @pre The player state must be set to #ESPLUSPLAYER_STATE_READY,
1949 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
1950 * It have to be set to low latency mode.
1951 * @remark esplusplayer_set_low_latency_mode().
1954 * see esplusplayer_set_render_time_offset()
1956 int esplusplayer_get_render_time_offset(esplusplayer_handle handle,
1957 esplusplayer_stream_type type,
1960 * @brief Requests decoded video frame packet to acquire it. it works only
1961 * with #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_MANUAL_COPY
1963 * @param [in] handle : esplusplayer handle.
1964 * @param [out] packet : the decoded buffer.
1965 * @param [out] status : (nullable) the result of video frame requested
1966 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
1967 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
1969 * @return #ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise one of
1970 * esplusplayer_error_type values will be returned.
1973 * @see esplusplayer_set_video_frame_buffer_type()
1974 * @see esplusplayer_decoded_buffer_destroy()
1975 * @see esplusplayer_decoded_video_frame_buffer_type
1978 * esplusplayer_set_video_frame_buffer_type(handle,
1979 * ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_MANUAL_COPY);
1981 * esplusplayer_prepare_async(handle);
1984 * esplusplayer_decoded_video_packet packet;
1985 * esplusplayer_get_decoded_video_frame_status_type state;
1986 * int retval = esplusplayer_get_decoded_video_packet(handle, &packet, &state);
1987 * if (state == ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_SUCCESS) {
1988 * // successful case.
1989 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
1990 * // you have to call esplusplayer_decoded_buffer_destroy() after using the
1993 * esplusplayer_decoded_buffer_destroy(handle, &packet);
1994 * } else if (state ==
1995 * ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_REMAINING_BUFFER) {
1996 * // app has to call esplusplayer_decoded_buffer_destroy() with previous
1998 * // it means player couldn't draw the video frame into a buffer due to no
2000 * // in this case ,retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
2001 * } else if (state ==
2002 * ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_FILLED_BUFFER) {
2003 * // it means app should retry to get decoded video packet.
2004 * // in most case, there were no buffers drawn in the timing you called this
2006 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
2007 * } else if (state == ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN) {
2008 * // internal error happened
2009 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION
2014 int esplusplayer_get_decoded_video_packet(
2015 esplusplayer_handle handle, esplusplayer_decoded_video_packet* packet,
2016 esplusplayer_get_decoded_video_frame_status_type* status);
2019 * @brief Provided api for enabling video hole.
2020 * @param [in] handle : esplusplayer handle.
2021 * @param [in] value : the value of video hole.
2022 * (@c true = video hole enabled, @c false = video hole disabled)
2023 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of esplusplayer_error_type
2024 * values will be returned.
2025 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2026 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2027 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
2029 * esplusplayer_open(esplayer);
2030 * esplusplayer_enable_video_hole(esplayer, false);
2031 * // ... your codes ...
2032 * esplusplayer_close(esplayer);
2034 * @pre The player state must not be #ESPLUSPLAYER_STATE_NONE.
2035 * @remark To disable video hole, esplusplayer_decoded_video_frame_buffer_type() must
2036 * not be set to #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE.
2037 * To enable video hole, esplusplayer_set_display() must be set to #ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY
2040 * @see esplusplayer_set_video_frame_buffer_type()
2041 * esplusplayer_set_media_packet_video_decoded_cb()
2043 int esplusplayer_enable_video_hole(esplusplayer_handle handle, const bool value);
2049 #endif // __PLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__