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 Create a esplusplayer handle.
294 * @return return esplusplayer handle pointer.
296 * esplusplayer_handle esplayer = esplusplayer_create();
297 * // ... your codes ...
298 * esplusplayer_destroy(esplayer);
301 * @post The player state will be #ESPLUSPLAYER_STATE_NONE.
304 esplusplayer_handle esplusplayer_create();
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
315 * esplusplayer_handle esplayer = esplusplayer_create();
316 * esplusplayer_open(esplayer);
317 * // ... your codes ...
318 * esplusplayer_close(esplayer);
319 * esplusplayer_destroy(esplayer);
321 * @pre The player state must be #ESPLUSPLAYER_STATE_NONE.
322 * @post The player state will be #ESPLUSPLAYER_STATE_IDLE.
324 * @see esplusplayer_close()
326 int esplusplayer_open(esplusplayer_handle handle);
329 * @brief Release all the player resources and all setting except callback
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.
341 * @see esplusplayer_open()
343 int esplusplayer_close(esplusplayer_handle handle);
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
354 * refer to the sample code of esplusplayer_create()
356 * @pre The player state must be #ESPLUSPLAYER_STATE_NONE
357 * @post player handle will be removed.
359 * @see esplusplayer_create()
361 int esplusplayer_destroy(esplusplayer_handle handle);
364 * @brief Flush the specific buffered stream data and release TV resource
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
375 refer to the sample code of esplusplayer_activate()
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.
382 * @see esplusplayer_activate
384 int esplusplayer_deactivate(esplusplayer_handle handle,
385 esplusplayer_stream_type type);
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
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);
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.
417 * @see esplusplayer_prepare_async()
419 int esplusplayer_activate(esplusplayer_handle handle,
420 esplusplayer_stream_type type);
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
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");
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);
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
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.
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()
464 int esplusplayer_prepare_async(esplusplayer_handle handle);
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
475 * prepare esplayer done
476 * esplusplayer_start(esplayer);
477 * // ... your codes ...
478 * esplusplayer_stop(esplayer);
480 * @pre The player state should be #ESPLUSPLAYER_STATE_READY.
481 * @post The player state will be #ESPLUSPLAYER_STATE_PLAYING.
483 * @see esplusplayer_open() \n
484 * esplusplayer_prepare_async() \n
485 * esplusplayer_stop() \n
486 * esplusplayer_close()
488 int esplusplayer_start(esplusplayer_handle handle);
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
499 * prepare esplayer done
500 * // ... your codes ...
501 * esplusplayer_stop(esplayer);
502 * // ... your codes ...
503 * esplusplayer_close(esplayer);
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.
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()
517 int esplusplayer_stop(esplusplayer_handle handle);
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
528 * prepare esplayer done
529 * // ... your codes ...
530 * esplusplayer_pause(esplayer);
531 * // ... your codes ...
532 * esplusplayer_stop(esplayer);
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.
538 * @see esplusplayer_start() \n
539 * esplusplayer_resume() \n
540 * esplusplayer_prepare_async()
542 int esplusplayer_pause(esplusplayer_handle handle);
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
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);
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.
565 * @see esplusplayer_start() \n
566 * esplusplayer_pause() \n
567 * esplusplayer_prepare_async()
569 int esplusplayer_resume(esplusplayer_handle handle);
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:
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
583 * prepare esplayer done
584 * // ... your codes ...
585 * esplusplayer_set_playback_rate(esplayer,2,true);
586 * // ... your codes ...
587 * esplusplayer_stop(esplayer);
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.
594 * @see esplusplayer_prepare_async()
596 int esplusplayer_set_playback_rate(esplusplayer_handle handle,
597 const double playback_rate,
598 const bool audio_mute);
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
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);
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
626 * @remark esplusplayer_set_seek_done_cb() will be invoked if seek operation
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()
636 int esplusplayer_seek(esplusplayer_handle handle, uint64_t time_ms);
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
649 * esplusplayer_open(esplayer);
650 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
651 * // ... your codes ...
652 * esplusplayer_close(esplayer);
654 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
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()
665 int esplusplayer_set_display(esplusplayer_handle handle,
666 esplusplayer_display_type type, void* window);
668 #ifdef TIZEN_FEATURE_TV
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.
683 * @see esplusplayer_set_display_mode() \n
684 * esplusplayer_set_display_roi() \n
685 * esplusplayer_set_display_visible()
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);
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
703 * esplusplayer_open(esplayer);
704 * esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
705 * // ... your codes ...
706 * esplusplayer_close(esplayer);
708 * @pre The player state can be all of #esplusplayer_state except
709 * #ESPLUSPLAYER_STATE_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()
718 int esplusplayer_set_display_mode(esplusplayer_handle handle,
719 esplusplayer_display_mode mode);
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
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);
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().
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()
753 int esplusplayer_set_display_roi(esplusplayer_handle handle, int x, int y,
754 int width, int height);
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
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);
775 * @pre The player state can be all of #esplusplayer_state except
776 * #ESPLUSPLAYER_STATE_NONE. \n
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()
784 int esplusplayer_set_video_roi(esplusplayer_handle handle, double scale_x,
785 double scale_y, double scale_w, double scale_h);
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
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);
804 * @pre The player state can be all of #esplusplayer_state except
805 * #ESPLUSPLAYER_STATE_NONE.
808 * @see esplusplayer_open() \n
809 * esplusplayer_set_display()
811 int esplusplayer_set_display_visible(esplusplayer_handle handle, bool visible);
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
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);
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.
833 * @see esplusplayer_open() \n
834 * esplusplayer_set_display()
836 int esplusplayer_set_display_rotation(
837 esplusplayer_handle handle, esplusplayer_display_rotation_type rotation);
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
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
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);
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.
862 * @see esplusplayer_open() \n
863 * esplusplayer_set_display_rotation()
865 int esplusplayer_get_display_rotation(
866 esplusplayer_handle handle, esplusplayer_display_rotation_type* rotation);
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
879 * esplusplayer_open(esplayer);
880 * esplusplayer_set_submit_data_type(esplayer,ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA);
881 * // ... your codes ...
882 * esplusplayer_close(esplayer);
884 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
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
897 int esplusplayer_set_submit_data_type(esplusplayer_handle handle,
898 esplusplayer_submit_data_type type);
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
911 * esplusplayer_open(esplayer);
912 * esplusplayer_set_audio_mute(esplayer, true);
913 * // ... your codes ...
914 * esplusplayer_close(esplayer);
916 * @pre The player state can be all of #esplusplayer_state except
917 * #ESPLUSPLAYER_STATE_NONE.
920 * @see esplusplayer_open()
922 int esplusplayer_set_audio_mute(esplusplayer_handle handle, bool mute);
925 * @brief Get current state of player.
926 * @param [in] handle : esplusplayer handle.
927 * @return current #esplusplayer_state of player.
929 * esplusplayer_handle esplayer = esplusplayer_create();
930 * // ... your codes ...
931 * esplusplayer_state ret = esplusplayer_get_state(esplayer);
932 * // ... your codes ...
933 * esplusplayer_destroy(esplayer);
939 esplusplayer_state esplusplayer_get_state(esplusplayer_handle handle);
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
947 * otherwise @c : fail to submit es packet.
949 * static void OnPrepareDone(bool ret, void* userdata) {
950 * // ... your codes ...
951 * printf ("OnPrepareDone\n");
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
957 * //Something you want to do when feed es audio stream is allowed
959 * //Something you want to do when OnReadyToPrepare
960 * printf ("OnReadyToPrepare\n");
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
969 * //Something you want to do when es video buffer is not enough
972 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
973 * //Something you want to do when es audio buffer is enough
975 * //Something you want to do when es audio buffer is not enough
978 * //Something you want to do when OnBufferByteStatus
979 * printf ("OnBufferByteStatus\n");
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
988 * //Something you want to do when es video buffer is not enough
991 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
992 * //Something you want to do when es audio buffer is enough
994 * //Something you want to do when es audio buffer is not enough
997 * //Something you want to do when OnBufferTimeStatus
998 * printf ("OnBufferTimeStatus\n");
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);
1005 * // ... your codes ...
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);
1020 * @pre User can submit es packets after
1021 * esplusplayer_ready_to_prepare_cb() or
1022 * esplusplayer_ready_to_seek_cb() is called.
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()
1036 esplusplayer_submit_status esplusplayer_submit_packet(
1037 esplusplayer_handle handle, esplusplayer_es_packet* packet);
1039 #ifdef TIZEN_FEATURE_TV
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
1050 * otherwise @c : fail to submit es packet.
1052 * refer to the sample code of esplusplayer_submit_packet();
1054 * @pre User can submit es packets after
1055 * esplusplayer_ready_to_prepare_cb() or
1056 * esplusplayer_ready_to_seek_cb() is called.
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()
1074 esplusplayer_submit_status esplusplayer_submit_encrypted_packet(
1075 esplusplayer_handle handle, esplusplayer_es_packet* packet,
1076 esplusplayer_drm_info* drm_info);
1080 * @brief Generate EOS(End Of Stream) packet explicitly and submit it to the
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
1086 * otherwise @c : fail to submit EOS packet.
1088 * esplusplayer_handle esplayer = esplusplayer_create();
1089 * // ... your codes ...
1090 * esplusplayer_submit_eos_packet(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1091 * // ... your codes ...
1097 esplusplayer_submit_status esplusplayer_submit_eos_packet(
1098 esplusplayer_handle handle, esplusplayer_stream_type type);
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
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);
1118 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1119 * audio stream is deactivated.
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
1127 int esplusplayer_set_audio_stream_info(esplusplayer_handle handle,
1128 esplusplayer_audio_stream_info* stream);
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.
1143 * @remark This API have to be called before calling the
1144 * esplusplayer_prepare_async().
1145 * @see esplusplayer_audio_stream_info
1146 * esplusplayer_activate
1148 int esplusplayer_set_video_stream_info(esplusplayer_handle handle,
1149 esplusplayer_video_stream_info* stream);
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
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);
1169 * @pre The player must be one of #ESPLUSPLAYER_STATE_PAUSE or
1170 * #ESPLUSPLAYER_STATE_PLAYING.
1173 * @see esplusplayer_prepare_async()
1175 int esplusplayer_get_playing_time(esplusplayer_handle handle, uint64_t* ms);
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
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);
1196 * @pre The player must be one of #ESPLUSPLAYER_STATE_READY,
1197 * #ESPLUSPLAYER_STATE_PAUSE or #ESPLUSPLAYER_STATE_PLAYING.
1200 * @see esplusplayer_prepare_async()
1202 int esplusplayer_get_adaptive_info(
1203 esplusplayer_handle handle, void* padaptive_info,
1204 esplusplayer_adaptive_info_type adaptive_type);
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
1216 * esplusplayer_open(esplayer);
1218 * esplusplayer_set_volume(esplayer, vol)
1219 * // ... your codes ...
1220 * esplusplayer_close(esplayer);
1222 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1225 * @see esplusplayer_open()
1227 int esplusplayer_set_volume(esplusplayer_handle handle, const int volume);
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
1239 * esplusplayer_open(esplayer);
1240 * // ... your codes ...
1242 * esplusplayer_get_volume(esplayer, &vol)
1243 * // ... your codes ...
1244 * esplusplayer_close(esplayer);
1246 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1249 * @see esplusplayer_open()
1251 int esplusplayer_get_volume(esplusplayer_handle handle, int* volume);
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
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);
1269 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE when type
1271 ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1272 The player state must be not #ESPLUSPLAYER_STATE_NONE when
1274 ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
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()
1284 int esplusplayer_set_video_frame_buffer_type(
1285 esplusplayer_handle handle,
1286 esplusplayer_decoded_video_frame_buffer_type type);
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
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
1300 * prepare esplayer done
1301 * // ... your codes ...
1302 * esplusplayer_flush(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1303 * // ... your codes ...
1304 * esplusplayer_stop(esplayer);
1306 * @pre The player state should greater than #ESPLUSPLAYER_STATE_IDLE
1309 * @see esplusplayer_prepare_async()
1311 int esplusplayer_flush(esplusplayer_handle handle,
1312 esplusplayer_stream_type type);
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.
1320 * // ... your codes ...
1321 * const char* error;
1322 * error = esplusplayer_get_error_string(ESPLUSPLAYER_ERROR_TYPE_NOT_SUPPORTED_FILE);
1323 * // ... your codes ...
1329 const char* esplusplayer_get_error_string(esplusplayer_error_type type);
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
1342 * static void OnError(const esplusplayer_error_type err_code, void*
1344 * //Something you want to do when error occur
1345 * printf ("OnError\n");
1347 * esplusplayer_handle esplayer = esplusplayer_create();
1348 * esplusplayer_set_error_cb(esplayer, OnError, nullptr);
1349 * // ... your codes ...
1350 * esplusplayer_destroy(esplayer);
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.
1356 * @remark esplusplayer_error_cb()
1357 * if error_cb is set to null, esplusplayer_error_cb() will not be
1360 int esplusplayer_set_error_cb(esplusplayer_handle handle,
1361 esplusplayer_error_cb error_cb, void* userdata);
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
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
1376 * refer to the sample code of esplusplayer_set_error_cb();
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.
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.
1386 int esplusplayer_set_buffer_status_cb(
1387 esplusplayer_handle handle, esplusplayer_buffer_status_cb buffer_status_cb,
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
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
1403 * refer to the sample code of esplusplayer_submit_packet();
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.
1409 * @remark esplusplayer_buffer_byte_status_cb()
1411 int esplusplayer_set_buffer_byte_status_cb(
1412 esplusplayer_handle handle,
1413 esplusplayer_buffer_byte_status_cb buffer_status_cb, void* userdata);
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
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
1428 refer to the sample code of esplusplayer_submit_packet();
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.
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.
1440 int esplusplayer_set_buffer_time_status_cb(
1441 esplusplayer_handle handle,
1442 esplusplayer_buffer_time_status_cb buffer_status_cb, void* userdata);
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
1455 * esplusplayer_open(esplayer);
1456 * esplusplayer_set_buffer_size(esplayer,ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE,10240)
1457 * // ... your codes ...
1458 * esplusplayer_close(esplayer);
1460 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1463 * @remark esplusplayer_buffer_option
1464 * @see esplusplayer_open()
1466 int esplusplayer_set_buffer_size(esplusplayer_handle handle,
1467 esplusplayer_buffer_option option,
1470 * @brief Set a callback function to be invoked when resource confliction is
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
1482 * refer to the sample code of esplusplayer_set_error_cb();
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.
1488 * @remark esplusplayer_resource_conflicted_cb()
1489 * if resource_conflicted_cb is set to null,
1490 * esplusplayer_resource_conflicted_cb() will not be invoked
1493 int esplusplayer_set_resource_conflicted_cb(
1494 esplusplayer_handle handle,
1495 esplusplayer_resource_conflicted_cb resource_conflicted_cb, void* userdata);
1498 * @brief Set a callback function to be invoked when player has reached the
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
1509 * refer to the sample code of esplusplayer_set_error_cb();
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.
1515 * @remark esplusplayer_eos_cb()
1516 * if eos_cb is set to null, esplusplayer_eos_cb() will not be
1519 int esplusplayer_set_eos_cb(esplusplayer_handle handle,
1520 esplusplayer_eos_cb eos_cb, void* userdata);
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
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
1535 * refer to the sample code of esplusplayer_submit_packet();
1537 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1538 * or #ESPLUSPLAYER_STATE_IDLE.
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.
1545 int esplusplayer_set_ready_to_prepare_cb(
1546 esplusplayer_handle handle,
1547 esplusplayer_ready_to_prepare_cb ready_to_prepare_cb, void* userdata);
1550 * @brief Set a callback function to be invoked when player is prepared to
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
1562 * refer to the sample code of plusplayer_prepare_async();
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
1573 * @see plusplayer_prepare_async
1575 int esplusplayer_set_prepare_async_done_cb(
1576 esplusplayer_handle handle,
1577 esplusplayer_prepare_async_done_cb prepare_async_done_cb, void* userdata);
1580 * @brief Set a callback function to be invoked when player is prepared to
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
1591 * refer to the sample code of esplusplayer_set_error_cb();
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.
1600 int esplusplayer_set_seek_done_cb(esplusplayer_handle handle,
1601 esplusplayer_seek_done_cb seek_done_cb,
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
1608 * @param [in] handle : esplusplayer handle.
1609 * @param [in] ready_to_seek_cb : the ready to seek callback function to
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
1618 * refer to the sample code of esplusplayer_set_error_cb();
1620 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1621 * or #ESPLUSPLAYER_STATE_IDLE.
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.
1628 int esplusplayer_set_ready_to_seek_cb(
1629 esplusplayer_handle handle, esplusplayer_ready_to_seek_cb ready_to_seek_cb,
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
1646 * refer to the sample code of esplusplayer_set_error_cb();
1648 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1649 * or #ESPLUSPLAYER_STATE_IDLE.
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
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,
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
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
1681 * refer to the sample code of esplusplayer_set_error_cb();
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.
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.
1697 int esplusplayer_set_closed_caption_cb(
1698 esplusplayer_handle handle,
1699 esplusplayer_closed_caption_cb closed_caption_cb, void* userdata);
1702 * @brief Set a callback function to be invoked when the flush operation is
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
1713 * refer to the sample code of esplusplayer_set_error_cb();
1715 * @pre This api should be called before esplusplayer_flush() is called
1716 * @post esplusplayer_flush_done_cb() will be invoked.
1718 * @remark called before esplusplayer_flush().
1719 * if flush_done_cb is set to null, esplusplayer_error_cb() will
1720 * not be invoked anymore.
1722 int esplusplayer_set_flush_done_cb(esplusplayer_handle handle,
1723 esplusplayer_flush_done_cb flush_done_cb,
1726 * @brief Set a callback function to be invoked when a specific event
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
1737 * refer to the sample code of esplusplayer_set_error_cb();
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.
1743 * @remark esplusplayer_set_event_cb()
1744 * if event_cb is set to null, esplusplayer_event_cb() will not be
1747 int esplusplayer_set_event_cb(esplusplayer_handle handle,
1748 esplusplayer_event_cb event_cb, void* userdata);
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
1758 * @remark esplusplayer_decoded_buffer_destroy().
1760 int esplusplayer_decoded_buffer_destroy(
1761 esplusplayer_handle handle, esplusplayer_decoded_video_packet* packet);
1764 * @brief Provided api for setting low latency mode, multiple modes can be
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
1774 * esplusplayer_open(esplayer);
1775 * esplusplayer_set_low_latency_mode(esplayer, ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
1776 * // ... your codes ...
1777 * esplusplayer_close(esplayer);
1779 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
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()
1787 int esplusplayer_set_low_latency_mode(esplusplayer_handle handle,
1788 esplusplayer_low_latency_mode mode);
1791 * @brief Provided api for setting unlimited max buffer mode, the player
1792 * does not limit es packet transmission although in buffer overrun
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
1801 * esplusplayer_open(esplayer);
1802 * esplusplayer_set_unlimited_max_buffer_mode(esplayer);
1803 * // ... your codes ...
1804 * esplusplayer_close(esplayer);
1806 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
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()
1819 int esplusplayer_set_unlimited_max_buffer_mode(esplusplayer_handle handle);
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
1831 * esplusplayer_open(esplayer);
1832 * esplusplayer_set_audio_codec_type(esplayer,ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW);
1833 * // ... your codes ...
1834 * esplusplayer_close(esplayer);
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.
1843 * @see esplusplayer_open() \n
1844 * esplusplayer_deactivate() \n
1845 esplusplayer_activate() \n
1846 esplusplayer_set_audio_stream_info()
1848 int esplusplayer_set_audio_codec_type(esplusplayer_handle handle,
1849 esplusplayer_audio_codec_type type);
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
1860 * esplusplayer_open(esplayer);
1861 * esplusplayer_set_video_codec_type(esplayer,ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW);
1862 * // ... your codes ...
1863 * esplusplayer_close(esplayer);
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.
1872 * @see esplusplayer_open() \n
1873 * esplusplayer_deactivate() \n
1874 esplusplayer_activate() \n
1875 esplusplayer_set_video_stream_info()
1877 int esplusplayer_set_video_codec_type(esplusplayer_handle handle,
1878 esplusplayer_video_codec_type type);
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
1891 * esplusplayer_open(esplayer);
1892 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
1894 * // ... your codes ...
1895 * int64_t set_offset = 10;
1896 * esplusplayer_set_render_time_offset(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
1898 * int64_t get_offset = 0;
1899 * esplusplayer_get_render_time_offset(esplayer_,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
1901 * // ... your codes ...
1902 * esplusplayer_close(esplayer);
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().
1911 * @see esplusplayer_open()
1912 * esplusplayer_get_render_time_offset()
1914 int esplusplayer_set_render_time_offset(esplusplayer_handle handle,
1915 esplusplayer_stream_type type,
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().
1933 * see esplusplayer_set_render_time_offset()
1935 int esplusplayer_get_render_time_offset(esplusplayer_handle handle,
1936 esplusplayer_stream_type type,
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
1949 * esplusplayer_open(esplayer);
1950 * esplusplayer_enable_video_hole(esplayer, false);
1951 * // ... your codes ...
1952 * esplusplayer_close(esplayer);
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
1960 * @see esplusplayer_set_video_frame_buffer_type()
1961 * esplusplayer_set_media_packet_video_decoded_cb()
1963 int esplusplayer_enable_video_hole(esplusplayer_handle handle, const bool value);
1969 #endif // __PLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__