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
15 * Licensed under the Apache License, Version 2.0 (the "License");
16 * you may not use this file except in compliance with the License.
17 * You may obtain a copy of the License at
19 * http://www.apache.org/licenses/LICENSE-2.0
21 * Unless required by applicable law or agreed to in writing, software
22 * distributed under the License is distributed on an "AS IS" BASIS,
23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 * See the License for the specific language governing permissions and
25 * limitations under the License.
28 #ifndef __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
29 #define __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
31 #include "esplusplayer_capi/buffer.h"
32 #include "esplusplayer_capi/display.h"
33 #include "esplusplayer_capi/drm.h"
34 #include "esplusplayer_capi/error.h"
35 #include "esplusplayer_capi/espacket.h"
36 #include "esplusplayer_capi/event.h"
37 #include "esplusplayer_capi/latency.h"
38 #include "esplusplayer_capi/state.h"
39 #include "esplusplayer_capi/stream.h"
40 #include "esplusplayer_capi/submitdatatype.h"
41 #include "esplusplayer_capi/submitstatus.h"
49 typedef void (*esplusplayer_error_cb)(const esplusplayer_error_type, void*);
50 typedef void (*esplusplayer_buffer_status_cb)(const esplusplayer_stream_type,
51 const esplusplayer_buffer_status,
53 typedef void (*esplusplayer_buffer_byte_status_cb)(
54 const esplusplayer_stream_type, const esplusplayer_buffer_status, uint64_t,
56 typedef void (*esplusplayer_buffer_time_status_cb)(
57 const esplusplayer_stream_type, const esplusplayer_buffer_status, uint64_t,
59 typedef void (*esplusplayer_resource_conflicted_cb)(void*);
60 typedef void (*esplusplayer_eos_cb)(void*);
61 typedef void (*esplusplayer_ready_to_prepare_cb)(const esplusplayer_stream_type,
63 typedef void (*esplusplayer_prepare_async_done_cb)(bool, void*);
64 typedef void (*esplusplayer_seek_done_cb)(void*);
65 typedef void (*esplusplayer_ready_to_seek_cb)(const esplusplayer_stream_type,
66 const uint64_t, void*);
67 typedef void (*esplusplayer_media_packet_video_decoded_cb)(
68 const esplusplayer_decoded_video_packet*, void*);
69 typedef void (*esplusplayer_closed_caption_cb)(const char* data, const int size,
71 typedef void (*esplusplayer_flush_done_cb)(void*);
72 typedef void (*esplusplayer_event_cb)(const esplusplayer_event_type,
73 const esplusplayer_event_msg, void*);
74 typedef void (*esplusplayer_video_latency_status_cb)(
75 const esplusplayer_latency_status latency_status, void*);
76 typedef void (*esplusplayer_audio_latency_status_cb)(
77 const esplusplayer_latency_status latency_status, void*);
78 typedef void (*esplusplayer_video_high_latency_cb)(void*);
79 typedef void (*esplusplayer_audio_high_latency_cb)(void*);
80 typedef void (*esplusplayer_video_frame_dropped_cb)(const uint64_t count,
82 typedef void (*esplusplayer_decoder_buffer_time_cb)(
83 const esplusplayer_stream_type, const esplusplayer_decoder_buffer_time,
86 typedef void* esplusplayer_handle;
89 * @brief Enumerations for the Adaptive info type
91 typedef enum esplusplayer_adaptive_info_type {
92 ESPLUSPLAYER_ADAPT_INFO_TYPE_NONE,
93 ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_FRAMES,
94 ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_VIDEO_FRAMES_FOR_CATCHUP,
95 ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_AUDIO_FRAMES_FOR_CATCHUP,
96 } esplusplayer_adaptive_info_type;
99 * @brief Enumerations for low latency mode
102 typedef enum esplusplayer_low_latency_mode {
103 ESPLUSPLAYER_LOW_LATENCY_MODE_NONE = 0x0000,
105 * @description to support audio fast decoding/rendering
107 ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO = 0x0001,
109 * @description to support video fast decoding/rendering
110 * Video stream should be composed only of P and I frames.
111 * The mode support seamless resolution change since tizen 6.5
113 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO = 0x0010,
115 * @description to support video fast decoding/rendering and video
116 * distortion concealment.
117 * Video stream should be composed only of P and I frames.
118 * For applications using the UDP protocol, packet loss can
119 * occur. when video distortion by video packet loss is
120 * detected, it is a function to conceal distortion by showing
121 * previous vido frame. It is supported only in h.264 codec &
122 * FHD or lower resolution.
124 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO_DISTORTION_CONCEALMENT =
125 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO | 0x0020,
127 * @description to disable clock sync and a/v sync when rendering. it
128 * includes #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL.
130 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC = 0x0100,
132 * @description to disable preroll which means player doesn't wait for
133 * first buffer when state is changed to
134 * #ESPLUSPLAYER_STATE_READY from #ESPLUSPLAYER_STATE_IDLE.
135 * It changes the state immediately.
136 * It's usually used for sparse stream. (e.g. video packet
137 * arrives but audio packet does't yet.)
139 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL = 0x0200,
141 * @deprecated Deprecated since tizen 6.5
142 * @description to set lower video quality
143 * If set this value, it can use original game_mode.
144 * This value will be deprecated from 2022TV.
145 * Please use ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE.
147 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY = 0x1000,
149 * @description to set game mode for minimum latency
150 * Video stream should be composed only of P and I frames.
151 * It must not be used together with
152 * #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
153 * If use this value, It can expect better latency performance
154 * than #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
155 * The mode support seamless resolution change.
156 * The mode use lower video quality.
158 ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE =
159 ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO |
160 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO | 0x2000,
162 * @description to set game mode for latency
163 * Video stream should be composed only of P and I frames.
164 * Video stream must use fixed resolution.
165 * It must not be used together with
166 * #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
167 * If use this value, It can expect better latency
169 * #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY and
170 * #ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE
171 * The mode use lower video quality.
173 ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE_WITH_FIXED_RESOLUTION =
174 ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE | 0x4000,
175 } esplusplayer_low_latency_mode;
178 * @brief Enumerations for esplusplayer audio codec type
180 typedef enum esplusplayer_audio_codec_type {
182 * @description hardware codec can only be selected, default type
184 ESPLUSPLAYER_AUDIO_CODEC_TYPE_HW,
186 * @description sorfware codec can only be selected
188 ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW
189 } esplusplayer_audio_codec_type;
192 * @brief Enumerations for esplusplayer video codec type
194 typedef enum esplusplayer_video_codec_type {
196 * @description hardware codec can only be selected, default type
198 ESPLUSPLAYER_VIDEO_CODEC_TYPE_HW,
200 * @description software codec can only be selected
202 ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW,
204 * @description hardware codec using n-decoding mode can only be selected.
205 It must set display type to mixer type by display setting
207 esplusplayer_set_display()
209 ESPLUSPLAYER_VIDEO_CODEC_TYPE_HW_N_DECODING
211 } esplusplayer_video_codec_type;
213 * @brief Enumerations for esplusplayer audio easing type
216 typedef enum esplusplayer_audio_easing_type {
218 * @description audio easing function type is linear
220 ESPLUSPLAYER_AUDIO_EASING_LINEAR,
222 * @description audio easing function type is incubic
224 ESPLUSPLAYER_AUDIO_EASING_INCUBIC,
226 * @description audio easing function type is outcubic
228 ESPLUSPLAYER_AUDIO_EASING_OUTCUBIC,
230 * @description audio easing function type is none
232 ESPLUSPLAYER_AUDIO_EASING_NONE
233 } esplusplayer_audio_easing_type;
236 * @brief Enumerations for esplusplayer resource type
239 typedef enum esplusplayer_rsc_type {
241 * @description video renderer type
243 ESPLUSPLAYER_RSC_TYPE_VIDEO_RENDERER
244 } esplusplayer_rsc_type;
247 * @brief Enumerations for advanced video quality type
250 typedef enum esplusplayer_advanced_picture_quality_type {
252 * @description advanced picture quality for video call
255 ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_VIDEO_CALL,
257 * @description advanced picture quality for usb camera
260 ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_USB_CAMERA,
262 * @description advanced picture quality for airplay screen mirroring
265 ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_AIRPLAY_MIRRORING
266 } esplusplayer_advanced_picture_quality_type;
269 * @brief Enumerations for audio resource type
272 typedef enum esplusplayer_audio_resource_type {
274 * @description all audio resources(decoder/audio out) to main resources
276 ESPLUSPLAYER_AUDIO_RESOURCE_MAIN,
278 * @description only audio decoder to sub resource
280 ESPLUSPLAYER_AUDIO_RESOURCE_SUB_DECODER,
282 * @description only audio out to simple mix out resource
284 ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT
285 } esplusplayer_audio_resource_type;
288 * @brief Enumerations for buffer level of simple mix out
291 typedef enum esplusplayer_simple_mix_out_buffer_level {
293 * @description buffer level is low
295 ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_LOW,
297 * @description buffer level is middle, default type
299 ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_MID,
301 * @description buffer level is high
303 ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_HIGH
304 } esplusplayer_simple_mix_out_buffer_level;
307 * @brief ESPlusplayer easing target volume, duration, type information
312 * @description audio easing target volume (0 ~ 100)
316 * @description audio easing duration, in millisecond
318 unsigned int duration;
320 * @description audio easing function type
322 esplusplayer_audio_easing_type type;
323 } esplusplayer_target_audio_easing_info;
326 * @brief ESPlusplayer app id, version, type information
330 * @description App id for controlling resource.
334 * @description When there is playback market issue, KPI logger will
339 * @description RunningApps.InformationTicker will use this type to show
340 * stream information. ex) "MSE", "HTML5", etc..
343 } esplusplayer_app_info;
346 * @brief ESPlusplayer app id, version, type, runtitle information
351 * @description App id for controlling resource.
355 * @description When there is playback market issue, KPI logger will
360 * @description RunningApps.InformationTicker will use this type to show
361 * stream information. ex) "MSE", "HTML5", etc..
365 * @description App runtitle.
368 } esplusplayer_app_info_ex;
372 * @description the minimum frame number in case of mid latency
374 int mid_latency_threshold;
376 * @description the minimum frame number in case of high latency
378 int high_latency_threshold;
379 } esplusplayer_latency_threshold;
382 * @brief rational number numerator/denominator
386 * @description the numerator value
390 * @description the denominator value
393 } esplusplayer_rational;
396 * @brief resource allocate policy
399 typedef enum esplusplayer_rsc_alloc_policy {
401 * @description exclusive policy, RM will return the requested resources,
404 ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE = 0,
406 * @description conditional policy, when trying to allocate resources and
407 * available resources are not left, RM will return fail.
409 ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE_CONDITIONAL,
411 * @description inapp multiview policy, RM will return available
415 ESPLUSPLAYER_RSC_ALLOC_INAPP_MULTIVIEW,
417 * @description Forced to allocate mfc decoder ,used senario of get decoded
422 ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE_MFC_FORCED
423 } esplusplayer_rsc_alloc_policy;
426 * @brief Enumerations for the status of getting decoded video frame
429 typedef enum esplusplayer_get_decoded_video_frame_status_type {
430 /** @brief successfully decoded video frame acquired. */
431 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_SUCCESS,
432 /** @brief it means app has to return the video before getting decoded
435 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_REMAINING_BUFFER,
437 * @brief there is no filled video frame yet.
439 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_FILLED_BUFFER,
441 * @brief internal error
443 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN
444 } esplusplayer_get_decoded_video_frame_status_type;
447 * @brief Enumerations for the video scan type
450 typedef enum esplusplayer_video_scan_type {
452 * @description progressive, mfd or dvde will be allocated for H.264 2K in
455 ESPLUSPLAYER_VIDEO_SCAN_TYPE_PROGRESSIVE,
457 * @description interlaced, only mfd has been allocated for H.264 2K in normal
460 ESPLUSPLAYER_VIDEO_SCAN_TYPE_INTERLACED,
461 } esplusplayer_video_scan_type;
464 * @brief Enumerations for the time unit type
467 typedef enum esplusplayer_time_unit_type {
469 * @description the timeunit will be ms. It is default value.
471 ESPLUSPLAYER_TIME_UNIT_MS,
473 * @description the timeunit will be us.
475 ESPLUSPLAYER_TIME_UNIT_US,
476 } esplusplayer_time_unit_type;
479 * @brief Enumerations for the video stream rotation type
482 typedef enum esplusplayer_video_stream_rotation_type {
483 ESPLUSPLAYER_VIDEO_ROTATION_NONE,
484 ESPLUSPLAYER_VIDEO_ROTATION_90,
485 ESPLUSPLAYER_VIDEO_ROTATION_180,
486 ESPLUSPLAYER_VIDEO_ROTATION_270
487 } esplusplayer_video_stream_rotation_type;
490 * @brief Create a esplusplayer handle.
492 * @return return esplusplayer handle pointer.
494 * esplusplayer_handle esplayer = esplusplayer_create();
495 * // ... your codes ...
496 * esplusplayer_destroy(esplayer);
499 * @post The player state will be #ESPLUSPLAYER_STATE_NONE.
502 esplusplayer_handle esplusplayer_create();
505 * @brief Open esplusplayer handle.
506 * @param [in] handle : esplusplayer handle
507 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
508 * esplusplayer_error_type
509 * values will be returned.
510 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
511 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
512 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
515 * esplusplayer_handle esplayer = esplusplayer_create();
516 * esplusplayer_open(esplayer);
517 * // ... your codes ...
518 * esplusplayer_close(esplayer);
519 * esplusplayer_destroy(esplayer);
521 * @pre The player state must be #ESPLUSPLAYER_STATE_NONE.
522 * @post The player state will be #ESPLUSPLAYER_STATE_IDLE.
524 * @see esplusplayer_close()
526 int esplusplayer_open(esplusplayer_handle handle);
529 * @brief Release all the player resources and all setting except callback
531 * @param [in] handle : esplusplayer handle.
532 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
533 * esplusplayer_error_type
534 * values will be returned.
535 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
536 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
537 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
539 * @pre The player state must be all of #esplusplayer_state except
540 * #ESPLUSPLAYER_STATE_NONE.
541 * @post The player state will be #ESPLUSPLAYER_STATE_NONE.
543 * @see esplusplayer_open()
545 int esplusplayer_close(esplusplayer_handle handle);
548 * @brief Release player handle.
549 * @param [in] handle : esplusplayer handle.
550 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
551 * esplusplayer_error_type
552 * values will be returned.
553 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
554 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
555 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
558 * refer to the sample code of esplusplayer_create()
560 * @pre The player state must be #ESPLUSPLAYER_STATE_NONE
561 * @post player handle will be removed.
563 * @see esplusplayer_create()
565 int esplusplayer_destroy(esplusplayer_handle handle);
568 * @brief Not play the specific stream anymore.
569 * @remark The submitted es packets will be dropped after deactivated.
570 * It recommands to stop feeding the specific stream's packets.
571 * @param [in] handle : esplusplayer handle.
572 * @param [in] type : stream type which user want to deactivate.
573 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
574 * esplusplayer_error_type
575 * values will be returned.
576 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
577 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
578 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
581 * refer to the sample code of esplusplayer_activate()
583 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY
584 * @post The player state is same as before calling
585 * esplusplayer_deactivate(). The buffered data of the deactivated
586 * stream will be flushed and the resources for decoding and rendering will be
589 * @see esplusplayer_activate
591 int esplusplayer_deactivate(esplusplayer_handle handle,
592 esplusplayer_stream_type type);
595 * @brief Restart to play the specific stream.
596 * @remark If user wants to change the specific stream info, new stream info
597 * has to be set before activate. User has to submit the specific stream from
598 * the current playing time for activating. The video stream has to be submitted
600 * @param [in] handle : esplusplayer handle.
601 * @param [in] type : stream type which user want to activate.
602 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
603 * esplusplayer_error_type
604 * values will be returned.
605 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
606 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
607 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
610 * prepare esplayer done
611 * // ... your codes ...
612 * esplusplayer_deactivate(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
613 * esplusplayer_set_video_stream_info* stream;
614 * stream->width = 640;
615 * stream->height = 352;
616 * stream->mime_type = ESPLUSPLAYER_VIDEO_MIME_TYPE_H264;
617 * stream->framerate_num = 30;
618 * stream->framerate_den = 1;
619 * esplusplayer_set_video_stream_info(esplayer, stream);
620 * esplusplayer_activate(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
621 * // ... your codes ...
622 * esplusplayer_close(esplayer);
623 * esplusplayer_destroy(esplayer);
625 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY
626 * @post The player state is same as before calling
627 * esplusplayer_activate(). Rebuild pipeline to render the stream.
629 * @see esplusplayer_prepare_async()
631 int esplusplayer_activate(esplusplayer_handle handle,
632 esplusplayer_stream_type type);
635 * @brief Not play the audio stream anymore.
636 * @remark User has to keep feeding audio packets like when playing audio.
637 * @param [in] handle : esplusplayer handle.
638 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
639 * esplusplayer_error_type
640 * values will be returned.
641 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
642 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
643 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
646 * refer to the sample code of esplusplayer_activate_audio()
648 * @pre The player state must be at least #ESPLUSPLAYER_STATE_IDLE
649 * @post The player state is same as before calling
650 * esplusplayer_deactivate_audio(). The player will keep buffering
651 * the audio packets and consuming it at the rendering time.
652 * All audio resources of decoder and renderer will be released.
655 * @see esplusplayer_activate_audio
657 int esplusplayer_deactivate_audio(esplusplayer_handle handle);
660 * @brief Restart to play the audio stream.
661 * @remark User can't change the audio stream info before activate.
662 * @param [in] handle : esplusplayer handle.
663 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
664 * 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
671 * // play one esplayer in normal
672 * esplusplayer_handle esplayer1 = esplusplayer_create();
673 * esplusplayer_open(esplayer1);
674 * esplusplayer_audio_stream_info audio_stream_1;
675 * audio_stream_1.codec_data = nullptr;
676 * audio_stream_1.codec_data_length = 0;
677 * esplusplayer_set_audio_stream_info(esplayer1, &audio_stream_1);
678 * // ... your codes ...
679 * esplusplayer_prepare_async(esplayer1);
680 * esplusplayer_start(esplayer1);
682 * // play one more esplayer started in deactivate
683 * esplusplayer_handle esplayer2 = esplusplayer_create();
684 * esplusplayer_open(esplayer2);
685 * esplusplayer_audio_stream_info audio_stream_2;
686 * audio_stream_2.codec_data = nullptr;
687 * audio_stream_2.codec_data_length = 0;
688 * esplusplayer_set_audio_stream_info(esplayer2, &audio_stream_2);
689 * // ... your codes ...
690 * esplusplayer_deactivate_audio(esplayer2);
691 * esplusplayer_prepare_async(esplayer2);
692 * esplusplayer_start(esplayer2);
694 * // if you want to play esplayer2, deactivate esplayer1 first
695 * // and then activate esplayer2
696 * esplusplayer_deactivate_audio(esplayer1);
697 * esplusplayer_activate_audio(esplayer2);
698 * // ... your codes ...
699 * esplusplayer_close(esplayer1);
700 * esplusplayer_destroy(esplayer1);
701 * esplusplayer_close(esplayer2);
702 * esplusplayer_destroy(esplayer2);
704 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY
705 * @post The player state is same as before calling
706 * esplusplayer_activate_audio(). Rebuild audio pipeline to render
710 * @see esplusplayer_deactivate_audio
712 int esplusplayer_activate_audio(esplusplayer_handle handle);
715 * @brief Prepare the player for playback, asynchronously.
716 * @param [in] handle : esplusplayer handle.
717 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
718 * 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
725 * static void OnPrepareDone(bool ret, void* userdata) {
726 * //Something you want to do when prepare done, but, we strongly
727 * //recommend DO NOT CALL PLAYER APIs in this callbck
728 * printf("OnPrepareDone\n");
730 * esplusplayer_handle esplayer = esplusplayer_create();
731 * esplusplayer_set_prepare_async_done_cb(esplayer,
732 * OnPrepareDone,nullptr);
733 * esplusplayer_open(esplayer);
734 * esplusplayer_prepare_async(esplayer);
735 * // ... your codes ...
736 * esplusplayer_close(esplayer);
737 * esplusplayer_destroy(esplayer);
739 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE. \n
740 * Call at least one of esplusplayer_set_video_stream_info() or
741 * esplusplayer_set_audio_stream_info(). \n
742 * @post It invokes esplusplayer_prepare_async_done_cb() when prepare is
744 * Prepare result can be succeeded or not at this moment. \n
745 * If the result is succeeded, the player state will be
746 * #ESPLUSPLAYER_STATE_READY and one frame will be displayed
747 * unless esplusplayer_set_display_visible() is set to @c false.
749 * @remark esplusplayer_prepare_async_done_cb() can be invoked only when as
750 * many es packets as at least one decoded frame is submitted. \n
751 * The player can receive es packets after
752 * esplusplayer_ready_to_seek_cb() is called.
753 * @see esplusplayer_open() \n
754 * esplusplayer_stop() \n
755 * esplusplayer_submit_packet() \n
756 * esplusplayer_ready_to_prepare_cb() \n
757 * esplusplayer_close()
759 int esplusplayer_prepare_async(esplusplayer_handle handle);
762 * @brief Start playback.
763 * @param [in] handle : esplusplayer handle.
764 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
765 * esplusplayer_error_type
766 * values will be returned.
767 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
768 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
769 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
772 * prepare esplayer done
773 * esplusplayer_start(esplayer);
774 * // ... your codes ...
775 * esplusplayer_stop(esplayer);
777 * @pre The player state should be #ESPLUSPLAYER_STATE_READY.
778 * @post The player state will be #ESPLUSPLAYER_STATE_PLAYING.
780 * @see esplusplayer_open() \n
781 * esplusplayer_prepare_async() \n
782 * esplusplayer_stop() \n
783 * esplusplayer_close()
785 int esplusplayer_start(esplusplayer_handle handle);
788 * @brief Stop playing media content.
789 * @param [in] handle : esplusplayer handle.
790 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
791 * esplusplayer_error_type
792 * values will be returned.
793 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
794 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
795 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
798 * prepare esplayer done
799 * // ... your codes ...
800 * esplusplayer_stop(esplayer);
801 * // ... your codes ...
802 * esplusplayer_close(esplayer);
804 * @pre The player state must be all of #esplusplayer_state except
805 * #ESPLUSPLAYER_STATE_NONE.
806 * @post The player state will be #ESPLUSPLAYER_STATE_IDLE.
808 * @remark esplusplayer_close() must be called once after player is stopped
809 * @see esplusplayer_open() \n
810 * esplusplayer_prepare_async() \n
811 * esplusplayer_start() \n
812 * esplusplayer_pause() \n
813 * esplusplayer_resume() \n
814 * esplusplayer_close()
816 int esplusplayer_stop(esplusplayer_handle handle);
819 * @brief Pause playing media content.
820 * @param [in] handle : esplusplayer handle.
821 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
822 * esplusplayer_error_type
823 * values will be returned.
824 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
825 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
826 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
829 * prepare esplayer done
830 * // ... your codes ...
831 * esplusplayer_pause(esplayer);
832 * // ... your codes ...
833 * esplusplayer_stop(esplayer);
835 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
836 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
837 * @post The player state will be #ESPLUSPLAYER_STATE_PAUSE.
839 * @see esplusplayer_start() \n
840 * esplusplayer_resume() \n
841 * esplusplayer_prepare_async()
843 int esplusplayer_pause(esplusplayer_handle handle);
846 * @brief Resume playing media content.
847 * @param [in] handle : esplusplayer handle.
848 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
849 * esplusplayer_error_type
850 * values will be returned.
851 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
852 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
853 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
856 * prepare esplayer done
857 * // ... your codes ...
858 * esplusplayer_pause(esplayer);
859 * // ... your codes ...
860 * esplusplayer_resume(esplayer);
861 * // ... your codes ...
862 * esplusplayer_stop(esplayer);
864 * @pre The player state must be one of #ESPLUSPLAYER_STATE_PAUSED or
865 * #ESPLUSPLAYER_STATE_PLAYING.
866 * @post The player state will be #ESPLUSPLAYER_STATE_PLAYING.
868 * @see esplusplayer_start() \n
869 * esplusplayer_pause() \n
870 * esplusplayer_prepare_async()
872 int esplusplayer_resume(esplusplayer_handle handle);
875 * @brief Set playback rate.
876 * @param [in] handle : esplusplayer handle.
877 * @param [in] playback_rate : the playback rate from 0.0 to 2.0.
878 * @param [in] audio_mute : the audio is mute on/off, true: mute on, false:
880 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
881 * esplusplayer_error_type
882 * values will be returned.
883 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
884 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
885 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
888 * prepare esplayer done
889 * // ... your codes ...
890 * esplusplayer_set_playback_rate(esplayer,2,true);
891 * // ... your codes ...
892 * esplusplayer_stop(esplayer);
894 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
895 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING. \n
896 * User has to push the data as fast as playback rate.
899 * @see esplusplayer_prepare_async()
901 int esplusplayer_set_playback_rate(esplusplayer_handle handle,
902 const double playback_rate,
903 const bool audio_mute);
906 * @brief Seek for playback, asynchronously.
907 * @param [in] handle : esplusplayer handle.
908 * @param [in] time : seek time default in milliseconds, can be set by
909 * @esplusplayer_set_timeunit_type
910 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
911 * esplusplayer_error_type
912 * values will be returned.
913 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
914 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
915 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
918 * prepare esplayer done
919 * // ... your codes ...
920 * const uint64_t ms_to_seek = 0;
921 * esplusplayer_seek(esplayer,ms_to_seek);
922 * // ... your codes ...
923 * esplusplayer_stop(esplayer);
925 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
926 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
927 * In ESPLUSPLAYER_STATE_IDLE, this api can be called exceptionally
928 * between esplusplayer_open() and esplusplayer_prepare_async().
929 * the start time of plyabak can be set explicitly when starting
930 * first playback. In this case, esplusplayer_set_seek_done_cb is not
934 * @remark esplusplayer_set_seek_done_cb() will be invoked if seek operation
936 * Seek result can be succeeded or not at this moment. \n
937 * esplusplayer_set_seek_done_cb() can be invoked only when as many
938 * es packets as at least one decoded frame is submitted. \n
939 * The player can receive es packets from seek time after
940 * esplusplayer_ready_to_seek_cb() is invoked.
941 * @see esplusplayer_ready_to_seek_cb() \n
942 * esplusplayer_prepare_async()
944 int esplusplayer_seek(esplusplayer_handle handle, uint64_t time);
947 * @brief Set App id to esplayer to control resource confliction.
948 * @param [in] handle : esplusplayer handle.
949 * @param [in] app_info : application id, version, type.
950 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
951 * esplusplayer_error_type
952 * values will be returned.
953 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
954 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
955 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
958 * esplusplayer_app_info appinfo;
959 * appinfo.id = "youtube";
960 * appinfo.version = "3.0";
961 * appinfo.type = "MSE";
962 * esplusplayer_handle esplayer = esplusplayer_create();
963 * esplusplayer_open(esplayer);
964 * esplusplayer_set_app_info(esplayer,&appinfo);
965 * // ... your codes ...
966 * esplusplayer_close(esplayer);
968 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
971 * @see esplusplayer_open()
973 int esplusplayer_set_app_info(esplusplayer_handle handle,
974 const esplusplayer_app_info* app_info);
977 * @brief Set the video display.
978 * @param [in] handle : esplusplayer handle.
979 * @param [in] type : display type.
980 * @param [in] window : the handle to display window.
981 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
982 * esplusplayer_error_type
983 * values will be returned.
984 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
985 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
986 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
989 * esplusplayer_open(esplayer);
990 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
991 * // ... your codes ...
992 * esplusplayer_close(esplayer);
994 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
997 * @remark Esplusplayer is not supporting changing display. \n
998 * This API have to be called before calling
999 * esplusplayer_prepare_async() to reflect the display type.
1000 * @see esplusplayer_open() \n
1001 * esplusplayer_set_display_mode() \n
1002 * esplusplayer_set_display_roi() \n
1003 * esplusplayer_set_display_visible()
1005 int esplusplayer_set_display(esplusplayer_handle handle,
1006 esplusplayer_display_type type, void* window);
1008 * @brief Set the video display.
1009 * @param [in] handle : esplusplayer handle.
1010 * @param [in] type : display type.
1011 * @param [in] subsurface : the ecore wayland subsurface handle.
1012 * @param [in] x : the x coordinate of subsurface.
1013 * @param [in] y : the y coordinate of subsurface.
1014 * @param [in] width : the width of subsurface.
1015 * @param [in] height : the height of subsurface.
1016 * @return @c one of esplusplayer_error_type values will be returned.
1017 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
1021 * @see esplusplayer_set_display_mode() \n
1022 * esplusplayer_set_display_roi() \n
1023 * esplusplayer_set_display_visible()
1025 int esplusplayer_set_display_ecore_subsurface(esplusplayer_handle handle,
1026 esplusplayer_display_type type,
1027 void* subsurface, int x, int y,
1028 int width, int height);
1030 * @brief Set the video display.
1031 * @param [in] handle : esplusplayer handle.
1032 * @param [in] type : display type.
1033 * @param [in] window : the ecore wayland2 window handle.
1034 * @param [in] x : the x coordinate of window.
1035 * @param [in] y : the ycoordinate of window.
1036 * @param [in] width : the width of window.
1037 * @param [in] height : the height of window.
1038 * @return @c one of esplusplayer_error_type values will be returned.
1039 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
1043 * @see esplusplayer_set_display_mode() \n
1044 * esplusplayer_set_display_roi() \n
1045 * esplusplayer_set_display_visible()
1047 int esplusplayer_set_ecore_display(esplusplayer_handle handle,
1048 esplusplayer_display_type type, void* window,
1049 int x, int y, int width, int height);
1051 * @brief Set the video display mode.
1052 * @param [in] handle : esplusplayer handle.
1053 * @param [in] mode : display mode.
1054 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1055 * esplusplayer_error_type
1056 * values will be returned.
1057 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1058 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1059 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1062 * esplusplayer_open(esplayer);
1063 * esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
1064 * // ... your codes ...
1065 * esplusplayer_close(esplayer);
1067 * @pre The player state can be all of #esplusplayer_state except
1068 * #ESPLUSPLAYER_STATE_NONE.
1071 * @remark If no display is set, no operation is performed.
1072 * @see esplusplayer_open() \n
1073 * esplusplayer_set_display_mode() \n
1074 * esplusplayer_set_display_roi() \n
1075 * esplusplayer_set_display_visible()
1077 int esplusplayer_set_display_mode(esplusplayer_handle handle,
1078 esplusplayer_display_mode mode);
1081 * @brief Set the ROI(Region Of Interest) area of display.
1082 * @param [in] handle : esplusplayer handle.
1083 * @param [in] x : var startPointX in src video area.
1084 * @param [in] y : var startPointY in src video area.
1085 * @param [in] width : width of display in src video area.
1086 * @param [in] height : height of display in src video area.
1087 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1088 * esplusplayer_error_type
1089 * values will be returned.
1090 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1091 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1092 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1095 * esplusplayer_open(esplayer);
1096 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
1097 * esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
1098 * esplusplayer_set_display_roi(esplayer,0,0,600,500);
1099 * // ... your codes ...
1100 * esplusplayer_close(esplayer);
1102 * @pre The player state can be all of #esplusplayer_state except
1103 * #ESPLUSPLAYER_STATE_NONE. \n
1104 * Before set display ROI, #ESPLUSPLAYER_DISPLAY_MODE_DST_ROI
1105 * must be set with esplusplayer_set_display_mode().
1108 * @remark The minimum value of width and height are 1.
1109 * @see esplusplayer_open() \n
1110 * esplusplayer_set_display() \n
1111 * esplusplayer_set_display_mode() \n
1112 * esplusplayer_set_display_visible()
1114 int esplusplayer_set_display_roi(esplusplayer_handle handle, int x, int y,
1115 int width, int height);
1118 * @brief Set the video stretch mode on 21:9 TV.
1119 * @param [in] handle : esplusplayer handle.
1120 * @param [in] mode : stretch mode.
1121 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1122 * esplusplayer_error_type
1123 * values will be returned.
1124 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1125 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1126 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1129 * esplusplayer_open(esplayer);
1130 * esplusplayer_set_stretch_mode(esplayer,1);
1131 * // ... your codes ...
1132 * esplusplayer_close(esplayer);
1134 * @pre The player state can be all of #esplusplayer_state except
1135 * #ESPLUSPLAYER_STATE_NONE.
1139 * @remark If no display is set, no operation is performed.
1140 * @see esplusplayer_open() \n
1141 * esplusplayer_set_video_roi()
1143 int esplusplayer_set_stretch_mode(esplusplayer_handle handle, int mode);
1146 * @brief Set the Crop Area(Region Of Src ratio) area of display.
1147 * @param [in] handle : esplusplayer handle.
1148 * @param [in] scale_x: x label ratio in src video area.
1149 * @param [in] scale_y: y label ratio in src video area.
1150 * @param [in] scale_w: width ratio in src video area.
1151 * @param [in] scale_h: height ratio in src video area.
1152 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1153 * esplusplayer_error_type
1154 * values will be returned.
1155 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1156 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1157 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1160 * esplusplayer_open(esplayer);
1161 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
1162 * esplusplayer_set_video_roi(esplayer,0,0,0.5,0.5);
1163 * // ... your codes ...
1164 * esplusplayer_close(esplayer);
1166 * @pre The player state can be all of #esplusplayer_state except
1167 * #ESPLUSPLAYER_STATE_NONE. \n
1170 * @remark The minimum value of input are 0,maximun value is 1.
1171 * @see esplusplayer_open() \n
1172 * esplusplayer_set_display() \n
1173 * esplusplayer_set_display_visible()
1175 int esplusplayer_set_video_roi(esplusplayer_handle handle, double scale_x,
1176 double scale_y, double scale_w, double scale_h);
1179 * @brief Resize the render rectangle(the max region that video can be
1181 * @param [in] handle : esplusplayer handle.
1182 * @param [in] x: x coordinate of render rectangle.
1183 * @param [in] y: y coordinate of render rectangle.
1184 * @param [in] width: width of render rectangle.
1185 * @param [in] height: height of render rectangle.
1186 * @return @c one of esplusplayer_error_type values will be returned.
1187 * @pre Should be called after esplusplayer_set_display() \n
1188 * esplusplayer_set_surface_display() \n
1189 * esplusplayer_set_ecore_display() \n
1190 * esplusplayer_set_display_ecore_subsurface
1194 * @remark The minimum value of width and height are 1.
1195 * @see esplusplayer_set_display() \n
1196 * esplusplayer_set_surface_display() \n
1197 * esplusplayer_set_ecore_display() \n
1198 * esplusplayer_set_display_ecore_subsurface
1200 int esplusplayer_resize_render_rect(esplusplayer_handle handle, int x, int y,
1201 int width, int height);
1204 * @brief Set the visibility of the video display.
1205 * @param [in] handle : esplusplayer handle.
1206 * @param [in] visible : the visibility of the display.
1207 * (@c true = visible, @c false = non-visible)
1208 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1209 * esplusplayer_error_type
1210 * values will be returned.
1211 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1212 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1213 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1216 * esplusplayer_open(esplayer);
1217 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
1218 * esplusplayer_set_display_visible(esplayer,false);
1219 * // ... your codes ...
1220 * esplusplayer_close(esplayer);
1222 * @pre The player state can be all of #esplusplayer_state except
1223 * #ESPLUSPLAYER_STATE_NONE.
1226 * @see esplusplayer_open() \n
1227 * esplusplayer_set_display()
1229 int esplusplayer_set_display_visible(esplusplayer_handle handle, bool visible);
1232 * @brief Set the rotate angle of the video display.
1233 * @param [in] handle : esplusplayer handle.
1234 * @param [in] rotation : the rotate angle of the display.
1235 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1236 * esplusplayer_error_type
1237 * values will be returned.
1238 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1239 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1240 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1243 * esplusplayer_open(esplayer);
1244 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
1245 * esplusplayer_set_display_rotation(esplayer_,ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_90);
1246 * // ... your codes ...
1247 * esplusplayer_close(esplayer);
1249 * @pre The player state can be all of #esplusplayer_state except
1250 * #ESPLUSPLAYER_STATE_NONE.
1251 * @post this API worked only when video sink created.
1253 * @see esplusplayer_open() \n
1254 * esplusplayer_set_display()
1256 int esplusplayer_set_display_rotation(
1257 esplusplayer_handle handle, esplusplayer_display_rotation_type rotation);
1260 * @brief Get the rotate angle of the video display.
1261 * @param [in] handle : esplusplayer handle.
1262 * @param [out] rotation : the rotate angle of the display which want to
1264 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1265 * esplusplayer_error_type
1266 * values will be returned.
1267 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1268 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1269 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1272 * esplusplayer_open(esplayer);
1273 * esplusplayer_set_display_rotation(esplayer,ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_90);
1274 * esplusplayer_display_rotation_type rotation_get =
1275 * ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_NONE;
1276 * // ... your codes ...
1277 * esplusplayer_get_display_rotation(esplayer,&rotation_get);
1278 * // ... your codes ...
1279 * esplusplayer_close(esplayer);
1281 * @pre The player state can be all of #esplusplayer_state except
1282 * #ESPLUSPLAYER_STATE_NONE.
1283 * @post this API worked only when video sink created.
1285 * @see esplusplayer_open() \n
1286 * esplusplayer_set_display_rotation()
1288 int esplusplayer_get_display_rotation(
1289 esplusplayer_handle handle, esplusplayer_display_rotation_type* rotation);
1292 * @deprecated Deprecated since API V2.0. Use
1293 * esplusplayer_set_submit_data_type() instead.
1294 * @brief Set whether to send decrypted es packets in the trust zone.
1295 * @param [in] handle : esplusplayer handle.
1296 * @param [in] using_tz : whether to use trust zone memory.
1297 * (@c true = if decrypted packets are sent in trust zone, @c false =
1299 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1300 * esplusplayer_error_type
1301 * values will be returned.
1302 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1303 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1304 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1307 * esplusplayer_open(esplayer);
1308 * esplusplayer_set_tz_use(esplayer, true);
1309 * // ... your codes ...
1310 * esplusplayer_close(esplayer);
1312 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1315 * @remark This API have to be called before calling
1316 * esplusplayer_prepare_async(). \n If using_tz is set to true, use
1317 * esplusplayer_submit_trust_zone_packet() to send decrypted packets.
1318 * @see esplusplayer_open() \n
1319 * esplusplayer_submit_trust_zone_packet()
1321 int esplusplayer_set_tz_use(esplusplayer_handle handle, bool using_tz);
1324 * @brief Set whether to send decrypted es packets in the trust zone or
1325 * encrypted es packets.
1326 * @param [in] handle : esplusplayer handle.
1327 * @param [in] type : whether to use trust zone memory or encrypted data
1328 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1329 * esplusplayer_error_type
1330 * values will be returned.
1331 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1332 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1333 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1336 * esplusplayer_open(esplayer);
1337 * esplusplayer_set_submit_data_type(esplayer,ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA);
1338 * // ... your codes ...
1339 * esplusplayer_close(esplayer);
1341 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1344 * @remark This API have to be called before calling
1345 * esplusplayer_prepare_async(). \n
1346 * If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA use
1347 * esplusplayer_submit_packet() to send clean packets. \n
1348 * If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_TRUSTZONE_DATA, use
1349 * esplusplayer_submit_trust_zone_packet() to send decrypted packets
1351 * If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA, use
1352 * esplusplayer_submit_encrypted_packet() to send encrypted packets.
1353 * @see esplusplayer_open() \n
1354 * esplusplayer_submit_trust_zone_packet() \n
1355 * esplusplayer_submit_encrypted_packet() \n
1356 * esplusplayer_submit_data_type
1358 int esplusplayer_set_submit_data_type(esplusplayer_handle handle,
1359 esplusplayer_submit_data_type type);
1362 * @brief Set on mute of the audio sound.
1363 * @param [in] handle : esplusplayer handle.
1364 * @param [in] mute : on mute of the sound.
1365 * (@c true = mute, @c false = non-mute)
1366 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of
1367 * esplusplayer_error_type
1368 * values will be returned.
1369 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1370 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1371 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1374 * esplusplayer_open(esplayer);
1375 * esplusplayer_set_audio_mute(esplayer, true);
1376 * // ... your codes ...
1377 * esplusplayer_close(esplayer);
1379 * @pre The player state can be all of #esplusplayer_state except
1380 * #ESPLUSPLAYER_STATE_NONE.
1383 * @see esplusplayer_open()
1385 int esplusplayer_set_audio_mute(esplusplayer_handle handle, bool mute);
1388 * @brief Get current state of player.
1389 * @param [in] handle : esplusplayer handle.
1390 * @return current #esplusplayer_state of player.
1392 * esplusplayer_handle esplayer = esplusplayer_create();
1393 * // ... your codes ...
1394 * esplusplayer_state ret = esplusplayer_get_state(esplayer);
1395 * // ... your codes ...
1396 * esplusplayer_destroy(esplayer);
1402 esplusplayer_state esplusplayer_get_state(esplusplayer_handle handle);
1405 * @brief Submit es packet to decode audio or video.
1406 * @param [in] handle : esplusplayer handle.
1407 * @param [in] packet : es packet pointer.
1408 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1410 * otherwise @c : fail to submit es packet.
1412 * static void OnPrepareDone(bool ret, void* userdata) {
1413 * // ... your codes ...
1414 * printf ("OnPrepareDone\n");
1416 * static void OnReadyToPrepare(const esplusplayer_stream_type
1417 *type,void* userdata) {
1418 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
1419 * //Something you want to do when feed es video stream is
1422 * //Something you want to do when feed es audio stream is
1425 * //Something you want to do when OnReadyToPrepare
1426 * printf ("OnReadyToPrepare\n");
1428 * static void OnBufferByteStatus(const esplusplayer_stream_type
1430 * const esplusplayer_buffer_status
1432 * uint64_t byte_size, void* userdata)
1434 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
1435 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1436 * //Something you want to do when es video buffer is
1439 * //Something you want to do when es video buffer is not
1443 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1444 * //Something you want to do when es audio buffer is
1447 * //Something you want to do when es audio buffer is not
1451 * //Something you want to do when OnBufferByteStatus
1452 * printf ("OnBufferByteStatus\n");
1454 * static void OnBufferTimeStatus(const esplusplayer_stream_type
1456 * const esplusplayer_buffer_status
1458 * uint64_t time_size,void* userdata)
1460 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
1461 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1462 * //Something you want to do when es video buffer is
1465 * //Something you want to do when es video buffer is not
1469 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1470 * //Something you want to do when es audio buffer is
1473 * //Something you want to do when es audio buffer is not
1477 * //Something you want to do when OnBufferTimeStatus
1478 * printf ("OnBufferTimeStatus\n");
1480 * void FeedEsPacket(esplusplayer_handle
1481 *player,esplusplayer_es_packet pkt) {
1482 * // ... your codes ...
1483 * if(feed is allowed && buffer is enough) {
1484 * esplusplayer_submit_packet(player, &pkt);
1486 * // ... your codes ...
1488 * esplusplayer_handle esplayer = esplusplayer_create();
1489 * esplusplayer_set_prepare_async_done_cb(esplayer,OnPrepareDone,&esplayer);
1490 * esplusplayer_set_ready_to_prepare_cb(esplayer,OnReadyToPrepare,&esplayer);
1491 * esplusplayer_set_buffer_byte_status_cb(esplayer,OnBufferByteStatus,&esplayer);
1492 * esplusplayer_set_buffer_time_status_cb(esplayer,OnBufferTimeStatus,&esplayer);
1493 * esplusplayer_open(esplayer);
1494 * esplusplayer_prepare_async(esplayer);
1495 * // ... your codes ...
1496 * //FeedEsPacket()(call a new thread to do this)
1497 * // ... your codes ...
1498 * esplusplayer_close(esplayer);
1499 * esplusplayer_destroy(esplayer);
1501 * @pre User can submit es packets after
1502 * esplusplayer_ready_to_prepare_cb() or
1503 * esplusplayer_ready_to_seek_cb() is called.
1506 * @remark Amount of packets for at least one decoded frame must be submitted
1507 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1508 * for invoking esplusplayer_prepare_async_done_cb() or
1509 * esplusplayer_seek_done_cb() \n
1510 * This api must be called from a different thread than other apis.
1511 * @see esplusplayer_set_submit_data_type() \n
1512 * esplusplayer_es_packet \n
1513 * esplusplayer_buffer_status_cb() \n
1514 * esplusplayer_ready_to_prepare_cb() \n
1515 * esplusplayer_ready_to_seek_cb()
1517 esplusplayer_submit_status esplusplayer_submit_packet(
1518 esplusplayer_handle handle, esplusplayer_es_packet* packet);
1521 * @brief Submit es packet to decode audio or video.
1522 * @param [in] handle : esplusplayer handle.
1523 * @param [in] packet : es packet pointer.
1524 * @param [in] tz_handle : es decrypted tz handle.
1525 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1527 * otherwise @c : fail to submit es packet.
1529 * refer to the sample code of esplusplayer_submit_packet();
1531 * @pre User can submit es packets after
1532 * esplusplayer_ready_to_prepare_cb() or
1533 * esplusplayer_ready_to_seek_cb() is called.
1536 * @remark Amount of packets for at least one decoded frame must be submitted
1537 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1538 * for invoking esplusplayer_prepare_async_done_cb() or
1539 * esplusplayer_seek_done_cb(). \n
1540 * To use this api, Must set
1541 * ESPLUSPLAYER_SUBMIT_DATA_TYPE_TRUSTZONE_DATA using
1542 * esplusplayer_set_submit_data_type() \n This api must be called from a
1543 * different thread than other apis.
1544 * @see esplusplayer_es_packet \n
1545 * esplusplayer_buffer_status_cb() \n
1546 * esplusplayer_ready_to_prepare_cb() \n
1547 * esplusplayer_ready_to_seek_cb()
1549 esplusplayer_submit_status esplusplayer_submit_trust_zone_packet(
1550 esplusplayer_handle handle, esplusplayer_es_packet* packet,
1551 uint32_t tz_handle);
1554 * @brief Submit encrypted es packet to decode and decrypt audio or video.
1555 * @param [in] handle : esplusplayer handle.
1556 * @param [in] packet : es packet pointer.
1557 * @param [in] drm_info : information to decrypt es packet.
1558 * esplusplayer doesn't take ownership. user should
1559 * free it. if you deliver it as (null), this api
1560 * works as esplusplayer_submit_packet().
1561 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1563 * otherwise @c : fail to submit es packet.
1565 * refer to the sample code of esplusplayer_submit_packet();
1567 * @pre User can submit es packets after
1568 * esplusplayer_ready_to_prepare_cb() or
1569 * esplusplayer_ready_to_seek_cb() is called.
1572 * @remark Amount of packets for at least one decoded frame must be submitted
1573 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1574 * for invoking esplusplayer_prepare_async_done_cb() or
1575 * esplusplayer_seek_done_cb(). \n
1576 * To use this api, Must set
1577 * ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA using
1578 * esplusplayer_set_submit_data_type() \n This api must be called from a
1579 * different thread than other apis.
1580 * @see esplusplayer_es_packet \n
1581 * esplusplayer_drm_info_64bit \n
1582 * esplusplayer_buffer_status_cb() \n
1583 * esplusplayer_ready_to_prepare_cb() \n
1584 * esplusplayer_ready_to_seek_cb() \n
1585 * esplusplayer_submit_packet()
1588 esplusplayer_submit_status esplusplayer_submit_encrypted_packet_64bit(
1589 esplusplayer_handle handle, esplusplayer_es_packet* packet,
1590 esplusplayer_drm_info_64bit* drm_info);
1593 * @brief Submit encrypted es packet to decode and decrypt audio or video.
1594 * @param [in] handle : esplusplayer handle.
1595 * @param [in] packet : es packet pointer.
1596 * @param [in] drm_info : information to decrypt es packet.
1597 * esplusplayer doesn't take ownership. user should
1598 * free it. if you deliver it as (null), this api
1599 * works as esplusplayer_submit_packet().
1600 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1602 * otherwise @c : fail to submit es packet.
1604 * refer to the sample code of esplusplayer_submit_packet();
1606 * @pre User can submit es packets after
1607 * esplusplayer_ready_to_prepare_cb() or
1608 * esplusplayer_ready_to_seek_cb() is called.
1611 * @remark Amount of packets for at least one decoded frame must be submitted
1612 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1613 * for invoking esplusplayer_prepare_async_done_cb() or
1614 * esplusplayer_seek_done_cb(). \n
1615 * To use this api, Must set
1616 * ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA using
1617 * esplusplayer_set_submit_data_type() \n This api must be called from a
1618 * different thread than other apis.
1619 * @see esplusplayer_es_packet \n
1620 * esplusplayer_drm_info \n
1621 * esplusplayer_buffer_status_cb() \n
1622 * esplusplayer_ready_to_prepare_cb() \n
1623 * esplusplayer_ready_to_seek_cb() \n
1624 * esplusplayer_submit_packet()
1626 esplusplayer_submit_status esplusplayer_submit_encrypted_packet(
1627 esplusplayer_handle handle, esplusplayer_es_packet* packet,
1628 esplusplayer_drm_info* drm_info);
1631 * @brief Generate EOS(End Of Stream) packet explicitly and submit it to the
1633 * @param [in] handle : esplusplayer handle.
1634 * @param [in] type : stream type which reaches eos.
1635 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit EOS
1637 * otherwise @c : fail to submit EOS packet.
1639 * esplusplayer_handle esplayer = esplusplayer_create();
1640 * // ... your codes ...
1641 * esplusplayer_submit_eos_packet(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1642 * // ... your codes ...
1648 esplusplayer_submit_status esplusplayer_submit_eos_packet(
1649 esplusplayer_handle handle, esplusplayer_stream_type type);
1652 * @brief Set audio stream to have contents information.
1653 * @param [in] handle : esplusplayer handle.
1654 * @param [in] stream : audio stream pointer.
1655 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1656 * esplusplayer_error_type
1657 * values will be returned.
1658 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1659 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1660 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1663 * esplusplayer_open(esplayer);
1664 * esplusplayer_audio_stream_info audio_stream;
1665 * audio_stream.codec_data = nullptr;
1666 * audio_stream.codec_data_length = 0;
1667 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
1668 * // ... your codes ...
1669 * esplusplayer_close(esplayer);
1671 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1672 * audio stream is deactivated.
1675 * @remark This API have to be called before calling the
1676 * esplusplayer_prepare_async().
1677 * @see esplusplayer_open() \n
1678 * esplusplayer_audio_stream_info
1680 int esplusplayer_set_audio_stream_info(esplusplayer_handle handle,
1681 esplusplayer_audio_stream_info* stream);
1684 * @brief Set video stream to have contents information.
1685 * @param [in] handle : esplusplayer handle.
1686 * @param [in] stream : video stream pointer.
1687 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1688 * esplusplayer_error_type
1689 * values will be returned.
1690 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1691 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1692 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1694 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1695 * video stream is deactivated.
1698 * @remark This API have to be called before calling the
1699 * esplusplayer_prepare_async().
1700 * @see esplusplayer_audio_stream_info
1701 * esplusplayer_activate
1703 int esplusplayer_set_video_stream_info(esplusplayer_handle handle,
1704 esplusplayer_video_stream_info* stream);
1707 * @brief Get the current playing time of the associated media.
1708 * @param [in] handle : esplusplayer handle.
1709 * @param [out] cur_time : current playing time default in milliseconds, can
1710 * be set by @esplusplayer_set_timeunit_type
1711 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1712 * esplusplayer_error_type
1713 * values will be returned.
1714 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1715 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1716 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1719 * prepare esplayer done
1720 * esplusplayer_start(esplayer);
1721 * // ... your codes ...
1722 * uint64_t cur_time = 0;
1723 * esplusplayer_get_playing_time(esplayer, &cur_time);
1724 * // ... your codes ...
1725 * esplusplayer_stop(esplayer);
1727 * @pre The player must be one of #ESPLUSPLAYER_STATE_PAUSE or
1728 * #ESPLUSPLAYER_STATE_PLAYING.
1731 * @see esplusplayer_prepare_async()
1733 int esplusplayer_get_playing_time(esplusplayer_handle handle,
1734 uint64_t* cur_time);
1736 * @brief Get dropped frame counts in videosink.
1737 * @param [in] handle : esplusplayer handle.
1738 * @param [out] padaptive_info : dropped frame counts.
1739 * @param [in] adaptive_type : type of adaptive info which APP want to get.
1740 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1741 * esplusplayer_error_type
1742 * values will be returned.
1743 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1744 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1745 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1748 * prepare esplayer done
1749 * // ... your codes ...
1750 * uint64_t count = 0;
1751 * esplusplayer_get_adaptive_info(esplayer,
1752 * static_cast<void*>(&count),ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_FRAMES);
1753 * // ... your codes ...
1754 * esplusplayer_stop(esplayer);
1756 * @pre The player must be one of #ESPLUSPLAYER_STATE_READY,
1757 * #ESPLUSPLAYER_STATE_PAUSE or #ESPLUSPLAYER_STATE_PLAYING.
1760 * @see esplusplayer_prepare_async()
1762 int esplusplayer_get_adaptive_info(
1763 esplusplayer_handle handle, void* padaptive_info,
1764 esplusplayer_adaptive_info_type adaptive_type);
1767 * @brief Set volume to player
1768 * @param [in] handle : esplusplayer handle.
1769 * @param [in] volume : volume level(0 ~ 100).
1770 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1771 * esplusplayer_error_type
1772 * values will be returned.
1773 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1774 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1775 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1778 * esplusplayer_open(esplayer);
1780 * esplusplayer_set_volume(esplayer, vol)
1781 * // ... your codes ...
1782 * esplusplayer_close(esplayer);
1784 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1787 * @see esplusplayer_open()
1789 int esplusplayer_set_volume(esplusplayer_handle handle, const int volume);
1792 * @brief Get volume from player
1793 * @param [in] handle : esplusplayer handle.
1794 * @param [out] volume : volume ptr.
1795 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1796 * esplusplayer_error_type
1797 * values will be returned.
1798 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1799 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1800 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1803 * esplusplayer_open(esplayer);
1804 * // ... your codes ...
1806 * esplusplayer_get_volume(esplayer, &vol)
1807 * // ... your codes ...
1808 * esplusplayer_close(esplayer);
1810 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1813 * @see esplusplayer_open()
1815 int esplusplayer_get_volume(esplusplayer_handle handle, int* volume);
1818 * @brief Set decoded video frame buffer type.
1819 * @param [in] handle : esplusplayer handle.
1820 * @param [in] type : one of the video decoded buffer type to set .
1821 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1822 esplusplayer_error_type
1823 * values will be returned.
1824 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1825 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1826 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1829 * esplusplayer_open(esplayer);
1830 * esplusplayer_set_video_frame_buffer_type(esplayer,
1831 * ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE);
1832 * // ... your codes ...
1833 * esplusplayer_close(esplayer);
1835 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE when type
1837 ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1838 The player state must be not #ESPLUSPLAYER_STATE_NONE when
1840 ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1843 * @remark reference can't support sw codec type.
1844 * esplusplayer_set_media_packet_video_decoded_cb()
1845 * esplusplayer_set_video_codec_type()
1846 * when type is SCALE, the target scale resolution can be set by
1847 * esplusplayer_set_video_frame_buffer_scale_resolution()
1848 * @see esplusplayer_open()
1850 int esplusplayer_set_video_frame_buffer_type(
1851 esplusplayer_handle handle,
1852 esplusplayer_decoded_video_frame_buffer_type type);
1855 * @brief Set the request frame rate of decoded video
1856 * @param [in] handle : esplusplayer handle.
1857 * @param [in] request_framerate : the request frame rate of returned
1858 * decoded video frame
1859 * The value of track_framerate(A) and request_framerate(B)
1860 * should be one of the following sets:
1861 * track_framerate indicate the frame rate of input video stream
1862 * 1.A/(A-B) = X ,X means drop 1 frame every X frame
1863 * 2.Special cases,such as 24000/1000 -> 15000/1000
1864 * when request_framerate.num = 0, return none decoded video
1866 * when request_framerate.num/request_framerate.den =
1867 * track_framerate.num/track_framerate.den, return all decoded
1869 * when request_framerate.num/request_framerate.den <
1870 * track_framerate.num/track_framerate.den, drop some decoded
1872 * @return @c one of esplusplayer_error_type values will be returned.
1873 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1877 * @remark only works when decoded video frame buffer type is scale
1878 * esplusplayer_set_video_frame_buffer_type()
1879 * esplusplayer_set_media_packet_video_decoded_cb()
1881 int esplusplayer_set_decoded_video_frame_rate(
1882 esplusplayer_handle handle, esplusplayer_rational request_framerate);
1885 * @brief Set the target scale resolution when decoded video frame buffer
1887 * @param [in] handle : esplusplayer handle.
1888 * @param [in] target_width : scale target width of video frame buffer.
1889 * @param [in] target_width : scale target height of video frame buffer.
1890 * @return @c one of esplusplayer_error_type values will be returned.
1891 * @pre The player state can be set in all states except
1892 * #ESPLUSPLAYER_STATE_NONE.
1896 * @remark esplusplayer_set_video_frame_buffer_type()
1897 * esplusplayer_set_media_packet_video_decoded_cb()
1898 * If user don't call this api to set target_width and target_height,
1900 * target scale resolution is 960x540
1902 int esplusplayer_set_video_frame_buffer_scale_resolution(
1903 esplusplayer_handle handle, uint32_t target_width, uint32_t target_height);
1906 * @brief Flush buffers for a player.
1907 * @param [in] handle : esplusplayer handle ptr.
1908 * @param [in] type : choose which stream data need to be
1909 * flush,audio/video,if need flush all pipeline can call this API
1911 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1912 * esplusplayer_error_type
1913 * values will be returned.
1914 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1915 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1916 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1919 * prepare esplayer done
1920 * // ... your codes ...
1921 * esplusplayer_flush(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1922 * // ... your codes ...
1923 * esplusplayer_stop(esplayer);
1925 * @pre The player state should greater than #ESPLUSPLAYER_STATE_IDLE
1928 * @see esplusplayer_prepare_async()
1930 int esplusplayer_flush(esplusplayer_handle handle,
1931 esplusplayer_stream_type type);
1934 * @brief Convert the esplusplayer error type to a string.
1935 * @param [in] type : esplusplayer error type
1936 * @return @c not nullptr the converted error string otherwise @c failed to
1937 * convert the error.
1939 * // ... your codes ...
1940 * const char* error;
1942 * esplusplayer_get_error_string(ESPLUSPLAYER_ERROR_TYPE_NOT_SUPPORTED_FILE);
1943 * // ... your codes ...
1949 const char* esplusplayer_get_error_string(esplusplayer_error_type type);
1952 * @brief Sets a callback function to be invoked when an error occurs.
1953 * @param [in] handle : esplusplayer handle.
1954 * @param [in] error_cb : the error callback function to register.
1955 * @param [in] userdata : userdata of esplusplayer_error_cb()
1956 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1957 * esplusplayer_error_type
1958 * values will be returned.
1959 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1960 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1961 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1964 * static void OnError(const esplusplayer_error_type err_code, void*
1966 * //Something you want to do when error occur
1967 * printf ("OnError\n");
1969 * esplusplayer_handle esplayer = esplusplayer_create();
1970 * esplusplayer_set_error_cb(esplayer, OnError, nullptr);
1971 * // ... your codes ...
1972 * esplusplayer_destroy(esplayer);
1974 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1975 * or #ESPLUSPLAYER_STATE_IDLE.
1976 * @post esplusplayer_error_cb() will be invoked.
1978 * @remark esplusplayer_error_cb()
1979 * if error_cb is set to null, esplusplayer_error_cb() will not be
1982 int esplusplayer_set_error_cb(esplusplayer_handle handle,
1983 esplusplayer_error_cb error_cb, void* userdata);
1986 * @brief Set a callback function to be invoked when buffer underrun or
1987 * overflow is occurred.
1988 * @param [in] handle : esplusplayer handle.
1989 * @param [in] buffer_status_cb : the buffer status callback function to
1991 * @param [in] userdata : userdata of esplusplayer_buffer_status_cb()
1992 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1993 * esplusplayer_error_type
1994 * values will be returned.
1995 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1996 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1997 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2000 * refer to the sample code of esplusplayer_set_error_cb();
2002 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2003 * or #ESPLUSPLAYER_STATE_IDLE.
2004 * @post esplusplayer_buffer_status_cb() will be invoked.
2006 * @remark esplusplayer_buffer_status_cb()
2007 * if buffer_status_cb is set to null,
2008 * esplusplayer_buffer_status_cb() will not be invoked anymore.
2010 int esplusplayer_set_buffer_status_cb(
2011 esplusplayer_handle handle, esplusplayer_buffer_status_cb buffer_status_cb,
2015 * @brief Set a callback function to be invoked when buffer underrun or
2016 * overflow is occurred and buffer size in byte will be passed.
2017 * @param [in] handle : esplusplayer handle.
2018 * @param [in] buffer_status_cb : the buffer byte status callback function
2020 * @param [in] userdata : userdata of esplusplayer_buffer_byte_status_cb()
2021 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2022 * esplusplayer_error_type
2023 * values will be returned.
2024 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2025 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2026 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2029 * refer to the sample code of esplusplayer_submit_packet();
2031 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2032 * or #ESPLUSPLAYER_STATE_IDLE.
2033 * @post esplusplayer_buffer_byte_status_cb() will be invoked.
2035 * @remark esplusplayer_buffer_byte_status_cb()
2037 int esplusplayer_set_buffer_byte_status_cb(
2038 esplusplayer_handle handle,
2039 esplusplayer_buffer_byte_status_cb buffer_status_cb, void* userdata);
2042 * @brief Set a callback function to be invoked when buffer underrun or
2043 * overflow is occurred and buffer size in time will be passed.
2044 * @param [in] handle : esplusplayer handle.
2045 * @param [in] buffer_status_cb : the buffer time status callback function
2047 * @param [in] userdata : userdata of esplusplayer_buffer_time_status_cb()
2048 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2049 esplusplayer_error_type
2050 * values will be returned.
2051 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2052 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2053 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2056 refer to the sample code of esplusplayer_submit_packet();
2058 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2059 * or #ESPLUSPLAYER_STATE_IDLE.
2060 * @post esplusplayer_buffer_time_status_cb() will be invoked.
2062 * @remark esplusplayer_buffer_time_status_cb(),
2063 * esplusplayer_buffer_time_status_cb() will be invoked only
2064 * when the duration value of espacket is set.
2065 * if buffer_status_cb is set to null,
2066 * esplusplayer_buffer_time_status_cb() will not be invoked anymore.
2068 int esplusplayer_set_buffer_time_status_cb(
2069 esplusplayer_handle handle,
2070 esplusplayer_buffer_time_status_cb buffer_status_cb, void* userdata);
2073 * @brief Set a callback function to be invoked when video latency status
2075 * @param [in] handle : esplusplayer handle.
2076 * @param [in] video_latency_status_cb : the video latency status callback
2077 * function to register.
2078 * @param [in] userdata : userdata of
2079 * esplusplayer_set_video_latency_status_cb()
2080 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2081 * esplusplayer_error_type
2082 * values will be returned.
2083 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2084 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2085 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2088 * refer to the sample code of esplusplayer_set_error_cb();
2090 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2091 * or #ESPLUSPLAYER_STATE_IDLE.
2092 * @post esplusplayer_video_latency_status_cb() will be invoked.
2095 * @remark esplusplayer_video_latency_status_cb() will be invoked only
2096 * when mid / high latency threshold is set.
2098 int esplusplayer_set_video_latency_status_cb(
2099 esplusplayer_handle handle,
2100 esplusplayer_video_latency_status_cb video_latency_status_cb,
2104 * @brief Set a callback function to be invoked when audio latency status
2106 * @param [in] handle : esplusplayer handle.
2107 * @param [in] audio_latency_status_cb : the audio latency status callback
2108 * function to register.
2109 * @param [in] userdata : userdata of
2110 * esplusplayer_set_audio_latency_status_cb()
2111 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2112 * esplusplayer_error_type
2113 * values will be returned.
2114 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2115 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2116 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2119 * refer to the sample code of esplusplayer_set_error_cb();
2121 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2122 * or #ESPLUSPLAYER_STATE_IDLE.
2123 * @post esplusplayer_audio_latency_status_cb() will be invoked.
2126 * @remark esplusplayer_audio_latency_status_cb() will be invoked only
2127 * when mid / high latency threshold is set.
2129 int esplusplayer_set_audio_latency_status_cb(
2130 esplusplayer_handle handle,
2131 esplusplayer_audio_latency_status_cb audio_latency_status_cb,
2135 * @brief Set buffer size with different option
2136 * @param [in] handle : esplusplayer handle.
2137 * @param [in] option : the option of buffer size.
2138 * @param [in] size : size of selected buffer option.
2139 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2140 * esplusplayer_error_type
2141 * values will be returned.
2142 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2143 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2144 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2147 * esplusplayer_open(esplayer);
2148 * esplusplayer_set_buffer_size(esplayer,ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE,10240)
2149 * // ... your codes ...
2150 * esplusplayer_close(esplayer);
2152 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2153 * When the stream is deactivated, it can be set in
2154 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
2155 * #ESPLUSPLAYER_STATE_PLAYING. The changed buffer size will be
2156 * applied when esplusplayer_activate() is called.
2159 * @remark esplusplayer_buffer_option
2160 * @see esplusplayer_open() \n
2161 * esplusplayer_deactivate() \n
2162 * esplusplayer_activate()
2164 int esplusplayer_set_buffer_size(esplusplayer_handle handle,
2165 esplusplayer_buffer_option option,
2168 * @brief Set a callback function to be invoked when resource confliction is
2170 * @param [in] handle : esplusplayer handle.
2171 * @param [in] resource_conflicted_cb : the resource conflicted callback
2172 * function to register.
2173 * @param [in] userdata : userdata of resource_conflicted_cb()
2174 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2175 * esplusplayer_error_type
2176 * values will be returned.
2177 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2178 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2179 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2182 * refer to the sample code of esplusplayer_set_error_cb();
2184 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2185 * or #ESPLUSPLAYER_STATE_IDLE.
2186 * @post esplusplayer_resource_conflicted_cb() will be invoked.
2188 * @remark esplusplayer_resource_conflicted_cb()
2189 * if resource_conflicted_cb is set to null,
2190 * esplusplayer_resource_conflicted_cb() will not be invoked
2193 int esplusplayer_set_resource_conflicted_cb(
2194 esplusplayer_handle handle,
2195 esplusplayer_resource_conflicted_cb resource_conflicted_cb, void* userdata);
2198 * @brief Set a callback function to be invoked when player has reached the
2200 * @param [in] handle : esplusplayer handle.
2201 * @param [in] eos_cb : the eos callback function to register.
2202 * @param [in] userdata : userdata of esplusplayer_eos_cb()
2203 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2204 * esplusplayer_error_type
2205 * values will be returned.
2206 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2207 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2208 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2211 * refer to the sample code of esplusplayer_set_error_cb();
2213 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2214 * or #ESPLUSPLAYER_STATE_IDLE.
2215 * @post esplusplayer_eos_cb() will be invoked.
2217 * @remark esplusplayer_eos_cb()
2218 * if eos_cb is set to null, esplusplayer_eos_cb() will not be
2221 int esplusplayer_set_eos_cb(esplusplayer_handle handle,
2222 esplusplayer_eos_cb eos_cb, void* userdata);
2225 * @brief Set a callback function to be invoked when player is prepared to
2226 * receive es packets after calling esplusplayer_prepare_async().
2227 * @param [in] handle : esplusplayer handle.
2228 * @param [in] ready_to_prepare_cb : the ready to prepare callback function
2230 * @param [in] userdata : userdata of ready_to_prepare_cb()
2231 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2232 * esplusplayer_error_type
2233 * values will be returned.
2234 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2235 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2236 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2239 * refer to the sample code of esplusplayer_submit_packet();
2241 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2242 * or #ESPLUSPLAYER_STATE_IDLE.
2245 * @remark esplusplayer_prepare_async()
2246 * if ready_to_prepare_cb is set to null,
2247 * esplusplayer_ready_to_prepare_cb() will not be invoked anymore.
2249 int esplusplayer_set_ready_to_prepare_cb(
2250 esplusplayer_handle handle,
2251 esplusplayer_ready_to_prepare_cb ready_to_prepare_cb, void* userdata);
2254 * @brief Set a callback function to be invoked when player is prepared to
2256 * @param [in] handle : esplusplayer handle.
2257 * @param [in] prepare_async_done_cb : the repare async done callback
2258 * function to register.
2259 * @param [in] userdata : userdata of prepare_async_done_cb()
2260 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2261 * esplusplayer_error_type
2262 * values will be returned.
2263 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2264 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2265 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2268 * refer to the sample code of plusplayer_prepare_async();
2270 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2271 * or #ESPLUSPLAYER_STATE_IDLE.
2272 * @post esplusplayer_prepare_async_done_cb() will be invoked.
2273 * @exception It is prohibited to call any player APIs at
2274 * esplusplayer_prepare_async_done_cb callback.
2275 * @remark esplusplayer_prepare_async_done_cb()
2276 * if prepare_async_done_cb is set to null,
2277 * esplusplayer_prepare_async_done_cb() will not be
2279 * @see plusplayer_prepare_async
2281 int esplusplayer_set_prepare_async_done_cb(
2282 esplusplayer_handle handle,
2283 esplusplayer_prepare_async_done_cb prepare_async_done_cb, void* userdata);
2286 * @brief Set a callback function to be invoked when player is prepared to
2288 * @param [in] handle : esplusplayer handle.
2289 * @param [in] seek_done_cb : the seek done callback function to register.
2290 * @param [in] userdata : userdata of esplusplayer_seek_done_cb()
2291 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2292 * esplusplayer_error_type
2293 * values will be returned.
2294 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2295 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2296 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2299 * refer to the sample code of esplusplayer_set_error_cb();
2301 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2302 * or #ESPLUSPLAYER_STATE_IDLE.
2303 * @post esplusplayer_seek_done_cb() will be invoked.
2304 * if seek_done_cb is set to null, esplusplayer_seek_done_cb() will
2305 * not be invoked anymore.
2308 int esplusplayer_set_seek_done_cb(esplusplayer_handle handle,
2309 esplusplayer_seek_done_cb seek_done_cb,
2313 * @brief Set a callback function to be invoked when player is prepared to
2314 * receive es packets after flushing all submitted es packets for
2316 * @param [in] handle : esplusplayer handle.
2317 * @param [in] ready_to_seek_cb : the ready to seek callback function to
2319 * @param [in] userdata : userdata of esplusplayer_ready_to_seek_cb()
2320 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2321 * esplusplayer_error_type
2322 * values will be returned.
2323 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2324 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2325 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2328 * refer to the sample code of esplusplayer_set_error_cb();
2330 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2331 * or #ESPLUSPLAYER_STATE_IDLE.
2334 * @remark esplusplayer_seek()
2335 * if ready_to_seek_cb is set to null,
2336 * esplusplayer_ready_to_seek_cb()
2337 * will not be invoked anymore.
2339 int esplusplayer_set_ready_to_seek_cb(
2340 esplusplayer_handle handle, esplusplayer_ready_to_seek_cb ready_to_seek_cb,
2344 * @brief Set a callback function to be invoked when player decoded video
2345 * frame. A video frame can be retrieved using a registered callback.
2346 * @param [in] handle : esplusplayer handle.
2347 * @param [in] media_packet_video_decoded_cb : the media packet video
2348 * decoded callback function to register.
2349 * @param [in] userdata : userdata of
2350 * esplusplayer_set_media_packet_video_decoded_cb()
2351 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2352 * esplusplayer_error_type
2353 * values will be returned.
2354 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2355 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2356 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2359 * refer to the sample code of esplusplayer_set_error_cb();
2361 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2362 * or #ESPLUSPLAYER_STATE_IDLE.
2365 * @remark esplusplayer_set_video_frame_buffer_type()
2366 * if media_packet_video_decoded_cb is set to null,
2367 * esplusplayer_error_cb() will not be invoked anymore.
2368 * media packets have to be released by calling
2369 * esplusplayer_decoded_buffer_destroy().
2370 * @see esplusplayer_set_video_frame_buffer_scale_resolution
2372 int esplusplayer_set_media_packet_video_decoded_cb(
2373 esplusplayer_handle handle,
2374 esplusplayer_media_packet_video_decoded_cb media_packet_video_decoded_cb,
2378 * @brief Set closed caption callback function.
2379 * @description In this function set closed caption callback to handle the
2380 * closed caption. If there is closed caption to display,
2381 * esplusplayer_closed_caption_cb will be called to notify there
2382 * is closed caption to display.
2383 * @param [in] handle : esplusplayer handle ptr.
2384 * @param [in] closed_caption_cb : the closed caption callback function to
2386 * @param [in] userdata : userdata of esplusplayer_closed_caption_cb
2387 * callback function.
2388 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2389 * esplusplayer_error_type
2390 * values will be returned.
2391 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2392 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2393 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2396 * refer to the sample code of esplusplayer_set_error_cb();
2398 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2399 * or #ESPLUSPLAYER_STATE_IDLE.
2400 * @post When there is closed caption data, call
2401 * esplusplayer_closed_caption_cb to nofity that there is closed
2402 * caption needed to be displayed.
2404 * @remark esplusplayer_closed_caption_cb \n
2405 * [in] data : closed caption data \n
2406 * [in] size : length of closed caption data \n
2407 * [in] userdata : userdata of esplusplayer_closed_caption_cb
2408 * callback function.
2409 * if closed_caption_cb is set to null,
2410 * esplusplayer_closed_caption_cb()
2411 * will not be invoked anymore.
2413 int esplusplayer_set_closed_caption_cb(
2414 esplusplayer_handle handle,
2415 esplusplayer_closed_caption_cb closed_caption_cb, void* userdata);
2418 * @brief Set a callback function to be invoked when player is flush
2420 * @param [in] handle : esplusplayer handle.
2421 * @param [in] flush_done_cb : the flush done callback function to register.
2422 * @param [in] userdata : userdata of esplusplayer_flush_done_cb()
2423 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2424 * esplusplayer_error_type
2425 * values will be returned.
2426 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2427 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2428 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2431 * refer to the sample code of esplusplayer_set_error_cb();
2433 * @pre This api should be called before esplusplayer_flush() is called
2434 * @post esplusplayer_flush_done_cb() will be invoked.
2436 * @remark called before esplusplayer_flush().
2437 * if flush_done_cb is set to null, esplusplayer_error_cb() will
2438 * not be invoked anymore.
2440 int esplusplayer_set_flush_done_cb(esplusplayer_handle handle,
2441 esplusplayer_flush_done_cb flush_done_cb,
2444 * @brief Set a callback function to be invoked when a specific event
2446 * @param [in] handle : esplusplayer handle.
2447 * @param [in] event_cb : the callback function to register.
2448 * @param [in] userdata : userdata of esplusplayer_event_cb()
2449 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2450 * esplusplayer_error_type
2451 * values will be returned.
2452 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2453 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2454 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2457 * refer to the sample code of esplusplayer_set_error_cb();
2459 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2460 * or #ESPLUSPLAYER_STATE_IDLE.
2461 * @post esplusplayer_event_cb() will be invoked.
2463 * @remark esplusplayer_set_event_cb()
2464 * if event_cb is set to null, esplusplayer_event_cb() will not be
2467 int esplusplayer_set_event_cb(esplusplayer_handle handle,
2468 esplusplayer_event_cb event_cb, void* userdata);
2470 * @brief Provided api for destroying decoded buffer.
2471 * @param [in] handle : esplusplayer handle.
2472 * @param [in] packet : the decoded buffer.
2473 * @return @c one of esplusplayer_error_type values will be returned.
2474 * @pre The player state can be greater than #ESPLUSPLAYER_STATE_IDLE.
2475 * @post esplusplayer_decoded_buffer_destroy will be invoked for video
2478 * @remark esplusplayer_decoded_buffer_destroy().
2480 int esplusplayer_decoded_buffer_destroy(
2481 esplusplayer_handle handle, esplusplayer_decoded_video_packet* packet);
2484 * @brief Provided api for setting low latency mode, multiple modes can be
2486 * @param [in] handle : esplusplayer handle.
2487 * @param [in] mode : one of the low latency mode to set.
2488 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2489 * esplusplayer_error_type
2490 * values will be returned.
2491 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2492 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2493 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2496 * esplusplayer_open(esplayer);
2497 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
2498 * // ... your codes ...
2499 * esplusplayer_close(esplayer);
2501 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2504 * @remark esplusplayer_set_low_latency_mode().
2505 * if set ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC:
2506 * 1, esplusplayer_buffer_status_cb/
2507 * esplusplayer_buffer_byte_status_cb/
2508 * esplusplayer_buffer_time_status_cb/
2509 * esplusplayer_ready_to_prepare_cb/
2510 * esplusplayer_ready_to_seek_cb/esplusplayer_seek_done_cb
2511 * callbacks are not invoked
2512 * 2, If es packets are sent after esplusplayer_start() is called,
2513 * it will be played immediately.
2514 * @see esplusplayer_open()
2516 int esplusplayer_set_low_latency_mode(esplusplayer_handle handle,
2517 esplusplayer_low_latency_mode mode);
2520 * @brief Provided api for enabling video frame peek mode
2521 * @param [in] handle : esplusplayer handle.
2522 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2523 * esplusplayer_error_type
2524 * values will be returned.
2525 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2526 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2527 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2530 * esplusplayer_open(esplayer);
2531 * esplusplayer_set_video_frame_peek_mode(esplayer);
2532 * // ... your codes ...
2533 * esplusplayer_close(esplayer);
2535 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2538 * @see esplusplayer_open() \n
2539 * esplusplayer_render_video_frame().
2541 int esplusplayer_set_video_frame_peek_mode(esplusplayer_handle handle);
2544 * @brief Provided api for rendering a video frame which is holded by video
2546 * @param [in] handle : esplusplayer handle.
2547 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2548 * esplusplayer_error_type
2549 * values will be returned.
2550 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2551 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2552 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2555 * prepare esplayer done
2556 * // ... your codes ...
2557 * esplusplayer_render_video_frame(esplayer);
2558 * // ... your codes ...
2559 * esplusplayer_stop(esplayer);
2561 * @pre In order to use this api,
2562 * The player state must be one of #ESPLUSPLAYER_STATE_READY or
2563 * #ESPLUSPLAYER_STATE_PAUSED after esplusplayer_seek_done_cb or
2564 * esplusplayer_prepare_async_done_cb is called \n
2567 * @see esplusplayer_set_video_frame_peek_mode() \n
2568 * esplusplayer_prepare_async()
2570 int esplusplayer_render_video_frame(esplusplayer_handle handle);
2573 * @brief Provided api for setting unlimited max buffer mode, the player
2574 * does not limit es packet transmission although in buffer overrun
2576 * @param [in] handle : esplusplayer handle.
2577 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2578 * esplusplayer_error_type
2579 * values will be returned.
2580 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2581 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2582 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2585 * esplusplayer_open(esplayer);
2586 * esplusplayer_set_unlimited_max_buffer_mode(esplayer);
2587 * // ... your codes ...
2588 * esplusplayer_close(esplayer);
2590 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2593 * @remark esplusplayer_set_unlimited_max_buffer_mode().
2594 * esplusplayer_buffer_status_cb() will be invoked in
2595 * overrun/underrun buffer status. but
2596 * esplusplayer_submit_packet()/esplusplayer_submit_trust_zone_packet()
2597 * /esplusplayer_submit_encrypted_packet()
2598 * does not return ESPLUSPLAYER_SUBMIT_STATUS_FULL
2599 * @see esplusplayer_open() \n
2600 * esplusplayer_submit_packet() \n
2601 * esplusplayer_submit_trust_zone_packet() \n
2602 * esplusplayer_submit_encrypted_packet()
2604 int esplusplayer_set_unlimited_max_buffer_mode(esplusplayer_handle handle);
2606 * @brief Provided api to deliver fmm signal and getting fmm auto status.
2607 * The player just delivers fmm signal to system. It doesn't
2609 * activating fmm mode. System refers to fmm signal when it decides
2612 * @param [in] handle : esplusplayer handle.
2613 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE fmm auto mode on
2614 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION fmm auto mode off
2615 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_STATE Internal operation failed
2617 * esplusplayer_open(esplayer);
2618 * esplusplayer_set_fmm_mode(esplayer);
2619 * // ... your codes ...
2620 * esplusplayer_close(esplayer);
2622 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
2623 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
2624 * or #ESPLUSPLAYER_STATE_PAUSED
2627 * @see esplusplayer_open()
2629 int esplusplayer_set_fmm_mode(esplusplayer_handle handle);
2631 * @brief Provided api for setting audio codec type for playback.
2632 * @param [in] handle : esplusplayer handle.
2633 * @param [in] type : codec type(hardware/software).
2634 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2635 esplusplayer_error_type
2636 * values will be returned.
2637 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2638 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2639 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2642 * esplusplayer_open(esplayer);
2643 * esplusplayer_set_audio_codec_type(esplayer,ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW);
2644 * // ... your codes ...
2645 * esplusplayer_close(esplayer);
2647 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2648 When the audio stream is not set or deactivated, it can be set
2649 in #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
2650 #ESPLUSPLAYER_STATE_PLAYING. The set codec type will be
2651 applied when esplusplayer_activate() is called.
2654 * @see esplusplayer_open() \n
2655 * esplusplayer_deactivate() \n
2656 esplusplayer_activate() \n
2657 esplusplayer_set_audio_stream_info()
2659 int esplusplayer_set_audio_codec_type(esplusplayer_handle handle,
2660 esplusplayer_audio_codec_type type);
2662 * @brief Provided api for setting video codec type for playback.
2663 * @param [in] handle : esplusplayer handle.
2664 * @param [in] type : codec type(hardware/software).
2665 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2666 esplusplayer_error_type
2667 * values will be returned.
2668 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2669 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2670 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2673 * esplusplayer_open(esplayer);
2674 * esplusplayer_set_video_codec_type(esplayer,ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW);
2675 * // ... your codes ...
2676 * esplusplayer_close(esplayer);
2678 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2679 When the video stream is not set or deactivated, it can be set
2680 in #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
2681 #ESPLUSPLAYER_STATE_PLAYING. The set codec type will be
2682 applied when esplusplayer_activate() is called.
2685 * @see esplusplayer_open() \n
2686 * esplusplayer_deactivate() \n
2687 esplusplayer_activate() \n
2688 esplusplayer_set_video_stream_info()
2690 int esplusplayer_set_video_codec_type(esplusplayer_handle handle,
2691 esplusplayer_video_codec_type type);
2693 * @brief Provided api for setting alternative video resource(sub decoder
2695 * @param [in] handle : esplusplayer handle ptr.
2696 * @param [in] rsc_type : set alternative video resource
2697 * (@c 0 [defualt] = set all video resources(decoder/scaler) to main
2699 * @c 1 = set all video resources(decoder/scaler) to sub resources,
2700 * @c 2 = set only decoder to sub resource,
2701 * @c 3 = set only scaler to sub resource)
2702 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2703 * esplusplayer_error_type
2704 * values will be returned.
2705 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2706 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2707 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2710 * esplusplayer_open(esplayer);
2711 * esplusplayer_set_alternative_video_resource(esplayer,1);
2712 * // ... your codes ...
2713 * esplusplayer_close(esplayer);
2715 * @pre The player state can be all of #State except
2716 * #ESPLUSPLAYER_STATE_NONE.
2719 * @remark if app has set not default resource allocate policy via
2720 * esplusplayer_set_resource_allocate_policy(), this api will return
2723 * @see esplusplayer_open()
2725 int esplusplayer_set_alternative_video_resource(esplusplayer_handle handle,
2726 unsigned int rsc_type);
2728 * @brief Provided api for setting alternative audio resource(sub decoder
2729 * and simple mix audio out)
2730 * @param [in] handle : esplusplayer handle ptr.
2731 * @param [in] rsc_type : set alternative audio resource type
2732 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2733 * esplusplayer_error_type
2734 * values will be returned.
2735 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2736 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2737 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2740 * esplusplayer_open(esplayer);
2741 * esplusplayer_set_audio_codec_type(esplayer,
2742 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW)
2743 * esplusplayer_set_alternative_audio_resource(esplayer,
2744 * ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT);
2745 * // ... your codes ...
2746 * esplusplayer_close(esplayer);
2748 * prepare esplayer done
2749 * // ... your codes ...
2750 * esplusplayer_deactivate(esplayer, ESPLUSPLAYER_STREAM_TYPE_AUDIO)
2751 * esplusplayer_set_audio_codec_type(esplayer,
2752 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW)
2753 * esplusplayer_set_alternative_audio_resource(esplayer,
2754 * ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT);
2755 * esplusplayer_activate(esplayer, ESPLUSPLAYER_STREAM_TYPE_AUDIO)
2756 * // ... your codes ...
2757 * esplusplayer_close(esplayer);
2759 * @pre The player state can be all of #State except
2760 * #ESPLUSPLAYER_STATE_NONE.
2763 * @remark Simple out is no sound effect. Simple mix out sound is mixed with
2764 * main sound and output
2765 * through only main speaker. Simple mix out output format is
2766 * fixed(eg. 48kh, 2ch).
2767 * If you use simple mix out resource, audio decoder should be S/W
2770 * @see esplusplayer_open() \n
2771 * esplusplayer_set_audio_codec_type()
2773 int esplusplayer_set_alternative_audio_resource(
2774 esplusplayer_handle handle, esplusplayer_audio_resource_type rsc_type);
2776 * @brief Provided api for switching audio stream between the different
2777 * audio codec types on the fly
2778 * @param [in] handle : esplusplayer handle ptr.
2779 * @param [in] stream : audio stream pointer
2780 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2781 * esplusplayer_error_type
2782 * values will be returned.
2783 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2784 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2785 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2788 * prepare esplayer done
2789 * // ... your codes ...
2790 * esplusplayer_audio_stream_info audio_stream;
2791 * audio_stream.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_AC3;
2792 * audio_stream.sample_rate = 48000;
2793 * audio_stream.channels = 2;
2794 * esplusplayer_switch_audio_stream_onthefly(esplayer,
2796 * // ... your codes ...
2797 * esplusplayer_close(esplayer);
2799 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY,
2800 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING
2803 * @remark Audio codec can be switched between only
2804 * #ESPLUSPLAYER_AUDIO_MIME_TYPE_AAC,
2805 * #ESPLUSPLAYER_AUDIO_MIME_TYPE_EAC3
2806 * and #ESPLUSPLAYER_AUDIO_MIME_TYPE_AC3.
2807 * if other codec is set, this api will return false.
2809 * @see esplusplayer_prepare_async()
2811 int esplusplayer_switch_audio_stream_onthefly(
2812 esplusplayer_handle handle, esplusplayer_audio_stream_info* stream);
2814 * @brief Provided api for setting aifilter
2815 * @param [in] handle : esplusplayer handle ptr.
2816 * @param [in] aifilter : aifilter plugin.
2817 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2818 * esplusplayer_error_type
2819 * values will be returned.
2820 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2821 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2822 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2825 * esplusplayer_open(esplayer);
2826 * GstElement* aifilter_ =
2827 * gst_element_factory_make("aifilter_autozoom","auto_zoom");
2828 * g_object_set(G_OBJECT(aifilter_), "az_cb_out_fps", 30, NULL);
2829 * g_object_set(G_OBJECT(aifilter_), "az_inference_fps", 2, NULL);
2830 * g_object_set(G_OBJECT(aifilter_), "az_disp_width", 1920, NULL);
2831 * g_object_set(G_OBJECT(aifilter_), "az_disp_height", 1080, NULL);
2832 * g_object_set(G_OBJECT(aifilter_), "az_detection_type", 2, NULL);
2833 * g_object_set(G_OBJECT(aifilter_), "az_scaler_type", 1, NULL);
2834 * g_object_set(G_OBJECT(aifilter_), "az_target_num", 2, NULL);
2835 * esplusplayer_set_aifilter(esplayer,aifilter_);
2836 * // ... your codes ...
2837 * esplusplayer_close(esplayer);
2839 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2843 * @see esplusplayer_open()
2845 int esplusplayer_set_aifilter(esplusplayer_handle handle, void* aifilter);
2848 * @brief Provided api for setting render time offset
2849 * @param [in] handle : esplusplayer handle ptr.
2850 * @param [in] type : stream type
2851 * @param [in] offset : offset (default in milliseconds, can be set by
2852 * @esplusplayer_set_timeunit_type).
2853 * G_MININT64 <= offset * 1000000 <= G_MAXINT64
2854 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2855 * esplusplayer_error_type
2856 * values will be returned.
2857 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2858 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2859 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2862 * esplusplayer_open(esplayer);
2863 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
2865 * // ... your codes ...
2866 * int64_t set_offset = 10;
2867 * esplusplayer_set_render_time_offset(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
2869 * int64_t get_offset = 0;
2870 * esplusplayer_get_render_time_offset(esplayer_,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
2872 * // ... your codes ...
2873 * esplusplayer_close(esplayer);
2875 * @pre The player state must be set to #ESPLUSPLAYER_STATE_READY,
2876 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
2877 * It have to be set to low latency mode. (all mode except
2878 * # ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC)
2879 * @remark esplusplayer_set_low_latency_mode().
2883 * @see esplusplayer_open()
2885 int esplusplayer_set_render_time_offset(esplusplayer_handle handle,
2886 esplusplayer_stream_type type,
2889 * @brief Provided api for getting render time offset
2890 * @param [in] handle : esplusplayer handle ptr.
2891 * @param [in] type : stream type
2892 * @param [in] offset : offset ptr (default in milliseconds, can be set by
2893 * @esplusplayer_set_timeunit_type).
2894 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2895 * esplusplayer_error_type
2896 * values will be returned.
2897 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2898 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2899 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2901 * @pre The player state must be set to #ESPLUSPLAYER_STATE_READY,
2902 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
2903 * It have to be set to low latency mode.
2904 * @remark esplusplayer_set_low_latency_mode().
2908 * see esplusplayer_set_render_time_offset
2910 int esplusplayer_get_render_time_offset(esplusplayer_handle handle,
2911 esplusplayer_stream_type type,
2914 * @brief Provided api for setting catch up speed level in low latency mode
2915 * @param [in] handle : esplusplayer handle.
2916 * @param [in] level : speed level to catch up
2917 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2918 * esplusplayer_error_type
2919 * values will be returned.
2920 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2921 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2922 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2925 * esplusplayer_open(esplayer);
2926 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO);
2927 * esplusplayer_set_catch_up_speed(esplayer,ESPLUSPLAYER_CATCH_UP_SPEED_MID);
2928 * // ... your codes ...
2929 * esplusplayer_close(esplayer);
2931 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
2932 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
2933 * or #ESPLUSPLAYER_STATE_PAUSED
2934 * esplusplayer_set_low_latency_mode() should be called as below
2935 * before this api is called.
2936 * esplusplayer_set_low_latency_mode(handle,
2937 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
2938 * esplusplayer_set_low_latency_mode(handle,
2939 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
2940 * esplusplayer_set_low_latency_mode(handle,
2941 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
2942 * esplusplayer_set_low_latency_mode(handle,
2943 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY)
2947 * @see esplusplayer_open()
2949 int esplusplayer_set_catch_up_speed(esplusplayer_handle handle,
2950 esplusplayer_catch_up_speed level);
2953 * @brief Provided api for getting current video latency status
2954 * @param [in] handle : esplusplayer handle.
2955 * @param [out] status : current latency status
2956 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2957 * esplusplayer_error_type
2958 * values will be returned.
2959 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2960 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2961 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2964 * prepare esplayer done
2965 * // ... your codes ...
2966 * esplusplayer_latency_status current_status =
2967 * ESPLUSPLAYER_LATENCY_LOW;
2968 * esplusplayer_get_video_latency_status(esplayer, ¤t_status);
2969 * // ... your codes ...
2970 * esplusplayer_stop(esplayer);
2972 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY,
2973 * #ESPLUSPLAYER_STATE_PLAYING or #ESPLUSPLAYER_STATE_PAUSED
2977 * @see esplusplayer_prepare_async()
2979 int esplusplayer_get_video_latency_status(esplusplayer_handle handle,
2980 esplusplayer_latency_status* status);
2983 * @brief Provided api for getting current audio latency status
2984 * @param [in] handle : esplusplayer handle.
2985 * @param [out] status : current latency status
2986 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2987 * esplusplayer_error_type
2988 * values will be returned.
2989 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2990 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2991 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2994 * prepare esplayer done
2995 * // ... your codes ...
2996 * esplusplayer_latency_status current_status =
2997 * ESPLUSPLAYER_LATENCY_LOW;
2998 * esplusplayer_get_audio_latency_status(esplayer, ¤t_status);
2999 * // ... your codes ...
3000 * esplusplayer_stop(esplayer);
3002 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY,
3003 * #ESPLUSPLAYER_STATE_PLAYING or #ESPLUSPLAYER_STATE_PAUSED
3007 * @see esplusplayer_prepare_async()
3009 int esplusplayer_get_audio_latency_status(esplusplayer_handle handle,
3010 esplusplayer_latency_status* status);
3013 * @brief Provided api for setting video mid latency threshold for low
3016 * @param [in] handle : esplusplayer handle.
3017 * @param [in] threshold: the threshold(number) of the video frames for mid
3019 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3020 * esplusplayer_error_type
3021 * values will be returned.
3022 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3023 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3024 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3027 * esplusplayer_open(esplayer);
3028 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO);
3029 * esplusplayer_set_video_mid_latency_threshold(esplayer,2);
3030 * // ... your codes ...
3031 * esplusplayer_close(esplayer);
3033 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
3034 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
3035 * or #ESPLUSPLAYER_STATE_PAUSED
3036 * esplusplayer_set_low_latency_mode() should be called as below
3037 * before this api is called.
3038 * esplusplayer_set_low_latency_mode(handle,
3039 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
3040 * esplusplayer_set_low_latency_mode(handle,
3041 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
3042 * esplusplayer_set_low_latency_mode(handle,
3043 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
3044 * esplusplayer_set_low_latency_mode(handle,
3045 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE)
3049 * @see esplusplayer_open()
3051 /// TODO:: set the min/max value of the threshold
3052 int esplusplayer_set_video_mid_latency_threshold(esplusplayer_handle handle,
3053 const unsigned int threshold);
3056 * @brief Provided api for setting audio mid latency threshold for low
3059 * @param [in] handle : esplusplayer handle.
3060 * @param [in] threshold: the threshold(number) of the audio frames for mid
3062 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3063 * esplusplayer_error_type
3064 * values will be returned.
3065 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3066 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3067 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3070 * esplusplayer_open(esplayer);
3071 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO);
3072 * esplusplayer_set_audio_mid_latency_threshold(esplayer,2);
3073 * // ... your codes ...
3074 * esplusplayer_close(esplayer);
3076 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
3077 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
3078 * or #ESPLUSPLAYER_STATE_PAUSED
3079 * esplusplayer_set_low_latency_mode() should be called as below
3080 * before this api is called.
3081 * esplusplayer_set_low_latency_mode(handle,
3082 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
3083 * esplusplayer_set_low_latency_mode(handle,
3084 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
3085 * esplusplayer_set_low_latency_mode(handle,
3086 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
3087 * esplusplayer_set_low_latency_mode(handle,
3088 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE)
3092 * @see esplusplayer_open()
3094 /// TODO:: set the min/max value of the threshold
3095 int esplusplayer_set_audio_mid_latency_threshold(esplusplayer_handle handle,
3096 const unsigned int threshold);
3099 * @brief Provided api for setting video high latency threshold for low
3102 * @param [in] handle : esplusplayer handle.
3103 * @param [in] threshold: the threshold(number) of the video frames for high
3105 * @param [in] video_high_latency_cb : high latency callback function to
3107 * @param [in] userdata : userdata of esplusplayer_high_latency_cb()
3108 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3109 * esplusplayer_error_type
3110 * values will be returned.
3111 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3112 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3113 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3116 * static void OnVideoHighLatency(void* userdata) {
3117 * printf ("OnVideoHighLatency\n");
3119 * esplusplayer_open(esplayer);
3120 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO);
3121 * esplusplayer_set_video_high_latency_threshold(esplayer, 2,
3122 * OnVideoHighLatency, nullptr);
3123 * // ... your codes ...
3124 * esplusplayer_close(esplayer);
3126 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
3127 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
3128 * or #ESPLUSPLAYER_STATE_PAUSED
3129 * esplusplayer_set_low_latency_mode() should be called as below
3130 * before this api is called.
3131 * esplusplayer_set_low_latency_mode(handle,
3132 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
3133 * esplusplayer_set_low_latency_mode(handle,
3134 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
3135 * esplusplayer_set_low_latency_mode(handle,
3136 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
3137 * esplusplayer_set_low_latency_mode(handle,
3138 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE)
3142 * @see esplusplayer_open()
3144 /// TODO:: set the min/max value of the threshold
3145 int esplusplayer_set_video_high_latency_threshold(
3146 esplusplayer_handle handle, const unsigned int threshold,
3147 esplusplayer_video_high_latency_cb video_high_latency_cb, void* userdata);
3150 * @brief Provided api for setting audio high latency threshold for low
3153 * @param [in] handle : esplusplayer handle.
3154 * @param [in] threshold: the threshold(number) of the audio frames for high
3156 * @param [in] audio_high_latency_cb : high latency callback function to
3158 * @param [in] userdata : userdata of esplusplayer_high_latency_cb()
3159 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3160 * esplusplayer_error_type
3161 * values will be returned.
3162 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3163 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3164 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3167 * static void OnAudioHighLatency(void* userdata) {
3168 * printf ("OnAudioHighLatency\n");
3170 * esplusplayer_open(esplayer);
3171 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO);
3172 * esplusplayer_set_audio_high_latency_threshold(esplayer, 2,
3173 * OnAudioHighLatency, nullptr);
3174 * // ... your codes ...
3175 * esplusplayer_close(esplayer);
3177 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
3178 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
3179 * or #ESPLUSPLAYER_STATE_PAUSED
3180 * esplusplayer_set_low_latency_mode() should be called as below
3181 * before this api is called.
3182 * esplusplayer_set_low_latency_mode(handle,
3183 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
3184 * esplusplayer_set_low_latency_mode(handle,
3185 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
3186 * esplusplayer_set_low_latency_mode(handle,
3187 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
3188 * esplusplayer_set_low_latency_mode(handle,
3189 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE)
3193 * @see esplusplayer_open()
3195 /// TODO:: set the min/max value of the threshold
3196 int esplusplayer_set_audio_high_latency_threshold(
3197 esplusplayer_handle handle, const unsigned int threshold,
3198 esplusplayer_audio_high_latency_cb audio_high_latency_cb, void* userdata);
3201 * @brief Provided api for getting the maximum number of frames.
3202 * @remark As a part of the dedicated app implementation.
3203 * If non dedicated app call this api, this api will return
3204 * ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION.
3205 * @param [in] handle : esplusplayer handle.
3206 * @param [out] frame_count : maximum frame count.
3207 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3208 * esplusplayer_error_type values will be returned.
3209 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3210 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3211 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3214 * esplusplayer_open(esplayer);
3215 * esplusplayer_set_low_latency_mode(esplayer,
3216 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE);
3217 * esplusplayer_audio_stream_info audio_stream;
3218 * audio_stream.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_PCM_S16LE;
3219 * audio_stream.sample_rate = 48000;
3220 * audio_stream.channels = 6;
3221 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
3222 * prepare esplayer done
3223 * // ... your codes ...
3224 * uint64_t frame_count = 0;
3225 * esplusplayer_get_low_latency_pcm_buffer_size(esplayer,
3227 * // ... your codes ...
3228 * esplusplayer_stop(esplayer);
3230 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY.
3231 * It has to be set to game mode.
3235 * @see esplusplayer_get_low_latency_pcm_current_buffer_level() \n
3236 * esplusplayer_get_low_latency_pcm_underrun_count()
3238 int esplusplayer_get_low_latency_pcm_buffer_size(esplusplayer_handle handle,
3239 uint64_t* frame_count);
3242 * @brief Provided api for getting the number of currently queued frames.
3243 * @remark As a part of the dedicated app implementation.
3244 * If non dedicated app call this api, this api will return
3245 * ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION.
3246 * @param [in] handle : esplusplayer handle.
3247 * @param [out] frame_count : queued frame count.
3248 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3249 * esplusplayer_error_type values will be returned.
3250 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3251 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3252 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3255 * esplusplayer_open(esplayer);
3256 * esplusplayer_set_low_latency_mode(esplayer,
3257 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE);
3258 * esplusplayer_audio_stream_info audio_stream;
3259 * audio_stream.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_PCM_S16LE;
3260 * audio_stream.sample_rate = 48000;
3261 * audio_stream.channels = 6;
3262 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
3263 * prepare esplayer done
3264 * // ... your codes ...
3265 * uint64_t frame_count = 0;
3266 * esplusplayer_get_low_latency_pcm_current_buffer_level(esplayer,
3268 * // ... your codes ...
3269 * esplusplayer_stop(esplayer);
3271 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY.
3272 * It has to be set to game mode.
3276 * @see esplusplayer_get_low_latency_pcm_buffer_size() \n
3277 * esplusplayer_get_low_latency_pcm_underrun_count()
3279 int esplusplayer_get_low_latency_pcm_current_buffer_level(
3280 esplusplayer_handle handle, uint64_t* frame_count);
3283 * @brief Provided api for getting the underrun counts in audio out.
3284 * @remark As a part of the dedicated app implementation.
3285 * If non dedicated app call this api, this api will return
3286 * ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION.
3287 * @param [in] handle : esplusplayer handle.
3288 * @param [out] underrun_count : underrun counts in audio out.
3289 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3290 * esplusplayer_error_type values will be returned.
3291 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3292 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3293 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3296 * esplusplayer_open(esplayer);
3297 * esplusplayer_set_low_latency_mode(esplayer,
3298 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE);
3299 * esplusplayer_audio_stream_info audio_stream;
3300 * audio_stream.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_PCM_S16LE;
3301 * audio_stream.sample_rate = 48000;
3302 * audio_stream.channels = 6;
3303 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
3304 * prepare esplayer done
3305 * // ... your codes ...
3306 * uint64_t underrun_count = 0;
3307 * esplusplayer_get_low_latency_pcm_underrun_count(esplayer,
3309 * // ... your codes ...
3310 * esplusplayer_stop(esplayer);
3312 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY.
3313 * It has to be set to game mode.
3317 * @see esplusplayer_get_low_latency_pcm_buffer_size() \n
3318 * esplusplayer_get_low_latency_pcm_current_buffer_level()
3320 int esplusplayer_get_low_latency_pcm_underrun_count(esplusplayer_handle handle,
3321 uint64_t* underrun_count);
3324 * @brief Initialize easing info to esplayer.
3325 * @param [in] handle : esplusplayer handle.
3326 * @param [in] init_volume : initial easing volume (0 ~ 100).
3327 * @param [in] elapsed_time : initial elapsed time (millisecond).
3328 * @param [in] easing_info : target volume, duration, type.
3329 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3330 * esplusplayer_error_type
3331 * values will be returned.
3332 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3333 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3334 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3337 * esplusplayer_open(esplayer);
3338 * uint32_t volume = 50, elapsed_time = 10000;
3339 * esplusplayer_target_audio_easing_info easing_info;
3340 * easing_info.volume = 30;
3341 * easing_info.duration = 100;
3342 * easing_info.type = ESPLUSPLAYER_AUDIO_EASING_INCUBIC;
3343 * esplusplayer_init_audio_easing_info(esplayer,volume,elapsed_time,&easing_info);
3344 * // ... your codes ...
3345 * esplusplayer_close(esplayer);
3347 * @pre The player state can be all of #esplusplayer_state except
3348 * #ESPLUSPLAYER_STATE_NONE.
3352 * @see esplusplayer_open()
3354 int esplusplayer_init_audio_easing_info(
3355 esplusplayer_handle handle, uint32_t init_volume, uint32_t elapsed_time,
3356 const esplusplayer_target_audio_easing_info* easing_info);
3359 * @brief Update easing info to esplayer to update target info.
3360 * @param [in] handle : esplusplayer handle.
3361 * @param [in] easing_info : target volume, duration, type.
3362 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3363 * esplusplayer_error_type
3364 * values will be returned.
3365 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3366 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3367 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3370 * esplusplayer_open(esplayer);
3371 * // ... your codes ...
3372 * esplusplayer_target_audio_easing_info easing_info;
3373 * easing_info.volume = 30;
3374 * easing_info.duration = 100;
3375 * easing_info.type = ESPLUSPLAYER_AUDIO_EASING_INCUBIC;
3376 * esplusplayer_update_audio_easing_info(esplayer,&easing_info);
3377 * // ... your codes ...
3378 * esplusplayer_close(esplayer);
3380 * @pre The player state can be all of #esplusplayer_state except
3381 * #ESPLUSPLAYER_STATE_NONE.
3382 * This api should be called after
3383 * esplusplayer_init_audio_easing_info() is called
3387 * @see esplusplayer_open()
3389 int esplusplayer_update_audio_easing_info(
3390 esplusplayer_handle handle,
3391 const esplusplayer_target_audio_easing_info* easing_info);
3394 * @brief Get easing info currently in easing operation from esplayer
3395 * @param [in] handle : esplusplayer handle.
3396 * @param [out] current_volume : current volume (0 ~ 100).
3397 * @param [out] elapsed_time : elapsed time (millisecond).
3398 * @param [out] easing_info : target volume, duration, type.
3399 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3400 esplusplayer_error_type
3401 * values will be returned.
3402 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3403 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3404 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3407 * esplusplayer_open(esplayer);
3408 * // ... your codes ...
3409 * uint32_t cur_volume = 50, elapsed_time = 0;
3410 * esplusplayer_target_audio_easing_info easing_info;
3412 esplusplayer_get_audio_easing_info(esplayer,&cur_volume,&elapsed_time,&easing_info);
3413 * // ... your codes ...
3414 * esplusplayer_close(esplayer);
3416 * @pre The player state can be all of #esplusplayer_state except
3417 * #ESPLUSPLAYER_STATE_NONE.
3418 * This api should be called after
3419 * esplusplayer_init_audio_easing_info() is called
3423 * @see esplusplayer_open()
3426 int esplusplayer_get_audio_easing_info(
3427 esplusplayer_handle handle, uint32_t* current_volume,
3428 uint32_t* elapsed_time, esplusplayer_target_audio_easing_info* easing_info);
3431 * @brief Start audio easing using a registered audio easing info
3432 * @param [in] handle : esplusplayer handle.
3433 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3434 * esplusplayer_error_type
3435 * values will be returned.
3436 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3437 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3438 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3441 * prepare esplayer done
3442 * uint32_t volume = 50, elapsed_time = 10000;
3443 * esplusplayer_target_audio_easing_info easing_info;
3444 * easing_info.volume = 30;
3445 * easing_info.duration = 100;
3446 * easing_info.type = ESPLUSPLAYER_AUDIO_EASING_INCUBIC;
3447 * esplusplayer_init_audio_easing_info(esplayer,volume,elapsed_time,&easing_info);
3448 * esplusplayer_start_audio_easing(esplayer);
3449 * // ... your codes ...
3450 * esplusplayer_close(esplayer);
3452 * @pre The player state should be at least #ESPLUSPLAYER_STATE_READY.
3453 * This api should be called after
3454 * esplusplayer_init_audio_easing_info() is called
3458 * @see esplusplayer_open() \n
3459 * esplusplayer_init_audio_easing_info() \n
3460 * esplusplayer_update_audio_easing_info() \n
3461 * esplusplayer_stop_audio_easing() \n
3462 * esplusplayer_prepare_async()
3464 int esplusplayer_start_audio_easing(esplusplayer_handle handle);
3467 * @brief Stop audio easing
3468 * @param [in] handle : esplusplayer handle.
3469 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3470 * esplusplayer_error_type
3471 * values will be returned.
3472 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3473 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3474 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3477 * esplusplayer_open(esplayer);
3478 * // ... your codes ...
3479 * esplusplayer_stop_audio_easing(esplayer);
3480 * // ... your codes ...
3481 * esplusplayer_close(esplayer);
3483 * @pre The player state can be all of #esplusplayer_state except
3484 * #ESPLUSPLAYER_STATE_NONE.
3485 * This api should be called after
3486 * esplusplayer_init_audio_easing_info() is called
3490 * @see esplusplayer_open() \n
3491 * esplusplayer_start_audio_easing()
3493 int esplusplayer_stop_audio_easing(esplusplayer_handle handle);
3496 * @brief Get virtual resource id
3497 * @param [in] handle : esplusplayer handle.
3498 * @param [in] type : The resource type of virtual id.
3499 * @param [out] virtual_id : Stored virtual resource id value.
3500 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3501 esplusplayer_error_type
3502 * values will be returned.
3503 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3504 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3505 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3508 * prepare esplayer done
3509 * // ... your codes ...
3512 esplusplayer_get_virtual_rsc_id(esplayer,ESPLUSPLAYER_RSC_TYPE_VIDEO_RENDERER,&virtual_id);
3513 * // ... your codes ...
3514 * esplusplayer_close(esplayer);
3515 * esplusplayer_destroy(esplayer);
3517 * @pre The player state should be #State::kReady, #State::kPlaying or
3520 * @return @c True on success, otherwise @c False ("virtual_id" will be -1)
3523 * @remark This function returns virtual resource id which player is
3524 * allocated from resource manager. For example, virtual scaler id is
3525 * required for an application to use capture API directly.
3526 * @see esplusplayer_prepare_async()
3529 int esplusplayer_get_virtual_rsc_id(esplusplayer_handle handle,
3530 const esplusplayer_rsc_type type,
3534 * @brief Set advanced picture quality type.
3535 * @param [in] handle : esplusplayer handle.
3536 * @param [in] type : The picture quality type.
3537 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
3539 * @return @c one of esplusplayer_error_type values will be returned.
3543 int esplusplayer_set_advanced_picture_quality_type(
3544 esplusplayer_handle handle,
3545 esplusplayer_advanced_picture_quality_type type);
3548 * @brief Set resource allocate policy.
3549 * @param [in] handle : esplusplayer handle.
3550 * @param [in] policy : The resource allocate policy.
3551 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
3553 * @return @c one of esplusplayer_error_type values will be returned.
3556 * @remark If app has set not default alternaltive resource via
3557 * esplusplayer_set_alternative_video_resource(), alternative
3558 * resource setting will be ignored.
3560 int esplusplayer_set_resource_allocate_policy(
3561 esplusplayer_handle handle, esplusplayer_rsc_alloc_policy policy);
3564 * @brief Requests decoded video frame packet to acquire it. it works only
3565 * with #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_MANUAL_COPY
3567 * @param [in] handle : esplusplayer handle.
3568 * @param [out] packet : the decoded buffer.
3569 * @param [out] status : (nullable) the result of video frame requested
3570 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
3571 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
3573 * @return #ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise one of
3574 * esplusplayer_error_type values will be returned.
3577 * @see esplusplayer_set_video_frame_buffer_type()
3578 * @see esplusplayer_decoded_buffer_destroy()
3579 * @see esplusplayer_decoded_video_frame_buffer_type
3582 * esplusplayer_set_video_frame_buffer_type(handle,
3583 * ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_MANUAL_COPY);
3585 * esplusplayer_prepare_async(handle);
3588 * esplusplayer_decoded_video_packet packet;
3589 * esplusplayer_get_decoded_video_frame_status_type state;
3590 * int retval = esplusplayer_get_decoded_video_packet(handle, &packet, &state);
3591 * if (state == ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_SUCCESS) {
3592 * // successful case.
3593 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
3594 * // you have to call esplusplayer_decoded_buffer_destroy() after using the
3597 * esplusplayer_decoded_buffer_destroy(handle, &packet);
3598 * } else if (state ==
3599 * ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_REMAINING_BUFFER) {
3600 * // app has to call esplusplayer_decoded_buffer_destroy() with previous
3602 * // it means player couldn't draw the video frame into a buffer due to no
3604 * // in this case ,retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
3605 * } else if (state ==
3606 * ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_FILLED_BUFFER) {
3607 * // it means app should retry to get decoded video packet.
3608 * // in most case, there were no buffers drawn in the timing you called this
3610 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
3611 * } else if (state == ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN) {
3612 * // internal error happened
3613 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION
3618 int esplusplayer_get_decoded_video_packet(
3619 esplusplayer_handle handle, esplusplayer_decoded_video_packet* packet,
3620 esplusplayer_get_decoded_video_frame_status_type* status);
3623 * @brief Set preloading of the audio pipeline.
3624 * @param [in] handle : esplusplayer handle.
3625 * @return @c one of esplusplayer_error_type values will be returned.
3626 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
3628 * @remark If the other player is used by pre-loading mode, this player can
3629 * be prepared before the other player is released.
3630 * If app call esplusplayer_start before the original player is
3631 * released, the sound of original player can be affected.
3636 * esplusplayer_handle esplayer1 = esplusplayer_create();
3637 * esplusplayer_open(esplayer1);
3638 * esplusplayer_set_audio_preloading(esplayer1);
3639 * esplusplayer_audio_stream_info audio_stream_1;
3640 * if (audio_stream_1's mime type is PCM or G711_MULAW)
3641 * audio_stream_1.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_G711_MULAW;
3643 * audio_stream_1.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_AAC;
3644 * esplusplayer_set_audio_stream_info(esplayer1, &audio_stream_1);
3645 * esplusplayer_prepare_async(esplayer1);
3646 * esplusplayer_start(esplayer1);
3647 * // ... while playing esplayer1 ...
3648 * // the other player can be prepared if original player is preloading mode.
3649 * esplusplayer_handle esplayer2 = esplusplayer_create();
3650 * esplusplayer_open(esplayer2);
3651 * esplusplayer_set_audio_preloading(esplayer2);
3652 * esplusplayer_audio_stream_info audio_stream_2;
3653 * if (audio_stream_1's mime type is PCM or G711_MULAW) {
3654 * // audio_stream_2 can use the mime type except for PCM or G711_MULAW type.
3655 * audio_stream_2.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_AAC;
3656 * esplusplayer_set_audio_stream_info(esplayer2, &audio_stream_2);
3658 * if (audio_stream_2's mime type is PCM or G711_MULAW) {
3659 * audio_stream_2.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_G711_MULAW;
3660 * esplusplayer_set_audio_stream_info(esplayer2, &audio_stream_2);
3662 * // if all player don't use PCM or G711_MULAW type, one player need to set
3664 * audio_stream_2.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_AAC;
3665 * esplusplayer_set_audio_stream_info(esplayer2, &audio_stream_2);
3666 * esplusplayer_set_audio_codec_type(esplayer2,
3667 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW);
3670 * esplusplayer_prepare_async(esplayer2);
3671 * // the player can be started after the original player is stopped or the
3672 * // original player's audio stream is deactivated.
3673 * if (the app want to keep the original player instance)
3674 * esplusplayer_deactivate(esplayer1,ESPLUSPLAYER_STREAM_TYPE_AUDIO);
3676 * esplusplayer_stop(esplayer1);
3677 * esplusplayer_start(esplayer2);
3681 int esplusplayer_set_audio_preloading(esplusplayer_handle handle);
3684 * @brief Set a callback function to be invoked when video frames are
3686 * @param [in] handle : esplusplayer handle.
3687 * @param [in] video_frame_dropped_cb : the callback function to register.
3688 * @param [in] userdata : userdata of
3689 * esplusplayer_set_video_frame_dropped_cb()
3690 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
3691 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
3692 * @post esplusplayer_video_frame_dropped_cb() will be invoked.
3693 * if error_cb is set to null, esplusplayer_error_cb() will not be
3694 * @return #ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise one of
3695 * esplusplayer_error_type values will be returned.
3698 * @see esplusplayer_video_frame_dropped_cb()
3700 * void video_frame_dropped_cb(const uint64_t count, void* userdata){
3703 * esplusplayer_set_video_frame_dropped_cb(handle,
3704 * video_frame_dropped_cb, userdata);
3706 * esplusplayer_prepare_async(handle);
3710 int esplusplayer_set_video_frame_dropped_cb(
3711 esplusplayer_handle handle,
3712 esplusplayer_video_frame_dropped_cb video_frame_dropped_cb, void* userdata);
3715 * @brief Set video scan type.
3716 * @param [in] handle : esplusplayer handle.
3717 * @param [in] type : The video scan type.
3718 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
3720 * @return @c one of esplusplayer_error_type values will be returned.
3724 int esplusplayer_set_video_scan_type(esplusplayer_handle handle,
3725 esplusplayer_video_scan_type type);
3728 * @brief Get decoding time of the stream
3729 * @param [in] handle : esplusplayer handle.
3730 * @param [in] type : stream type.
3731 * @param [out] time_in_milliseconds : current decoding time in
3733 * @pre The player must be one of #ESPLUSPLAYER_STATE_PAUSE or
3734 * #ESPLUSPLAYER_STATE_PLAYING
3736 * @return @c one of esplusplayer_error_type values will be returned.
3740 int esplusplayer_get_decoding_time(esplusplayer_handle handle,
3741 esplusplayer_stream_type type,
3742 int32_t* time_in_milliseconds);
3745 * @brief Set the timeunit ms or us. All other espp time related API should
3746 * follow this time unit type.
3747 * @param [in] handle : esplusplayer handle.
3748 * @param [in] type : time unit type.
3749 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE
3751 * @return @c one of esplusplayer_error_type values will be returned.
3755 int esplusplayer_set_timeunit_type(esplusplayer_handle handle,
3756 esplusplayer_time_unit_type type);
3759 * @brief Set a callback function to be invoked when decoder receive one
3761 * @param [in] handle : esplusplayer handle.
3762 * @param [in] decoder_buffer_time_cb : the decoder input buffer time
3763 * callback function to register.
3764 * @param [in] userdata : userdata of
3765 * esplusplayer_set_decoder_input_buffer_time_cb()
3766 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3767 * esplusplayer_error_type
3768 * values will be returned.
3769 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3770 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3771 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3774 * refer to the sample code of esplusplayer_set_error_cb();
3776 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
3777 * or #ESPLUSPLAYER_STATE_IDLE.
3782 int esplusplayer_set_decoder_input_buffer_time_cb(
3783 esplusplayer_handle handle,
3784 esplusplayer_decoder_buffer_time_cb decoder_buffer_time_cb, void* userdata);
3787 * @brief Set a callback function to be invoked when get one output buffer
3789 * @param [in] handle : esplusplayer handle.
3790 * @param [in] decoder_buffer_time_cb : the decoder output buffer time
3791 * callback function to register.
3792 * @param [in] userdata : userdata of
3793 * esplusplayer_set_decoder_output_buffer_time_cb()
3794 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3795 * esplusplayer_error_type
3796 * values will be returned.
3797 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3798 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3799 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3802 * refer to the sample code of esplusplayer_set_error_cb();
3804 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
3805 * or #ESPLUSPLAYER_STATE_IDLE.
3810 int esplusplayer_set_decoder_output_buffer_time_cb(
3811 esplusplayer_handle handle,
3812 esplusplayer_decoder_buffer_time_cb decoder_buffer_time_cb, void* userdata);
3815 * @brief Set App id to esplayer to control resource confliction.
3816 * @param [in] handle : esplusplayer handle.
3817 * @param [in] app_info : application id, version, type, runtitle.
3818 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3819 * esplusplayer_error_type
3820 * values will be returned.
3821 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3822 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3823 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3826 * esplusplayer_app_info appinfo;
3827 * appinfo.id = "youtube";
3828 * appinfo.version = "3.0";
3829 * appinfo.type = "MSE";
3830 * appinfo.runtitle = "YouTube";
3831 * esplusplayer_handle esplayer = esplusplayer_create();
3832 * esplusplayer_open(esplayer);
3833 * esplusplayer_set_app_info_ex(esplayer,&appinfo);
3834 * // ... your codes ...
3835 * esplusplayer_close(esplayer);
3837 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
3841 * @see esplusplayer_open()
3843 int esplusplayer_set_app_info_ex(esplusplayer_handle handle,
3844 const esplusplayer_app_info_ex* app_info);
3847 * @brief Set the rotate angle of the video stream.
3848 * This API is used for rotate camera, e.g Pogo-Pin camera
3849 * In Pogo-Pin Camera Video Call scenario, just provide the rotate angle to
3851 * @remark This API will not actually rotate the video display
3852 * @param [in] handle : esplusplayer handle.
3853 * @param [in] rotation : the rotate angle of the video.
3854 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3855 * esplusplayer_error_type
3856 * values will be returned.
3857 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3858 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3859 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3862 * esplusplayer_open(esplayer);
3863 * esplusplayer_set_video_stream_rotation_info(esplayer_,ESPLUSPLAYER_VIDEO_ROTATION_90);
3864 * // ... your codes ...
3865 * esplusplayer_close(esplayer);
3867 * @pre The player state can be all of #esplusplayer_state except
3868 * #ESPLUSPLAYER_STATE_NONE.
3869 * @post this API worked only when video sink created.
3872 * @see esplusplayer_open() \n
3874 int esplusplayer_set_video_stream_rotation_info(
3875 esplusplayer_handle handle,
3876 const esplusplayer_video_stream_rotation_type rotation);
3879 * @brief Get the rotate angle of the video stream.
3880 * @param [in] handle : esplusplayer handle.
3881 * @param [out] rotation : the rotate angle of the video stream which want
3884 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3885 * esplusplayer_error_type
3886 * values will be returned.
3887 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3888 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3889 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3892 * esplusplayer_display_rotation_type rotation_get =
3893 * ESPLUSPLAYER_VIDEO_ROTATION_NONE;
3894 * esplusplayer_open(esplayer);
3895 * esplusplayer_set_video_stream_rotation_info(esplayer,ESPLUSPLAYER_VIDEO_ROTATION_90);
3896 * // ... your codes ...
3897 * esplusplayer_get_video_stream_rotation_info(esplayer,&rotation_get);
3898 * // ... your codes ...
3899 * esplusplayer_close(esplayer);
3901 * @pre The player state can be all of #esplusplayer_state except
3902 * #ESPLUSPLAYER_STATE_NONE.
3903 * @post this API worked only when video sink created.
3906 * @see esplusplayer_open() \n
3907 * esplusplayer_set_video_stream_rotation_info()
3909 int esplusplayer_get_video_stream_rotation_info(
3910 esplusplayer_handle handle,
3911 esplusplayer_video_stream_rotation_type* rotation);
3914 * @brief Provided api for setting buffer level of simple mix out
3915 * @param [in] handle : esplusplayer handle ptr.
3916 * @param [in] level : set buffer level of simple mix out
3917 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3918 * esplusplayer_error_type values will be returned.
3919 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3920 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3921 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3924 * esplusplayer_open(esplayer);
3925 * esplusplayer_set_audio_codec_type(esplayer,
3926 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW)
3927 * esplusplayer_set_alternative_audio_resource(esplayer,
3928 * ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT);
3929 * esplusplayer_set_simple_mix_out_buffer_level(esplayer,
3930 * ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_LOW);
3931 * // ... your codes ...
3932 * esplusplayer_close(esplayer);
3934 * prepare esplayer done
3935 * // ... your codes ...
3936 * esplusplayer_deactivate(esplayer, ESPLUSPLAYER_STREAM_TYPE_AUDIO)
3937 * esplusplayer_set_audio_codec_type(esplayer,
3938 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW)
3939 * esplusplayer_set_alternative_audio_resource(esplayer,
3940 * ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT);
3941 * esplusplayer_set_simple_mix_out_buffer_level(esplayer,
3942 * ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_LOW);
3943 * esplusplayer_activate(esplayer, ESPLUSPLAYER_STREAM_TYPE_AUDIO);
3944 * // ... your codes ...
3945 * esplusplayer_close(esplayer);
3947 * @pre The player state can be all of #State except
3948 * #ESPLUSPLAYER_STATE_NONE.
3951 * @remark This API can set only before esplusplayer_prepare_async() or
3952 * after esplusplayer_deactivate(ESPLUSPLAYER_STREAM_TYPE_AUDIO).
3954 * @see esplusplayer_open() \n
3955 * esplusplayer_set_audio_codec_type()
3956 * esplusplayer_set_alternative_audio_resource()
3958 int esplusplayer_set_simple_mix_out_buffer_level(
3959 esplusplayer_handle handle, esplusplayer_simple_mix_out_buffer_level level);
3965 #endif // __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__