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 #ifdef TIZEN_FEATURE_PUBLIC
32 #include <media/sound_manager.h>
35 #include "esplusplayer_capi/buffer.h"
36 #include "esplusplayer_capi/display.h"
37 #include "esplusplayer_capi/drm.h"
38 #include "esplusplayer_capi/error.h"
39 #include "esplusplayer_capi/espacket.h"
40 #include "esplusplayer_capi/event.h"
41 #include "esplusplayer_capi/latency.h"
42 #include "esplusplayer_capi/state.h"
43 #include "esplusplayer_capi/stream.h"
44 #include "esplusplayer_capi/submitdatatype.h"
45 #include "esplusplayer_capi/submitstatus.h"
53 typedef void (*esplusplayer_error_cb)(const esplusplayer_error_type, void*);
54 typedef void (*esplusplayer_buffer_status_cb)(const esplusplayer_stream_type,
55 const esplusplayer_buffer_status,
57 typedef void (*esplusplayer_buffer_byte_status_cb)(
58 const esplusplayer_stream_type, const esplusplayer_buffer_status, uint64_t,
60 typedef void (*esplusplayer_buffer_time_status_cb)(
61 const esplusplayer_stream_type, const esplusplayer_buffer_status, uint64_t,
63 typedef void (*esplusplayer_resource_conflicted_cb)(void*);
64 typedef void (*esplusplayer_eos_cb)(void*);
65 typedef void (*esplusplayer_ready_to_prepare_cb)(const esplusplayer_stream_type,
67 typedef void (*esplusplayer_prepare_async_done_cb)(bool, void*);
68 typedef void (*esplusplayer_seek_done_cb)(void*);
69 typedef void (*esplusplayer_ready_to_seek_cb)(const esplusplayer_stream_type,
70 const uint64_t, void*);
71 typedef void (*esplusplayer_media_packet_video_decoded_cb)(
72 const esplusplayer_decoded_video_packet*, void*);
73 typedef void (*esplusplayer_closed_caption_cb)(const char* data, const int size,
75 typedef void (*esplusplayer_flush_done_cb)(void*);
76 typedef void (*esplusplayer_event_cb)(const esplusplayer_event_type,
77 const esplusplayer_event_msg, void*);
78 typedef void (*esplusplayer_video_latency_status_cb)(
79 const esplusplayer_latency_status latency_status, void*);
80 typedef void (*esplusplayer_audio_latency_status_cb)(
81 const esplusplayer_latency_status latency_status, void*);
82 typedef void (*esplusplayer_video_high_latency_cb)(void*);
83 typedef void (*esplusplayer_audio_high_latency_cb)(void*);
84 typedef void (*esplusplayer_video_frame_dropped_cb)(const uint64_t count,
86 typedef void (*esplusplayer_decoder_buffer_time_cb)(
87 const esplusplayer_stream_type, const esplusplayer_decoder_buffer_time,
90 typedef void* esplusplayer_handle;
93 * @brief Enumerations for the Adaptive info type
95 typedef enum esplusplayer_adaptive_info_type {
96 ESPLUSPLAYER_ADAPT_INFO_TYPE_NONE,
97 ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_FRAMES,
98 ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_VIDEO_FRAMES_FOR_CATCHUP,
99 ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_AUDIO_FRAMES_FOR_CATCHUP,
100 } esplusplayer_adaptive_info_type;
103 * @brief Enumerations for low latency mode
106 typedef enum esplusplayer_low_latency_mode {
107 ESPLUSPLAYER_LOW_LATENCY_MODE_NONE = 0x0000,
109 * @description to support audio fast decoding/rendering
111 ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO = 0x0001,
113 * @description to support video fast decoding/rendering
114 * Video stream should be composed only of P and I frames.
115 * The mode support seamless resolution change since tizen 6.5
117 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO = 0x0010,
119 * @description to support video fast decoding/rendering and video
120 * distortion concealment.
121 * Video stream should be composed only of P and I frames.
122 * For applications using the UDP protocol, packet loss can
123 * occur. when video distortion by video packet loss is
124 * detected, it is a function to conceal distortion by showing
125 * previous vido frame. It is supported only in h.264 codec &
126 * FHD or lower resolution.
128 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO_DISTORTION_CONCEALMENT =
129 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO | 0x0020,
131 * @description to disable clock sync and a/v sync when rendering. it
132 * includes #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL.
134 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC = 0x0100,
136 * @description to disable preroll which means player doesn't wait for
137 * first buffer when state is changed to
138 * #ESPLUSPLAYER_STATE_READY from #ESPLUSPLAYER_STATE_IDLE.
139 * It changes the state immediately.
140 * It's usually used for sparse stream. (e.g. video packet
141 * arrives but audio packet does't yet.)
143 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL = 0x0200,
145 * @deprecated Deprecated since tizen 6.5
146 * @description to set lower video quality
147 * If set this value, it can use original game_mode.
148 * This value will be deprecated from 2022TV.
149 * Please use ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE.
151 ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY = 0x1000,
153 * @description to set game mode for minimum latency
154 * Video stream should be composed only of P and I frames.
155 * It must not be used together with
156 * #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
157 * If use this value, It can expect better latency performance
158 * than #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
159 * The mode support seamless resolution change.
160 * The mode use lower video quality.
162 ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE =
163 ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO |
164 ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO | 0x2000,
166 * @description to set game mode for latency
167 * Video stream should be composed only of P and I frames.
168 * Video stream must use fixed resolution.
169 * It must not be used together with
170 * #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY.
171 * If use this value, It can expect better latency
173 * #ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY and
174 * #ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE
175 * The mode use lower video quality.
177 ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE_WITH_FIXED_RESOLUTION =
178 ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE | 0x4000,
179 } esplusplayer_low_latency_mode;
182 * @brief Enumerations for esplusplayer audio codec type
184 typedef enum esplusplayer_audio_codec_type {
186 * @description hardware codec can only be selected, default type
188 ESPLUSPLAYER_AUDIO_CODEC_TYPE_HW,
190 * @description sorfware codec can only be selected
192 ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW
193 } esplusplayer_audio_codec_type;
196 * @brief Enumerations for esplusplayer video codec type
198 typedef enum esplusplayer_video_codec_type {
200 * @description hardware codec can only be selected, default type
202 ESPLUSPLAYER_VIDEO_CODEC_TYPE_HW,
204 * @description software codec can only be selected
206 ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW,
208 * @description hardware codec using n-decoding mode can only be selected.
209 It must set display type to mixer type by display setting
211 esplusplayer_set_display()
213 ESPLUSPLAYER_VIDEO_CODEC_TYPE_HW_N_DECODING
215 } esplusplayer_video_codec_type;
217 * @brief Enumerations for esplusplayer audio easing type
220 typedef enum esplusplayer_audio_easing_type {
222 * @description audio easing function type is linear
224 ESPLUSPLAYER_AUDIO_EASING_LINEAR,
226 * @description audio easing function type is incubic
228 ESPLUSPLAYER_AUDIO_EASING_INCUBIC,
230 * @description audio easing function type is outcubic
232 ESPLUSPLAYER_AUDIO_EASING_OUTCUBIC,
234 * @description audio easing function type is none
236 ESPLUSPLAYER_AUDIO_EASING_NONE
237 } esplusplayer_audio_easing_type;
240 * @brief Enumerations for esplusplayer resource type
243 typedef enum esplusplayer_rsc_type {
245 * @description video renderer type
247 ESPLUSPLAYER_RSC_TYPE_VIDEO_RENDERER
248 } esplusplayer_rsc_type;
251 * @brief Enumerations for advanced video quality type
254 typedef enum esplusplayer_advanced_picture_quality_type {
256 * @description advanced picture quality for video call
259 ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_VIDEO_CALL,
261 * @description advanced picture quality for usb camera
264 ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_USB_CAMERA,
266 * @description advanced picture quality for airplay screen mirroring
269 ESPLUSPLAYER_ADVANCED_PICTURE_QUALITY_AIRPLAY_MIRRORING
270 } esplusplayer_advanced_picture_quality_type;
273 * @brief Enumerations for audio resource type
276 typedef enum esplusplayer_audio_resource_type {
278 * @description all audio resources(decoder/audio out) to main resources
280 ESPLUSPLAYER_AUDIO_RESOURCE_MAIN,
282 * @description only audio decoder to sub resource
284 ESPLUSPLAYER_AUDIO_RESOURCE_SUB_DECODER,
286 * @description only audio out to simple mix out resource
288 ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT
289 } esplusplayer_audio_resource_type;
292 * @brief Enumerations for buffer level of simple mix out
295 typedef enum esplusplayer_simple_mix_out_buffer_level {
297 * @description buffer level is low
299 ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_LOW,
301 * @description buffer level is middle, default type
303 ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_MID,
305 * @description buffer level is high
307 ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_HIGH
308 } esplusplayer_simple_mix_out_buffer_level;
311 * @brief ESPlusplayer easing target volume, duration, type information
316 * @description audio easing target volume (0 ~ 100)
320 * @description audio easing duration, in millisecond
322 unsigned int duration;
324 * @description audio easing function type
326 esplusplayer_audio_easing_type type;
327 } esplusplayer_target_audio_easing_info;
330 * @brief ESPlusplayer app id, version, type information
334 * @description App id for controlling resource.
338 * @description When there is playback market issue, KPI logger will
343 * @description RunningApps.InformationTicker will use this type to show
344 * stream information. ex) "MSE", "HTML5", etc..
347 } esplusplayer_app_info;
350 * @brief ESPlusplayer app id, version, type, runtitle information
355 * @description App id for controlling resource.
359 * @description When there is playback market issue, KPI logger will
364 * @description RunningApps.InformationTicker will use this type to show
365 * stream information. ex) "MSE", "HTML5", etc..
369 * @description App runtitle.
372 } esplusplayer_app_info_ex;
376 * @description the minimum frame number in case of mid latency
378 int mid_latency_threshold;
380 * @description the minimum frame number in case of high latency
382 int high_latency_threshold;
383 } esplusplayer_latency_threshold;
386 * @brief rational number numerator/denominator
390 * @description the numerator value
394 * @description the denominator value
397 } esplusplayer_rational;
400 * @brief resource allocate policy
403 typedef enum esplusplayer_rsc_alloc_policy {
405 * @description exclusive policy, RM will return the requested resources,
408 ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE = 0,
410 * @description conditional policy, when trying to allocate resources and
411 * available resources are not left, RM will return fail.
413 ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE_CONDITIONAL,
415 * @description inapp multiview policy, RM will return available
419 ESPLUSPLAYER_RSC_ALLOC_INAPP_MULTIVIEW,
421 * @description Forced to allocate mfc decoder ,used senario of get decoded
426 ESPLUSPLAYER_RSC_ALLOC_EXCLUSIVE_MFC_FORCED
427 } esplusplayer_rsc_alloc_policy;
430 * @brief Enumerations for the status of getting decoded video frame
433 typedef enum esplusplayer_get_decoded_video_frame_status_type {
434 /** @brief successfully decoded video frame acquired. */
435 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_SUCCESS,
436 /** @brief it means app has to return the video before getting decoded
439 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_REMAINING_BUFFER,
441 * @brief there is no filled video frame yet.
443 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_FILLED_BUFFER,
445 * @brief internal error
447 ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN
448 } esplusplayer_get_decoded_video_frame_status_type;
451 * @brief Enumerations for the video scan type
454 typedef enum esplusplayer_video_scan_type {
456 * @description progressive, mfd or dvde will be allocated for H.264 2K in
459 ESPLUSPLAYER_VIDEO_SCAN_TYPE_PROGRESSIVE,
461 * @description interlaced, only mfd has been allocated for H.264 2K in normal
464 ESPLUSPLAYER_VIDEO_SCAN_TYPE_INTERLACED,
465 } esplusplayer_video_scan_type;
468 * @brief Enumerations for the time unit type
471 typedef enum esplusplayer_time_unit_type {
473 * @description the timeunit will be ms. It is default value.
475 ESPLUSPLAYER_TIME_UNIT_MS,
477 * @description the timeunit will be us.
479 ESPLUSPLAYER_TIME_UNIT_US,
480 } esplusplayer_time_unit_type;
483 * @brief Enumerations for the video stream rotation type
486 typedef enum esplusplayer_video_stream_rotation_type {
487 ESPLUSPLAYER_VIDEO_ROTATION_NONE,
488 ESPLUSPLAYER_VIDEO_ROTATION_90,
489 ESPLUSPLAYER_VIDEO_ROTATION_180,
490 ESPLUSPLAYER_VIDEO_ROTATION_270
491 } esplusplayer_video_stream_rotation_type;
494 * @brief Create a esplusplayer handle.
496 * @return return esplusplayer handle pointer.
498 * esplusplayer_handle esplayer = esplusplayer_create();
499 * // ... your codes ...
500 * esplusplayer_destroy(esplayer);
503 * @post The player state will be #ESPLUSPLAYER_STATE_NONE.
506 esplusplayer_handle esplusplayer_create();
509 * @brief Open esplusplayer handle.
510 * @param [in] handle : esplusplayer handle
511 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
512 * esplusplayer_error_type
513 * values will be returned.
514 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
515 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
516 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
519 * esplusplayer_handle esplayer = esplusplayer_create();
520 * esplusplayer_open(esplayer);
521 * // ... your codes ...
522 * esplusplayer_close(esplayer);
523 * esplusplayer_destroy(esplayer);
525 * @pre The player state must be #ESPLUSPLAYER_STATE_NONE.
526 * @post The player state will be #ESPLUSPLAYER_STATE_IDLE.
528 * @see esplusplayer_close()
530 int esplusplayer_open(esplusplayer_handle handle);
533 * @brief Release all the player resources and all setting except callback
535 * @param [in] handle : esplusplayer handle.
536 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
537 * esplusplayer_error_type
538 * values will be returned.
539 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
540 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
541 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
543 * @pre The player state must be all of #esplusplayer_state except
544 * #ESPLUSPLAYER_STATE_NONE.
545 * @post The player state will be #ESPLUSPLAYER_STATE_NONE.
547 * @see esplusplayer_open()
549 int esplusplayer_close(esplusplayer_handle handle);
552 * @brief Release player handle.
553 * @param [in] handle : esplusplayer handle.
554 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
555 * esplusplayer_error_type
556 * values will be returned.
557 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
558 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
559 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
562 * refer to the sample code of esplusplayer_create()
564 * @pre The player state must be #ESPLUSPLAYER_STATE_NONE
565 * @post player handle will be removed.
567 * @see esplusplayer_create()
569 int esplusplayer_destroy(esplusplayer_handle handle);
572 * @brief Not play the specific stream anymore.
573 * @remark The submitted es packets will be dropped after deactivated.
574 * It recommands to stop feeding the specific stream's packets.
575 * @param [in] handle : esplusplayer handle.
576 * @param [in] type : stream type which user want to deactivate.
577 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
578 * esplusplayer_error_type
579 * values will be returned.
580 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
581 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
582 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
585 * refer to the sample code of esplusplayer_activate()
587 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY
588 * @post The player state is same as before calling
589 * esplusplayer_deactivate(). The buffered data of the deactivated
590 * stream will be flushed and the resources for decoding and rendering will be
593 * @see esplusplayer_activate
595 int esplusplayer_deactivate(esplusplayer_handle handle,
596 esplusplayer_stream_type type);
599 * @brief Restart to play the specific stream.
600 * @remark If user wants to change the specific stream info, new stream info
601 * has to be set before activate. User has to submit the specific stream from
602 * the current playing time for activating. The video stream has to be submitted
604 * @param [in] handle : esplusplayer handle.
605 * @param [in] type : stream type which user want to activate.
606 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
607 * esplusplayer_error_type
608 * values will be returned.
609 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
610 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
611 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
614 * prepare esplayer done
615 * // ... your codes ...
616 * esplusplayer_deactivate(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
617 * esplusplayer_set_video_stream_info* stream;
618 * stream->width = 640;
619 * stream->height = 352;
620 * stream->mime_type = ESPLUSPLAYER_VIDEO_MIME_TYPE_H264;
621 * stream->framerate_num = 30;
622 * stream->framerate_den = 1;
623 * esplusplayer_set_video_stream_info(esplayer, stream);
624 * esplusplayer_activate(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
625 * // ... your codes ...
626 * esplusplayer_close(esplayer);
627 * esplusplayer_destroy(esplayer);
629 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY
630 * @post The player state is same as before calling
631 * esplusplayer_activate(). Rebuild pipeline to render the stream.
633 * @see esplusplayer_prepare_async()
635 int esplusplayer_activate(esplusplayer_handle handle,
636 esplusplayer_stream_type type);
639 * @brief Not play the audio stream anymore.
640 * @remark User has to keep feeding audio packets like when playing audio.
641 * @param [in] handle : esplusplayer handle.
642 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
643 * esplusplayer_error_type
644 * values will be returned.
645 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
646 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
647 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
650 * refer to the sample code of esplusplayer_activate_audio()
652 * @pre The player state must be at least #ESPLUSPLAYER_STATE_IDLE
653 * @post The player state is same as before calling
654 * esplusplayer_deactivate_audio(). The player will keep buffering
655 * the audio packets and consuming it at the rendering time.
656 * All audio resources of decoder and renderer will be released.
659 * @see esplusplayer_activate_audio
661 int esplusplayer_deactivate_audio(esplusplayer_handle handle);
664 * @brief Restart to play the audio stream.
665 * @remark User can't change the audio stream info before activate.
666 * @param [in] handle : esplusplayer handle.
667 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
668 * esplusplayer_error_type
669 * values will be returned.
670 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
671 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
672 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
675 * // play one esplayer in normal
676 * esplusplayer_handle esplayer1 = esplusplayer_create();
677 * esplusplayer_open(esplayer1);
678 * esplusplayer_audio_stream_info audio_stream_1;
679 * audio_stream_1.codec_data = nullptr;
680 * audio_stream_1.codec_data_length = 0;
681 * esplusplayer_set_audio_stream_info(esplayer1, &audio_stream_1);
682 * // ... your codes ...
683 * esplusplayer_prepare_async(esplayer1);
684 * esplusplayer_start(esplayer1);
686 * // play one more esplayer started in deactivate
687 * esplusplayer_handle esplayer2 = esplusplayer_create();
688 * esplusplayer_open(esplayer2);
689 * esplusplayer_audio_stream_info audio_stream_2;
690 * audio_stream_2.codec_data = nullptr;
691 * audio_stream_2.codec_data_length = 0;
692 * esplusplayer_set_audio_stream_info(esplayer2, &audio_stream_2);
693 * // ... your codes ...
694 * esplusplayer_deactivate_audio(esplayer2);
695 * esplusplayer_prepare_async(esplayer2);
696 * esplusplayer_start(esplayer2);
698 * // if you want to play esplayer2, deactivate esplayer1 first
699 * // and then activate esplayer2
700 * esplusplayer_deactivate_audio(esplayer1);
701 * esplusplayer_activate_audio(esplayer2);
702 * // ... your codes ...
703 * esplusplayer_close(esplayer1);
704 * esplusplayer_destroy(esplayer1);
705 * esplusplayer_close(esplayer2);
706 * esplusplayer_destroy(esplayer2);
708 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY
709 * @post The player state is same as before calling
710 * esplusplayer_activate_audio(). Rebuild audio pipeline to render
714 * @see esplusplayer_deactivate_audio
716 int esplusplayer_activate_audio(esplusplayer_handle handle);
719 * @brief Prepare the player for playback, asynchronously.
720 * @param [in] handle : esplusplayer handle.
721 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
722 * esplusplayer_error_type
723 * values will be returned.
724 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
725 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
726 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
729 * static void OnPrepareDone(bool ret, void* userdata) {
730 * //Something you want to do when prepare done, but, we strongly
731 * //recommend DO NOT CALL PLAYER APIs in this callbck
732 * printf("OnPrepareDone\n");
734 * esplusplayer_handle esplayer = esplusplayer_create();
735 * esplusplayer_set_prepare_async_done_cb(esplayer,
736 * OnPrepareDone,nullptr);
737 * esplusplayer_open(esplayer);
738 * esplusplayer_prepare_async(esplayer);
739 * // ... your codes ...
740 * esplusplayer_close(esplayer);
741 * esplusplayer_destroy(esplayer);
743 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE. \n
744 * Call at least one of esplusplayer_set_video_stream_info() or
745 * esplusplayer_set_audio_stream_info(). \n
746 * @post It invokes esplusplayer_prepare_async_done_cb() when prepare is
748 * Prepare result can be succeeded or not at this moment. \n
749 * If the result is succeeded, the player state will be
750 * #ESPLUSPLAYER_STATE_READY and one frame will be displayed
751 * unless esplusplayer_set_display_visible() is set to @c false.
753 * @remark esplusplayer_prepare_async_done_cb() can be invoked only when as
754 * many es packets as at least one decoded frame is submitted. \n
755 * The player can receive es packets after
756 * esplusplayer_ready_to_seek_cb() is called.
757 * @see esplusplayer_open() \n
758 * esplusplayer_stop() \n
759 * esplusplayer_submit_packet() \n
760 * esplusplayer_ready_to_prepare_cb() \n
761 * esplusplayer_close()
763 int esplusplayer_prepare_async(esplusplayer_handle handle);
766 * @brief Start playback.
767 * @param [in] handle : esplusplayer handle.
768 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
769 * esplusplayer_error_type
770 * values will be returned.
771 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
772 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
773 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
776 * prepare esplayer done
777 * esplusplayer_start(esplayer);
778 * // ... your codes ...
779 * esplusplayer_stop(esplayer);
781 * @pre The player state should be #ESPLUSPLAYER_STATE_READY.
782 * @post The player state will be #ESPLUSPLAYER_STATE_PLAYING.
784 * @see esplusplayer_open() \n
785 * esplusplayer_prepare_async() \n
786 * esplusplayer_stop() \n
787 * esplusplayer_close()
789 int esplusplayer_start(esplusplayer_handle handle);
792 * @brief Stop playing media content.
793 * @param [in] handle : esplusplayer handle.
794 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
795 * esplusplayer_error_type
796 * values will be returned.
797 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
798 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
799 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
802 * prepare esplayer done
803 * // ... your codes ...
804 * esplusplayer_stop(esplayer);
805 * // ... your codes ...
806 * esplusplayer_close(esplayer);
808 * @pre The player state must be all of #esplusplayer_state except
809 * #ESPLUSPLAYER_STATE_NONE.
810 * @post The player state will be #ESPLUSPLAYER_STATE_IDLE.
812 * @remark esplusplayer_close() must be called once after player is stopped
813 * @see esplusplayer_open() \n
814 * esplusplayer_prepare_async() \n
815 * esplusplayer_start() \n
816 * esplusplayer_pause() \n
817 * esplusplayer_resume() \n
818 * esplusplayer_close()
820 int esplusplayer_stop(esplusplayer_handle handle);
823 * @brief Pause playing media content.
824 * @param [in] handle : esplusplayer handle.
825 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
826 * esplusplayer_error_type
827 * values will be returned.
828 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
829 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
830 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
833 * prepare esplayer done
834 * // ... your codes ...
835 * esplusplayer_pause(esplayer);
836 * // ... your codes ...
837 * esplusplayer_stop(esplayer);
839 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
840 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
841 * @post The player state will be #ESPLUSPLAYER_STATE_PAUSE.
843 * @see esplusplayer_start() \n
844 * esplusplayer_resume() \n
845 * esplusplayer_prepare_async()
847 int esplusplayer_pause(esplusplayer_handle handle);
850 * @brief Resume playing media content.
851 * @param [in] handle : esplusplayer handle.
852 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
853 * esplusplayer_error_type
854 * values will be returned.
855 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
856 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
857 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
860 * prepare esplayer done
861 * // ... your codes ...
862 * esplusplayer_pause(esplayer);
863 * // ... your codes ...
864 * esplusplayer_resume(esplayer);
865 * // ... your codes ...
866 * esplusplayer_stop(esplayer);
868 * @pre The player state must be one of #ESPLUSPLAYER_STATE_PAUSED or
869 * #ESPLUSPLAYER_STATE_PLAYING.
870 * @post The player state will be #ESPLUSPLAYER_STATE_PLAYING.
872 * @see esplusplayer_start() \n
873 * esplusplayer_pause() \n
874 * esplusplayer_prepare_async()
876 int esplusplayer_resume(esplusplayer_handle handle);
879 * @brief Set playback rate.
880 * @param [in] handle : esplusplayer handle.
881 * @param [in] playback_rate : the playback rate from 0.0 to 2.0.
882 * @param [in] audio_mute : the audio is mute on/off, true: mute on, false:
884 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
885 * esplusplayer_error_type
886 * values will be returned.
887 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
888 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
889 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
892 * prepare esplayer done
893 * // ... your codes ...
894 * esplusplayer_set_playback_rate(esplayer,2,true);
895 * // ... your codes ...
896 * esplusplayer_stop(esplayer);
898 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
899 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING. \n
900 * User has to push the data as fast as playback rate.
903 * @see esplusplayer_prepare_async()
905 int esplusplayer_set_playback_rate(esplusplayer_handle handle,
906 const double playback_rate,
907 const bool audio_mute);
910 * @brief Seek for playback, asynchronously.
911 * @param [in] handle : esplusplayer handle.
912 * @param [in] time : seek time default in milliseconds, can be set by
913 * @esplusplayer_set_timeunit_type
914 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
915 * esplusplayer_error_type
916 * values will be returned.
917 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
918 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
919 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
922 * prepare esplayer done
923 * // ... your codes ...
924 * const uint64_t ms_to_seek = 0;
925 * esplusplayer_seek(esplayer,ms_to_seek);
926 * // ... your codes ...
927 * esplusplayer_stop(esplayer);
929 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
930 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
931 * In ESPLUSPLAYER_STATE_IDLE, this api can be called exceptionally
932 * between esplusplayer_open() and esplusplayer_prepare_async().
933 * the start time of plyabak can be set explicitly when starting
934 * first playback. In this case, esplusplayer_set_seek_done_cb is not
938 * @remark esplusplayer_set_seek_done_cb() will be invoked if seek operation
940 * Seek result can be succeeded or not at this moment. \n
941 * esplusplayer_set_seek_done_cb() can be invoked only when as many
942 * es packets as at least one decoded frame is submitted. \n
943 * The player can receive es packets from seek time after
944 * esplusplayer_ready_to_seek_cb() is invoked.
945 * @see esplusplayer_ready_to_seek_cb() \n
946 * esplusplayer_prepare_async()
948 int esplusplayer_seek(esplusplayer_handle handle, uint64_t time);
951 * @brief Set App id to esplayer to control resource confliction.
952 * @param [in] handle : esplusplayer handle.
953 * @param [in] app_info : application id, version, type.
954 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
955 * esplusplayer_error_type
956 * values will be returned.
957 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
958 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
959 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
962 * esplusplayer_app_info appinfo;
963 * appinfo.id = "youtube";
964 * appinfo.version = "3.0";
965 * appinfo.type = "MSE";
966 * esplusplayer_handle esplayer = esplusplayer_create();
967 * esplusplayer_open(esplayer);
968 * esplusplayer_set_app_info(esplayer,&appinfo);
969 * // ... your codes ...
970 * esplusplayer_close(esplayer);
972 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
975 * @see esplusplayer_open()
977 int esplusplayer_set_app_info(esplusplayer_handle handle,
978 const esplusplayer_app_info* app_info);
981 * @brief Set the video display.
982 * @param [in] handle : esplusplayer handle.
983 * @param [in] type : display type.
984 * @param [in] window : the handle to display window.
985 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
986 * esplusplayer_error_type
987 * values will be returned.
988 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
989 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
990 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
993 * esplusplayer_open(esplayer);
994 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
995 * // ... your codes ...
996 * esplusplayer_close(esplayer);
998 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
1001 * @remark Esplusplayer is not supporting changing display. \n
1002 * This API have to be called before calling
1003 * esplusplayer_prepare_async() to reflect the display type.
1004 * @see esplusplayer_open() \n
1005 * esplusplayer_set_display_mode() \n
1006 * esplusplayer_set_display_roi() \n
1007 * esplusplayer_set_display_visible()
1009 int esplusplayer_set_display(esplusplayer_handle handle,
1010 esplusplayer_display_type type, void* window);
1012 * @brief Set the video display.
1013 * @param [in] handle : esplusplayer handle.
1014 * @param [in] type : display type.
1015 * @param [in] subsurface : the ecore wayland subsurface handle.
1016 * @param [in] x : the x coordinate of subsurface.
1017 * @param [in] y : the y coordinate of subsurface.
1018 * @param [in] width : the width of subsurface.
1019 * @param [in] height : the height of subsurface.
1020 * @return @c one of esplusplayer_error_type values will be returned.
1021 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
1025 * @see esplusplayer_set_display_mode() \n
1026 * esplusplayer_set_display_roi() \n
1027 * esplusplayer_set_display_visible()
1029 int esplusplayer_set_display_ecore_subsurface(esplusplayer_handle handle,
1030 esplusplayer_display_type type,
1031 void* subsurface, int x, int y,
1032 int width, int height);
1034 * @brief Set the video display.
1035 * @param [in] handle : esplusplayer handle.
1036 * @param [in] type : display type.
1037 * @param [in] window : the ecore wayland2 window handle.
1038 * @param [in] x : the x coordinate of window.
1039 * @param [in] y : the ycoordinate of window.
1040 * @param [in] width : the width of window.
1041 * @param [in] height : the height of window.
1042 * @return @c one of esplusplayer_error_type values will be returned.
1043 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
1047 * @see esplusplayer_set_display_mode() \n
1048 * esplusplayer_set_display_roi() \n
1049 * esplusplayer_set_display_visible()
1051 int esplusplayer_set_ecore_display(esplusplayer_handle handle,
1052 esplusplayer_display_type type, void* window,
1053 int x, int y, int width, int height);
1055 * @brief Set the video display mode.
1056 * @param [in] handle : esplusplayer handle.
1057 * @param [in] mode : display mode.
1058 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1059 * esplusplayer_error_type
1060 * values will be returned.
1061 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1062 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1063 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1066 * esplusplayer_open(esplayer);
1067 * esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
1068 * // ... your codes ...
1069 * esplusplayer_close(esplayer);
1071 * @pre The player state can be all of #esplusplayer_state except
1072 * #ESPLUSPLAYER_STATE_NONE.
1075 * @remark If no display is set, no operation is performed.
1076 * @see esplusplayer_open() \n
1077 * esplusplayer_set_display_mode() \n
1078 * esplusplayer_set_display_roi() \n
1079 * esplusplayer_set_display_visible()
1081 int esplusplayer_set_display_mode(esplusplayer_handle handle,
1082 esplusplayer_display_mode mode);
1085 * @brief Set the ROI(Region Of Interest) area of display.
1086 * @param [in] handle : esplusplayer handle.
1087 * @param [in] x : var startPointX in src video area.
1088 * @param [in] y : var startPointY in src video area.
1089 * @param [in] width : width of display in src video area.
1090 * @param [in] height : height of display in src video area.
1091 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1092 * esplusplayer_error_type
1093 * values will be returned.
1094 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1095 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1096 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1099 * esplusplayer_open(esplayer);
1100 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
1101 * esplusplayer_set_display_mode(esplayer,ESPLUSPLAYER_DISPLAY_MODE_DST_ROI);
1102 * esplusplayer_set_display_roi(esplayer,0,0,600,500);
1103 * // ... your codes ...
1104 * esplusplayer_close(esplayer);
1106 * @pre The player state can be all of #esplusplayer_state except
1107 * #ESPLUSPLAYER_STATE_NONE. \n
1108 * Before set display ROI, #ESPLUSPLAYER_DISPLAY_MODE_DST_ROI
1109 * must be set with esplusplayer_set_display_mode().
1112 * @remark The minimum value of width and height are 1.
1113 * @see esplusplayer_open() \n
1114 * esplusplayer_set_display() \n
1115 * esplusplayer_set_display_mode() \n
1116 * esplusplayer_set_display_visible()
1118 int esplusplayer_set_display_roi(esplusplayer_handle handle, int x, int y,
1119 int width, int height);
1122 * @brief Set the video stretch mode on 21:9 TV.
1123 * @param [in] handle : esplusplayer handle.
1124 * @param [in] mode : stretch mode.
1125 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1126 * esplusplayer_error_type
1127 * values will be returned.
1128 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1129 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1130 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1133 * esplusplayer_open(esplayer);
1134 * esplusplayer_set_stretch_mode(esplayer,1);
1135 * // ... your codes ...
1136 * esplusplayer_close(esplayer);
1138 * @pre The player state can be all of #esplusplayer_state except
1139 * #ESPLUSPLAYER_STATE_NONE.
1143 * @remark If no display is set, no operation is performed.
1144 * @see esplusplayer_open() \n
1145 * esplusplayer_set_video_roi()
1147 int esplusplayer_set_stretch_mode(esplusplayer_handle handle, int mode);
1150 * @brief Set the Crop Area(Region Of Src ratio) area of display.
1151 * @param [in] handle : esplusplayer handle.
1152 * @param [in] scale_x: x label ratio in src video area.
1153 * @param [in] scale_y: y label ratio in src video area.
1154 * @param [in] scale_w: width ratio in src video area.
1155 * @param [in] scale_h: height ratio in src video area.
1156 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1157 * esplusplayer_error_type
1158 * values will be returned.
1159 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1160 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1161 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1164 * esplusplayer_open(esplayer);
1165 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
1166 * esplusplayer_set_video_roi(esplayer,0,0,0.5,0.5);
1167 * // ... your codes ...
1168 * esplusplayer_close(esplayer);
1170 * @pre The player state can be all of #esplusplayer_state except
1171 * #ESPLUSPLAYER_STATE_NONE. \n
1174 * @remark The minimum value of input are 0,maximun value is 1.
1175 * @see esplusplayer_open() \n
1176 * esplusplayer_set_display() \n
1177 * esplusplayer_set_display_visible()
1179 int esplusplayer_set_video_roi(esplusplayer_handle handle, double scale_x,
1180 double scale_y, double scale_w, double scale_h);
1183 * @brief Resize the render rectangle(the max region that video can be
1185 * @param [in] handle : esplusplayer handle.
1186 * @param [in] x: x coordinate of render rectangle.
1187 * @param [in] y: y coordinate of render rectangle.
1188 * @param [in] width: width of render rectangle.
1189 * @param [in] height: height of render rectangle.
1190 * @return @c one of esplusplayer_error_type values will be returned.
1191 * @pre Should be called after esplusplayer_set_display() \n
1192 * esplusplayer_set_surface_display() \n
1193 * esplusplayer_set_ecore_display() \n
1194 * esplusplayer_set_display_ecore_subsurface
1198 * @remark The minimum value of width and height are 1.
1199 * @see esplusplayer_set_display() \n
1200 * esplusplayer_set_surface_display() \n
1201 * esplusplayer_set_ecore_display() \n
1202 * esplusplayer_set_display_ecore_subsurface
1204 int esplusplayer_resize_render_rect(esplusplayer_handle handle, int x, int y,
1205 int width, int height);
1208 * @brief Set the visibility of the video display.
1209 * @param [in] handle : esplusplayer handle.
1210 * @param [in] visible : the visibility of the display.
1211 * (@c true = visible, @c false = non-visible)
1212 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1213 * esplusplayer_error_type
1214 * values will be returned.
1215 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1216 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1217 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1220 * esplusplayer_open(esplayer);
1221 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
1222 * esplusplayer_set_display_visible(esplayer,false);
1223 * // ... your codes ...
1224 * esplusplayer_close(esplayer);
1226 * @pre The player state can be all of #esplusplayer_state except
1227 * #ESPLUSPLAYER_STATE_NONE.
1230 * @see esplusplayer_open() \n
1231 * esplusplayer_set_display()
1233 int esplusplayer_set_display_visible(esplusplayer_handle handle, bool visible);
1236 * @brief Set the rotate angle of the video display.
1237 * @param [in] handle : esplusplayer handle.
1238 * @param [in] rotation : the rotate angle of the display.
1239 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1240 * esplusplayer_error_type
1241 * values will be returned.
1242 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1243 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1244 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1247 * esplusplayer_open(esplayer);
1248 * esplusplayer_set_display(esplayer,ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,window);
1249 * esplusplayer_set_display_rotation(esplayer_,ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_90);
1250 * // ... your codes ...
1251 * esplusplayer_close(esplayer);
1253 * @pre The player state can be all of #esplusplayer_state except
1254 * #ESPLUSPLAYER_STATE_NONE.
1255 * @post this API worked only when video sink created.
1257 * @see esplusplayer_open() \n
1258 * esplusplayer_set_display()
1260 int esplusplayer_set_display_rotation(
1261 esplusplayer_handle handle, esplusplayer_display_rotation_type rotation);
1264 * @brief Get the rotate angle of the video display.
1265 * @param [in] handle : esplusplayer handle.
1266 * @param [out] rotation : the rotate angle of the display which want to
1268 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1269 * esplusplayer_error_type
1270 * values will be returned.
1271 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1272 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1273 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1276 * esplusplayer_open(esplayer);
1277 * esplusplayer_set_display_rotation(esplayer,ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_90);
1278 * esplusplayer_display_rotation_type rotation_get =
1279 * ESPLUSPLAYER_DISPLAY_ROTATION_TYPE_NONE;
1280 * // ... your codes ...
1281 * esplusplayer_get_display_rotation(esplayer,&rotation_get);
1282 * // ... your codes ...
1283 * esplusplayer_close(esplayer);
1285 * @pre The player state can be all of #esplusplayer_state except
1286 * #ESPLUSPLAYER_STATE_NONE.
1287 * @post this API worked only when video sink created.
1289 * @see esplusplayer_open() \n
1290 * esplusplayer_set_display_rotation()
1292 int esplusplayer_get_display_rotation(
1293 esplusplayer_handle handle, esplusplayer_display_rotation_type* rotation);
1296 * @deprecated Deprecated since API V2.0. Use
1297 * esplusplayer_set_submit_data_type() instead.
1298 * @brief Set whether to send decrypted es packets in the trust zone.
1299 * @param [in] handle : esplusplayer handle.
1300 * @param [in] using_tz : whether to use trust zone memory.
1301 * (@c true = if decrypted packets are sent in trust zone, @c false =
1303 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1304 * esplusplayer_error_type
1305 * values will be returned.
1306 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1307 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1308 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1311 * esplusplayer_open(esplayer);
1312 * esplusplayer_set_tz_use(esplayer, true);
1313 * // ... your codes ...
1314 * esplusplayer_close(esplayer);
1316 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1319 * @remark This API have to be called before calling
1320 * esplusplayer_prepare_async(). \n If using_tz is set to true, use
1321 * esplusplayer_submit_trust_zone_packet() to send decrypted packets.
1322 * @see esplusplayer_open() \n
1323 * esplusplayer_submit_trust_zone_packet()
1325 int esplusplayer_set_tz_use(esplusplayer_handle handle, bool using_tz);
1328 * @brief Set whether to send decrypted es packets in the trust zone or
1329 * encrypted es packets.
1330 * @param [in] handle : esplusplayer handle.
1331 * @param [in] type : whether to use trust zone memory or encrypted data
1332 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1333 * esplusplayer_error_type
1334 * values will be returned.
1335 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1336 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1337 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1340 * esplusplayer_open(esplayer);
1341 * esplusplayer_set_submit_data_type(esplayer,ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA);
1342 * // ... your codes ...
1343 * esplusplayer_close(esplayer);
1345 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
1348 * @remark This API have to be called before calling
1349 * esplusplayer_prepare_async(). \n
1350 * If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_CLEAN_DATA use
1351 * esplusplayer_submit_packet() to send clean packets. \n
1352 * If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_TRUSTZONE_DATA, use
1353 * esplusplayer_submit_trust_zone_packet() to send decrypted packets
1355 * If type is ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA, use
1356 * esplusplayer_submit_encrypted_packet() to send encrypted packets.
1357 * @see esplusplayer_open() \n
1358 * esplusplayer_submit_trust_zone_packet() \n
1359 * esplusplayer_submit_encrypted_packet() \n
1360 * esplusplayer_submit_data_type
1362 int esplusplayer_set_submit_data_type(esplusplayer_handle handle,
1363 esplusplayer_submit_data_type type);
1366 * @brief Set on mute of the audio sound.
1367 * @param [in] handle : esplusplayer handle.
1368 * @param [in] mute : on mute of the sound.
1369 * (@c true = mute, @c false = non-mute)
1370 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of
1371 * esplusplayer_error_type
1372 * values will be returned.
1373 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1374 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1375 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1378 * esplusplayer_open(esplayer);
1379 * esplusplayer_set_audio_mute(esplayer, true);
1380 * // ... your codes ...
1381 * esplusplayer_close(esplayer);
1383 * @pre The player state can be all of #esplusplayer_state except
1384 * #ESPLUSPLAYER_STATE_NONE.
1387 * @see esplusplayer_open()
1389 int esplusplayer_set_audio_mute(esplusplayer_handle handle, bool mute);
1392 * @brief Get current state of player.
1393 * @param [in] handle : esplusplayer handle.
1394 * @return current #esplusplayer_state of player.
1396 * esplusplayer_handle esplayer = esplusplayer_create();
1397 * // ... your codes ...
1398 * esplusplayer_state ret = esplusplayer_get_state(esplayer);
1399 * // ... your codes ...
1400 * esplusplayer_destroy(esplayer);
1406 esplusplayer_state esplusplayer_get_state(esplusplayer_handle handle);
1409 * @brief Submit es packet to decode audio or video.
1410 * @param [in] handle : esplusplayer handle.
1411 * @param [in] packet : es packet pointer.
1412 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1414 * otherwise @c : fail to submit es packet.
1416 * static void OnPrepareDone(bool ret, void* userdata) {
1417 * // ... your codes ...
1418 * printf ("OnPrepareDone\n");
1420 * static void OnReadyToPrepare(const esplusplayer_stream_type
1421 *type,void* userdata) {
1422 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
1423 * //Something you want to do when feed es video stream is
1426 * //Something you want to do when feed es audio stream is
1429 * //Something you want to do when OnReadyToPrepare
1430 * printf ("OnReadyToPrepare\n");
1432 * static void OnBufferByteStatus(const esplusplayer_stream_type
1434 * const esplusplayer_buffer_status
1436 * uint64_t byte_size, void* userdata)
1438 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
1439 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1440 * //Something you want to do when es video buffer is
1443 * //Something you want to do when es video buffer is not
1447 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1448 * //Something you want to do when es audio buffer is
1451 * //Something you want to do when es audio buffer is not
1455 * //Something you want to do when OnBufferByteStatus
1456 * printf ("OnBufferByteStatus\n");
1458 * static void OnBufferTimeStatus(const esplusplayer_stream_type
1460 * const esplusplayer_buffer_status
1462 * uint64_t time_size,void* userdata)
1464 * if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
1465 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1466 * //Something you want to do when es video buffer is
1469 * //Something you want to do when es video buffer is not
1473 * if (status == ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN) {
1474 * //Something you want to do when es audio buffer is
1477 * //Something you want to do when es audio buffer is not
1481 * //Something you want to do when OnBufferTimeStatus
1482 * printf ("OnBufferTimeStatus\n");
1484 * void FeedEsPacket(esplusplayer_handle
1485 *player,esplusplayer_es_packet pkt) {
1486 * // ... your codes ...
1487 * if(feed is allowed && buffer is enough) {
1488 * esplusplayer_submit_packet(player, &pkt);
1490 * // ... your codes ...
1492 * esplusplayer_handle esplayer = esplusplayer_create();
1493 * esplusplayer_set_prepare_async_done_cb(esplayer,OnPrepareDone,&esplayer);
1494 * esplusplayer_set_ready_to_prepare_cb(esplayer,OnReadyToPrepare,&esplayer);
1495 * esplusplayer_set_buffer_byte_status_cb(esplayer,OnBufferByteStatus,&esplayer);
1496 * esplusplayer_set_buffer_time_status_cb(esplayer,OnBufferTimeStatus,&esplayer);
1497 * esplusplayer_open(esplayer);
1498 * esplusplayer_prepare_async(esplayer);
1499 * // ... your codes ...
1500 * //FeedEsPacket()(call a new thread to do this)
1501 * // ... your codes ...
1502 * esplusplayer_close(esplayer);
1503 * esplusplayer_destroy(esplayer);
1505 * @pre User can submit es packets after
1506 * esplusplayer_ready_to_prepare_cb() or
1507 * esplusplayer_ready_to_seek_cb() is called.
1510 * @remark Amount of packets for at least one decoded frame must be submitted
1511 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1512 * for invoking esplusplayer_prepare_async_done_cb() or
1513 * esplusplayer_seek_done_cb() \n
1514 * This api must be called from a different thread than other apis.
1515 * @see esplusplayer_set_submit_data_type() \n
1516 * esplusplayer_es_packet \n
1517 * esplusplayer_buffer_status_cb() \n
1518 * esplusplayer_ready_to_prepare_cb() \n
1519 * esplusplayer_ready_to_seek_cb()
1521 esplusplayer_submit_status esplusplayer_submit_packet(
1522 esplusplayer_handle handle, esplusplayer_es_packet* packet);
1525 * @brief Submit es packet to decode audio or video.
1526 * @param [in] handle : esplusplayer handle.
1527 * @param [in] packet : es packet pointer.
1528 * @param [in] tz_handle : es decrypted tz handle.
1529 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1531 * otherwise @c : fail to submit es packet.
1533 * refer to the sample code of esplusplayer_submit_packet();
1535 * @pre User can submit es packets after
1536 * esplusplayer_ready_to_prepare_cb() or
1537 * esplusplayer_ready_to_seek_cb() is called.
1540 * @remark Amount of packets for at least one decoded frame must be submitted
1541 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1542 * for invoking esplusplayer_prepare_async_done_cb() or
1543 * esplusplayer_seek_done_cb(). \n
1544 * To use this api, Must set
1545 * ESPLUSPLAYER_SUBMIT_DATA_TYPE_TRUSTZONE_DATA using
1546 * esplusplayer_set_submit_data_type() \n This api must be called from a
1547 * different thread than other apis.
1548 * @see esplusplayer_es_packet \n
1549 * esplusplayer_buffer_status_cb() \n
1550 * esplusplayer_ready_to_prepare_cb() \n
1551 * esplusplayer_ready_to_seek_cb()
1553 esplusplayer_submit_status esplusplayer_submit_trust_zone_packet(
1554 esplusplayer_handle handle, esplusplayer_es_packet* packet,
1555 uint32_t tz_handle);
1558 * @brief Submit encrypted es packet to decode and decrypt audio or video.
1559 * @param [in] handle : esplusplayer handle.
1560 * @param [in] packet : es packet pointer.
1561 * @param [in] drm_info : information to decrypt es packet.
1562 * esplusplayer doesn't take ownership. user should
1563 * free it. if you deliver it as (null), this api
1564 * works as esplusplayer_submit_packet().
1565 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1567 * otherwise @c : fail to submit es packet.
1569 * refer to the sample code of esplusplayer_submit_packet();
1571 * @pre User can submit es packets after
1572 * esplusplayer_ready_to_prepare_cb() or
1573 * esplusplayer_ready_to_seek_cb() is called.
1576 * @remark Amount of packets for at least one decoded frame must be submitted
1577 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1578 * for invoking esplusplayer_prepare_async_done_cb() or
1579 * esplusplayer_seek_done_cb(). \n
1580 * To use this api, Must set
1581 * ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA using
1582 * esplusplayer_set_submit_data_type() \n This api must be called from a
1583 * different thread than other apis.
1584 * @see esplusplayer_es_packet \n
1585 * esplusplayer_drm_info_64bit \n
1586 * esplusplayer_buffer_status_cb() \n
1587 * esplusplayer_ready_to_prepare_cb() \n
1588 * esplusplayer_ready_to_seek_cb() \n
1589 * esplusplayer_submit_packet()
1592 esplusplayer_submit_status esplusplayer_submit_encrypted_packet_64bit(
1593 esplusplayer_handle handle, esplusplayer_es_packet* packet,
1594 esplusplayer_drm_info_64bit* drm_info);
1597 * @brief Submit encrypted es packet to decode and decrypt audio or video.
1598 * @param [in] handle : esplusplayer handle.
1599 * @param [in] packet : es packet pointer.
1600 * @param [in] drm_info : information to decrypt es packet.
1601 * esplusplayer doesn't take ownership. user should
1602 * free it. if you deliver it as (null), this api
1603 * works as esplusplayer_submit_packet().
1604 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit es
1606 * otherwise @c : fail to submit es packet.
1608 * refer to the sample code of esplusplayer_submit_packet();
1610 * @pre User can submit es packets after
1611 * esplusplayer_ready_to_prepare_cb() or
1612 * esplusplayer_ready_to_seek_cb() is called.
1615 * @remark Amount of packets for at least one decoded frame must be submitted
1616 * after calling esplusplayer_prepare_async() or esplusplayer_seek()
1617 * for invoking esplusplayer_prepare_async_done_cb() or
1618 * esplusplayer_seek_done_cb(). \n
1619 * To use this api, Must set
1620 * ESPLUSPLAYER_SUBMIT_DATA_TYPE_ENCRYPTED_DATA using
1621 * esplusplayer_set_submit_data_type() \n This api must be called from a
1622 * different thread than other apis.
1623 * @see esplusplayer_es_packet \n
1624 * esplusplayer_drm_info \n
1625 * esplusplayer_buffer_status_cb() \n
1626 * esplusplayer_ready_to_prepare_cb() \n
1627 * esplusplayer_ready_to_seek_cb() \n
1628 * esplusplayer_submit_packet()
1630 esplusplayer_submit_status esplusplayer_submit_encrypted_packet(
1631 esplusplayer_handle handle, esplusplayer_es_packet* packet,
1632 esplusplayer_drm_info* drm_info);
1635 * @brief Generate EOS(End Of Stream) packet explicitly and submit it to the
1637 * @param [in] handle : esplusplayer handle.
1638 * @param [in] type : stream type which reaches eos.
1639 * @return @c ESPLUSPLAYER_SUBMIT_STATUS_SUCCESS : succeed to submit EOS
1641 * otherwise @c : fail to submit EOS packet.
1643 * esplusplayer_handle esplayer = esplusplayer_create();
1644 * // ... your codes ...
1645 * esplusplayer_submit_eos_packet(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1646 * // ... your codes ...
1652 esplusplayer_submit_status esplusplayer_submit_eos_packet(
1653 esplusplayer_handle handle, esplusplayer_stream_type type);
1656 * @brief Set audio stream to have contents information.
1657 * @param [in] handle : esplusplayer handle.
1658 * @param [in] stream : audio stream pointer.
1659 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1660 * esplusplayer_error_type
1661 * values will be returned.
1662 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1663 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1664 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1667 * esplusplayer_open(esplayer);
1668 * esplusplayer_audio_stream_info audio_stream;
1669 * audio_stream.codec_data = nullptr;
1670 * audio_stream.codec_data_length = 0;
1671 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
1672 * // ... your codes ...
1673 * esplusplayer_close(esplayer);
1675 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1676 * audio stream is deactivated.
1679 * @remark This API have to be called before calling the
1680 * esplusplayer_prepare_async().
1681 * @see esplusplayer_open() \n
1682 * esplusplayer_audio_stream_info
1684 int esplusplayer_set_audio_stream_info(esplusplayer_handle handle,
1685 esplusplayer_audio_stream_info* stream);
1688 * @brief Set video stream to have contents information.
1689 * @param [in] handle : esplusplayer handle.
1690 * @param [in] stream : video stream pointer.
1691 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1692 * esplusplayer_error_type
1693 * values will be returned.
1694 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1695 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1696 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1698 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE except
1699 * video stream is deactivated.
1702 * @remark This API have to be called before calling the
1703 * esplusplayer_prepare_async().
1704 * @see esplusplayer_audio_stream_info
1705 * esplusplayer_activate
1707 int esplusplayer_set_video_stream_info(esplusplayer_handle handle,
1708 esplusplayer_video_stream_info* stream);
1711 * @brief Get the current playing time of the associated media.
1712 * @param [in] handle : esplusplayer handle.
1713 * @param [out] cur_time : current playing time default in milliseconds, can
1714 * be set by @esplusplayer_set_timeunit_type
1715 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1716 * esplusplayer_error_type
1717 * values will be returned.
1718 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1719 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1720 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1723 * prepare esplayer done
1724 * esplusplayer_start(esplayer);
1725 * // ... your codes ...
1726 * uint64_t cur_time = 0;
1727 * esplusplayer_get_playing_time(esplayer, &cur_time);
1728 * // ... your codes ...
1729 * esplusplayer_stop(esplayer);
1731 * @pre The player must be one of #ESPLUSPLAYER_STATE_PAUSE or
1732 * #ESPLUSPLAYER_STATE_PLAYING.
1735 * @see esplusplayer_prepare_async()
1737 int esplusplayer_get_playing_time(esplusplayer_handle handle,
1738 uint64_t* cur_time);
1740 * @brief Get dropped frame counts in videosink.
1741 * @param [in] handle : esplusplayer handle.
1742 * @param [out] padaptive_info : dropped frame counts.
1743 * @param [in] adaptive_type : type of adaptive info which APP want to get.
1744 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1745 * esplusplayer_error_type
1746 * values will be returned.
1747 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1748 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1749 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1752 * prepare esplayer done
1753 * // ... your codes ...
1754 * uint64_t count = 0;
1755 * esplusplayer_get_adaptive_info(esplayer,
1756 * static_cast<void*>(&count),ESPLUSPLAYER_ADAPT_INFO_TYPE_DROPPED_FRAMES);
1757 * // ... your codes ...
1758 * esplusplayer_stop(esplayer);
1760 * @pre The player must be one of #ESPLUSPLAYER_STATE_READY,
1761 * #ESPLUSPLAYER_STATE_PAUSE or #ESPLUSPLAYER_STATE_PLAYING.
1764 * @see esplusplayer_prepare_async()
1766 int esplusplayer_get_adaptive_info(
1767 esplusplayer_handle handle, void* padaptive_info,
1768 esplusplayer_adaptive_info_type adaptive_type);
1771 * @brief Set volume to player
1772 * @param [in] handle : esplusplayer handle.
1773 * @param [in] volume : volume level(0 ~ 100).
1774 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1775 * esplusplayer_error_type
1776 * values will be returned.
1777 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1778 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1779 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1782 * esplusplayer_open(esplayer);
1784 * esplusplayer_set_volume(esplayer, vol)
1785 * // ... your codes ...
1786 * esplusplayer_close(esplayer);
1788 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1791 * @see esplusplayer_open()
1793 int esplusplayer_set_volume(esplusplayer_handle handle, const int volume);
1796 * @brief Get volume from player
1797 * @param [in] handle : esplusplayer handle.
1798 * @param [out] volume : volume ptr.
1799 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1800 * esplusplayer_error_type
1801 * values will be returned.
1802 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1803 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1804 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1807 * esplusplayer_open(esplayer);
1808 * // ... your codes ...
1810 * esplusplayer_get_volume(esplayer, &vol)
1811 * // ... your codes ...
1812 * esplusplayer_close(esplayer);
1814 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1817 * @see esplusplayer_open()
1819 int esplusplayer_get_volume(esplusplayer_handle handle, int* volume);
1822 * @brief Set decoded video frame buffer type.
1823 * @param [in] handle : esplusplayer handle.
1824 * @param [in] type : one of the video decoded buffer type to set .
1825 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1826 esplusplayer_error_type
1827 * values will be returned.
1828 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1829 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1830 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1833 * esplusplayer_open(esplayer);
1834 * esplusplayer_set_video_frame_buffer_type(esplayer,
1835 * ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE);
1836 * // ... your codes ...
1837 * esplusplayer_close(esplayer);
1839 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE when type
1841 ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1842 The player state must be not #ESPLUSPLAYER_STATE_NONE when
1844 ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE
1847 * @remark reference can't support sw codec type.
1848 * esplusplayer_set_media_packet_video_decoded_cb()
1849 * esplusplayer_set_video_codec_type()
1850 * when type is SCALE, the target scale resolution can be set by
1851 * esplusplayer_set_video_frame_buffer_scale_resolution()
1852 * @see esplusplayer_open()
1854 int esplusplayer_set_video_frame_buffer_type(
1855 esplusplayer_handle handle,
1856 esplusplayer_decoded_video_frame_buffer_type type);
1859 * @brief Set the request frame rate of decoded video
1860 * @param [in] handle : esplusplayer handle.
1861 * @param [in] request_framerate : the request frame rate of returned
1862 * decoded video frame
1863 * The value of track_framerate(A) and request_framerate(B)
1864 * should be one of the following sets:
1865 * track_framerate indicate the frame rate of input video stream
1866 * 1.A/(A-B) = X ,X means drop 1 frame every X frame
1867 * 2.Special cases,such as 24000/1000 -> 15000/1000
1868 * when request_framerate.num = 0, return none decoded video
1870 * when request_framerate.num/request_framerate.den =
1871 * track_framerate.num/track_framerate.den, return all decoded
1873 * when request_framerate.num/request_framerate.den <
1874 * track_framerate.num/track_framerate.den, drop some decoded
1876 * @return @c one of esplusplayer_error_type values will be returned.
1877 * @pre The player state must be not #ESPLUSPLAYER_STATE_NONE.
1881 * @remark only works when decoded video frame buffer type is scale
1882 * esplusplayer_set_video_frame_buffer_type()
1883 * esplusplayer_set_media_packet_video_decoded_cb()
1885 int esplusplayer_set_decoded_video_frame_rate(
1886 esplusplayer_handle handle, esplusplayer_rational request_framerate);
1889 * @brief Set the target scale resolution when decoded video frame buffer
1891 * @param [in] handle : esplusplayer handle.
1892 * @param [in] target_width : scale target width of video frame buffer.
1893 * @param [in] target_width : scale target height of video frame buffer.
1894 * @return @c one of esplusplayer_error_type values will be returned.
1895 * @pre The player state can be set in all states except
1896 * #ESPLUSPLAYER_STATE_NONE.
1900 * @remark esplusplayer_set_video_frame_buffer_type()
1901 * esplusplayer_set_media_packet_video_decoded_cb()
1902 * If user don't call this api to set target_width and target_height,
1904 * target scale resolution is 960x540
1906 int esplusplayer_set_video_frame_buffer_scale_resolution(
1907 esplusplayer_handle handle, uint32_t target_width, uint32_t target_height);
1910 * @brief Flush buffers for a player.
1911 * @param [in] handle : esplusplayer handle ptr.
1912 * @param [in] type : choose which stream data need to be
1913 * flush,audio/video,if need flush all pipeline can call this API
1915 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1916 * esplusplayer_error_type
1917 * values will be returned.
1918 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1919 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1920 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1923 * prepare esplayer done
1924 * // ... your codes ...
1925 * esplusplayer_flush(esplayer, ESPLUSPLAYER_STREAM_TYPE_VIDEO);
1926 * // ... your codes ...
1927 * esplusplayer_stop(esplayer);
1929 * @pre The player state should greater than #ESPLUSPLAYER_STATE_IDLE
1932 * @see esplusplayer_prepare_async()
1934 int esplusplayer_flush(esplusplayer_handle handle,
1935 esplusplayer_stream_type type);
1938 * @brief Convert the esplusplayer error type to a string.
1939 * @param [in] type : esplusplayer error type
1940 * @return @c not nullptr the converted error string otherwise @c failed to
1941 * convert the error.
1943 * // ... your codes ...
1944 * const char* error;
1946 * esplusplayer_get_error_string(ESPLUSPLAYER_ERROR_TYPE_NOT_SUPPORTED_FILE);
1947 * // ... your codes ...
1953 const char* esplusplayer_get_error_string(esplusplayer_error_type type);
1956 * @brief Sets a callback function to be invoked when an error occurs.
1957 * @param [in] handle : esplusplayer handle.
1958 * @param [in] error_cb : the error callback function to register.
1959 * @param [in] userdata : userdata of esplusplayer_error_cb()
1960 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1961 * esplusplayer_error_type
1962 * values will be returned.
1963 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
1964 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1965 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
1968 * static void OnError(const esplusplayer_error_type err_code, void*
1970 * //Something you want to do when error occur
1971 * printf ("OnError\n");
1973 * esplusplayer_handle esplayer = esplusplayer_create();
1974 * esplusplayer_set_error_cb(esplayer, OnError, nullptr);
1975 * // ... your codes ...
1976 * esplusplayer_destroy(esplayer);
1978 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
1979 * or #ESPLUSPLAYER_STATE_IDLE.
1980 * @post esplusplayer_error_cb() will be invoked.
1982 * @remark esplusplayer_error_cb()
1983 * if error_cb is set to null, esplusplayer_error_cb() will not be
1986 int esplusplayer_set_error_cb(esplusplayer_handle handle,
1987 esplusplayer_error_cb error_cb, void* userdata);
1990 * @brief Set a callback function to be invoked when buffer underrun or
1991 * overflow is occurred.
1992 * @param [in] handle : esplusplayer handle.
1993 * @param [in] buffer_status_cb : the buffer status callback function to
1995 * @param [in] userdata : userdata of esplusplayer_buffer_status_cb()
1996 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1997 * esplusplayer_error_type
1998 * values will be returned.
1999 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2000 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2001 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2004 * refer to the sample code of esplusplayer_set_error_cb();
2006 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2007 * or #ESPLUSPLAYER_STATE_IDLE.
2008 * @post esplusplayer_buffer_status_cb() will be invoked.
2010 * @remark esplusplayer_buffer_status_cb()
2011 * if buffer_status_cb is set to null,
2012 * esplusplayer_buffer_status_cb() will not be invoked anymore.
2014 int esplusplayer_set_buffer_status_cb(
2015 esplusplayer_handle handle, esplusplayer_buffer_status_cb buffer_status_cb,
2019 * @brief Set a callback function to be invoked when buffer underrun or
2020 * overflow is occurred and buffer size in byte will be passed.
2021 * @param [in] handle : esplusplayer handle.
2022 * @param [in] buffer_status_cb : the buffer byte status callback function
2024 * @param [in] userdata : userdata of esplusplayer_buffer_byte_status_cb()
2025 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2026 * esplusplayer_error_type
2027 * values will be returned.
2028 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2029 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2030 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2033 * refer to the sample code of esplusplayer_submit_packet();
2035 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2036 * or #ESPLUSPLAYER_STATE_IDLE.
2037 * @post esplusplayer_buffer_byte_status_cb() will be invoked.
2039 * @remark esplusplayer_buffer_byte_status_cb()
2041 int esplusplayer_set_buffer_byte_status_cb(
2042 esplusplayer_handle handle,
2043 esplusplayer_buffer_byte_status_cb buffer_status_cb, void* userdata);
2046 * @brief Set a callback function to be invoked when buffer underrun or
2047 * overflow is occurred and buffer size in time will be passed.
2048 * @param [in] handle : esplusplayer handle.
2049 * @param [in] buffer_status_cb : the buffer time status callback function
2051 * @param [in] userdata : userdata of esplusplayer_buffer_time_status_cb()
2052 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2053 esplusplayer_error_type
2054 * values will be returned.
2055 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2056 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2057 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2060 refer to the sample code of esplusplayer_submit_packet();
2062 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2063 * or #ESPLUSPLAYER_STATE_IDLE.
2064 * @post esplusplayer_buffer_time_status_cb() will be invoked.
2066 * @remark esplusplayer_buffer_time_status_cb(),
2067 * esplusplayer_buffer_time_status_cb() will be invoked only
2068 * when the duration value of espacket is set.
2069 * if buffer_status_cb is set to null,
2070 * esplusplayer_buffer_time_status_cb() will not be invoked anymore.
2072 int esplusplayer_set_buffer_time_status_cb(
2073 esplusplayer_handle handle,
2074 esplusplayer_buffer_time_status_cb buffer_status_cb, void* userdata);
2077 * @brief Set a callback function to be invoked when video latency status
2079 * @param [in] handle : esplusplayer handle.
2080 * @param [in] video_latency_status_cb : the video latency status callback
2081 * function to register.
2082 * @param [in] userdata : userdata of
2083 * esplusplayer_set_video_latency_status_cb()
2084 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2085 * esplusplayer_error_type
2086 * values will be returned.
2087 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2088 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2089 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2092 * refer to the sample code of esplusplayer_set_error_cb();
2094 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2095 * or #ESPLUSPLAYER_STATE_IDLE.
2096 * @post esplusplayer_video_latency_status_cb() will be invoked.
2099 * @remark esplusplayer_video_latency_status_cb() will be invoked only
2100 * when mid / high latency threshold is set.
2102 int esplusplayer_set_video_latency_status_cb(
2103 esplusplayer_handle handle,
2104 esplusplayer_video_latency_status_cb video_latency_status_cb,
2108 * @brief Set a callback function to be invoked when audio latency status
2110 * @param [in] handle : esplusplayer handle.
2111 * @param [in] audio_latency_status_cb : the audio latency status callback
2112 * function to register.
2113 * @param [in] userdata : userdata of
2114 * esplusplayer_set_audio_latency_status_cb()
2115 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2116 * esplusplayer_error_type
2117 * values will be returned.
2118 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2119 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2120 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2123 * refer to the sample code of esplusplayer_set_error_cb();
2125 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2126 * or #ESPLUSPLAYER_STATE_IDLE.
2127 * @post esplusplayer_audio_latency_status_cb() will be invoked.
2130 * @remark esplusplayer_audio_latency_status_cb() will be invoked only
2131 * when mid / high latency threshold is set.
2133 int esplusplayer_set_audio_latency_status_cb(
2134 esplusplayer_handle handle,
2135 esplusplayer_audio_latency_status_cb audio_latency_status_cb,
2139 * @brief Set buffer size with different option
2140 * @param [in] handle : esplusplayer handle.
2141 * @param [in] option : the option of buffer size.
2142 * @param [in] size : size of selected buffer option.
2143 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2144 * esplusplayer_error_type
2145 * values will be returned.
2146 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2147 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2148 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2151 * esplusplayer_open(esplayer);
2152 * esplusplayer_set_buffer_size(esplayer,ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE,10240)
2153 * // ... your codes ...
2154 * esplusplayer_close(esplayer);
2156 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2157 * When the stream is deactivated, it can be set in
2158 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
2159 * #ESPLUSPLAYER_STATE_PLAYING. The changed buffer size will be
2160 * applied when esplusplayer_activate() is called.
2163 * @remark esplusplayer_buffer_option
2164 * @see esplusplayer_open() \n
2165 * esplusplayer_deactivate() \n
2166 * esplusplayer_activate()
2168 int esplusplayer_set_buffer_size(esplusplayer_handle handle,
2169 esplusplayer_buffer_option option,
2172 * @brief Set a callback function to be invoked when resource confliction is
2174 * @param [in] handle : esplusplayer handle.
2175 * @param [in] resource_conflicted_cb : the resource conflicted callback
2176 * function to register.
2177 * @param [in] userdata : userdata of resource_conflicted_cb()
2178 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2179 * esplusplayer_error_type
2180 * values will be returned.
2181 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2182 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2183 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2186 * refer to the sample code of esplusplayer_set_error_cb();
2188 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2189 * or #ESPLUSPLAYER_STATE_IDLE.
2190 * @post esplusplayer_resource_conflicted_cb() will be invoked.
2192 * @remark esplusplayer_resource_conflicted_cb()
2193 * if resource_conflicted_cb is set to null,
2194 * esplusplayer_resource_conflicted_cb() will not be invoked
2197 int esplusplayer_set_resource_conflicted_cb(
2198 esplusplayer_handle handle,
2199 esplusplayer_resource_conflicted_cb resource_conflicted_cb, void* userdata);
2202 * @brief Set a callback function to be invoked when player has reached the
2204 * @param [in] handle : esplusplayer handle.
2205 * @param [in] eos_cb : the eos callback function to register.
2206 * @param [in] userdata : userdata of esplusplayer_eos_cb()
2207 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2208 * esplusplayer_error_type
2209 * values will be returned.
2210 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2211 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2212 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2215 * refer to the sample code of esplusplayer_set_error_cb();
2217 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2218 * or #ESPLUSPLAYER_STATE_IDLE.
2219 * @post esplusplayer_eos_cb() will be invoked.
2221 * @remark esplusplayer_eos_cb()
2222 * if eos_cb is set to null, esplusplayer_eos_cb() will not be
2225 int esplusplayer_set_eos_cb(esplusplayer_handle handle,
2226 esplusplayer_eos_cb eos_cb, void* userdata);
2229 * @brief Set a callback function to be invoked when player is prepared to
2230 * receive es packets after calling esplusplayer_prepare_async().
2231 * @param [in] handle : esplusplayer handle.
2232 * @param [in] ready_to_prepare_cb : the ready to prepare callback function
2234 * @param [in] userdata : userdata of ready_to_prepare_cb()
2235 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2236 * esplusplayer_error_type
2237 * values will be returned.
2238 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2239 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2240 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2243 * refer to the sample code of esplusplayer_submit_packet();
2245 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2246 * or #ESPLUSPLAYER_STATE_IDLE.
2249 * @remark esplusplayer_prepare_async()
2250 * if ready_to_prepare_cb is set to null,
2251 * esplusplayer_ready_to_prepare_cb() will not be invoked anymore.
2253 int esplusplayer_set_ready_to_prepare_cb(
2254 esplusplayer_handle handle,
2255 esplusplayer_ready_to_prepare_cb ready_to_prepare_cb, void* userdata);
2258 * @brief Set a callback function to be invoked when player is prepared to
2260 * @param [in] handle : esplusplayer handle.
2261 * @param [in] prepare_async_done_cb : the repare async done callback
2262 * function to register.
2263 * @param [in] userdata : userdata of prepare_async_done_cb()
2264 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2265 * esplusplayer_error_type
2266 * values will be returned.
2267 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2268 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2269 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2272 * refer to the sample code of plusplayer_prepare_async();
2274 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2275 * or #ESPLUSPLAYER_STATE_IDLE.
2276 * @post esplusplayer_prepare_async_done_cb() will be invoked.
2277 * @exception It is prohibited to call any player APIs at
2278 * esplusplayer_prepare_async_done_cb callback.
2279 * @remark esplusplayer_prepare_async_done_cb()
2280 * if prepare_async_done_cb is set to null,
2281 * esplusplayer_prepare_async_done_cb() will not be
2283 * @see plusplayer_prepare_async
2285 int esplusplayer_set_prepare_async_done_cb(
2286 esplusplayer_handle handle,
2287 esplusplayer_prepare_async_done_cb prepare_async_done_cb, void* userdata);
2290 * @brief Set a callback function to be invoked when player is prepared to
2292 * @param [in] handle : esplusplayer handle.
2293 * @param [in] seek_done_cb : the seek done callback function to register.
2294 * @param [in] userdata : userdata of esplusplayer_seek_done_cb()
2295 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2296 * esplusplayer_error_type
2297 * values will be returned.
2298 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2299 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2300 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2303 * refer to the sample code of esplusplayer_set_error_cb();
2305 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2306 * or #ESPLUSPLAYER_STATE_IDLE.
2307 * @post esplusplayer_seek_done_cb() will be invoked.
2308 * if seek_done_cb is set to null, esplusplayer_seek_done_cb() will
2309 * not be invoked anymore.
2312 int esplusplayer_set_seek_done_cb(esplusplayer_handle handle,
2313 esplusplayer_seek_done_cb seek_done_cb,
2317 * @brief Set a callback function to be invoked when player is prepared to
2318 * receive es packets after flushing all submitted es packets for
2320 * @param [in] handle : esplusplayer handle.
2321 * @param [in] ready_to_seek_cb : the ready to seek callback function to
2323 * @param [in] userdata : userdata of esplusplayer_ready_to_seek_cb()
2324 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2325 * esplusplayer_error_type
2326 * values will be returned.
2327 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2328 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2329 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2332 * refer to the sample code of esplusplayer_set_error_cb();
2334 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2335 * or #ESPLUSPLAYER_STATE_IDLE.
2338 * @remark esplusplayer_seek()
2339 * if ready_to_seek_cb is set to null,
2340 * esplusplayer_ready_to_seek_cb()
2341 * will not be invoked anymore.
2343 int esplusplayer_set_ready_to_seek_cb(
2344 esplusplayer_handle handle, esplusplayer_ready_to_seek_cb ready_to_seek_cb,
2348 * @brief Set a callback function to be invoked when player decoded video
2349 * frame. A video frame can be retrieved using a registered callback.
2350 * @param [in] handle : esplusplayer handle.
2351 * @param [in] media_packet_video_decoded_cb : the media packet video
2352 * decoded callback function to register.
2353 * @param [in] userdata : userdata of
2354 * esplusplayer_set_media_packet_video_decoded_cb()
2355 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2356 * esplusplayer_error_type
2357 * values will be returned.
2358 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2359 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2360 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2363 * refer to the sample code of esplusplayer_set_error_cb();
2365 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2366 * or #ESPLUSPLAYER_STATE_IDLE.
2369 * @remark esplusplayer_set_video_frame_buffer_type()
2370 * if media_packet_video_decoded_cb is set to null,
2371 * esplusplayer_error_cb() will not be invoked anymore.
2372 * media packets have to be released by calling
2373 * esplusplayer_decoded_buffer_destroy().
2374 * @see esplusplayer_set_video_frame_buffer_scale_resolution
2376 int esplusplayer_set_media_packet_video_decoded_cb(
2377 esplusplayer_handle handle,
2378 esplusplayer_media_packet_video_decoded_cb media_packet_video_decoded_cb,
2382 * @brief Set closed caption callback function.
2383 * @description In this function set closed caption callback to handle the
2384 * closed caption. If there is closed caption to display,
2385 * esplusplayer_closed_caption_cb will be called to notify there
2386 * is closed caption to display.
2387 * @param [in] handle : esplusplayer handle ptr.
2388 * @param [in] closed_caption_cb : the closed caption callback function to
2390 * @param [in] userdata : userdata of esplusplayer_closed_caption_cb
2391 * callback function.
2392 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2393 * esplusplayer_error_type
2394 * values will be returned.
2395 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2396 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2397 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2400 * refer to the sample code of esplusplayer_set_error_cb();
2402 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2403 * or #ESPLUSPLAYER_STATE_IDLE.
2404 * @post When there is closed caption data, call
2405 * esplusplayer_closed_caption_cb to nofity that there is closed
2406 * caption needed to be displayed.
2408 * @remark esplusplayer_closed_caption_cb \n
2409 * [in] data : closed caption data \n
2410 * [in] size : length of closed caption data \n
2411 * [in] userdata : userdata of esplusplayer_closed_caption_cb
2412 * callback function.
2413 * if closed_caption_cb is set to null,
2414 * esplusplayer_closed_caption_cb()
2415 * will not be invoked anymore.
2417 int esplusplayer_set_closed_caption_cb(
2418 esplusplayer_handle handle,
2419 esplusplayer_closed_caption_cb closed_caption_cb, void* userdata);
2422 * @brief Set a callback function to be invoked when player is flush
2424 * @param [in] handle : esplusplayer handle.
2425 * @param [in] flush_done_cb : the flush done callback function to register.
2426 * @param [in] userdata : userdata of esplusplayer_flush_done_cb()
2427 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2428 * esplusplayer_error_type
2429 * values will be returned.
2430 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2431 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2432 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2435 * refer to the sample code of esplusplayer_set_error_cb();
2437 * @pre This api should be called before esplusplayer_flush() is called
2438 * @post esplusplayer_flush_done_cb() will be invoked.
2440 * @remark called before esplusplayer_flush().
2441 * if flush_done_cb is set to null, esplusplayer_error_cb() will
2442 * not be invoked anymore.
2444 int esplusplayer_set_flush_done_cb(esplusplayer_handle handle,
2445 esplusplayer_flush_done_cb flush_done_cb,
2448 * @brief Set a callback function to be invoked when a specific event
2450 * @param [in] handle : esplusplayer handle.
2451 * @param [in] event_cb : the callback function to register.
2452 * @param [in] userdata : userdata of esplusplayer_event_cb()
2453 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2454 * esplusplayer_error_type
2455 * values will be returned.
2456 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2457 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2458 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2461 * refer to the sample code of esplusplayer_set_error_cb();
2463 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
2464 * or #ESPLUSPLAYER_STATE_IDLE.
2465 * @post esplusplayer_event_cb() will be invoked.
2467 * @remark esplusplayer_set_event_cb()
2468 * if event_cb is set to null, esplusplayer_event_cb() will not be
2471 int esplusplayer_set_event_cb(esplusplayer_handle handle,
2472 esplusplayer_event_cb event_cb, void* userdata);
2474 * @brief Provided api for destroying decoded buffer.
2475 * @param [in] handle : esplusplayer handle.
2476 * @param [in] packet : the decoded buffer.
2477 * @return @c one of esplusplayer_error_type values will be returned.
2478 * @pre The player state can be greater than #ESPLUSPLAYER_STATE_IDLE.
2479 * @post esplusplayer_decoded_buffer_destroy will be invoked for video
2482 * @remark esplusplayer_decoded_buffer_destroy().
2484 int esplusplayer_decoded_buffer_destroy(
2485 esplusplayer_handle handle, esplusplayer_decoded_video_packet* packet);
2488 * @brief Provided api for setting low latency mode, multiple modes can be
2490 * @param [in] handle : esplusplayer handle.
2491 * @param [in] mode : one of the low latency mode to set.
2492 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2493 * esplusplayer_error_type
2494 * values will be returned.
2495 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2496 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2497 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2500 * esplusplayer_open(esplayer);
2501 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
2502 * // ... your codes ...
2503 * esplusplayer_close(esplayer);
2505 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2508 * @remark esplusplayer_set_low_latency_mode().
2509 * if set ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC:
2510 * 1, esplusplayer_buffer_status_cb/
2511 * esplusplayer_buffer_byte_status_cb/
2512 * esplusplayer_buffer_time_status_cb/
2513 * esplusplayer_ready_to_prepare_cb/
2514 * esplusplayer_ready_to_seek_cb/esplusplayer_seek_done_cb
2515 * callbacks are not invoked
2516 * 2, If es packets are sent after esplusplayer_start() is called,
2517 * it will be played immediately.
2518 * @see esplusplayer_open()
2520 int esplusplayer_set_low_latency_mode(esplusplayer_handle handle,
2521 esplusplayer_low_latency_mode mode);
2524 * @brief Provided api for enabling video frame peek mode
2525 * @param [in] handle : esplusplayer handle.
2526 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2527 * esplusplayer_error_type
2528 * values will be returned.
2529 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2530 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2531 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2534 * esplusplayer_open(esplayer);
2535 * esplusplayer_set_video_frame_peek_mode(esplayer);
2536 * // ... your codes ...
2537 * esplusplayer_close(esplayer);
2539 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2542 * @see esplusplayer_open() \n
2543 * esplusplayer_render_video_frame().
2545 int esplusplayer_set_video_frame_peek_mode(esplusplayer_handle handle);
2548 * @brief Provided api for rendering a video frame which is holded by video
2550 * @param [in] handle : esplusplayer handle.
2551 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2552 * esplusplayer_error_type
2553 * values will be returned.
2554 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2555 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2556 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2559 * prepare esplayer done
2560 * // ... your codes ...
2561 * esplusplayer_render_video_frame(esplayer);
2562 * // ... your codes ...
2563 * esplusplayer_stop(esplayer);
2565 * @pre In order to use this api,
2566 * The player state must be one of #ESPLUSPLAYER_STATE_READY or
2567 * #ESPLUSPLAYER_STATE_PAUSED after esplusplayer_seek_done_cb or
2568 * esplusplayer_prepare_async_done_cb is called \n
2571 * @see esplusplayer_set_video_frame_peek_mode() \n
2572 * esplusplayer_prepare_async()
2574 int esplusplayer_render_video_frame(esplusplayer_handle handle);
2577 * @brief Provided api for setting unlimited max buffer mode, the player
2578 * does not limit es packet transmission although in buffer overrun
2580 * @param [in] handle : esplusplayer handle.
2581 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2582 * esplusplayer_error_type
2583 * values will be returned.
2584 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2585 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2586 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2589 * esplusplayer_open(esplayer);
2590 * esplusplayer_set_unlimited_max_buffer_mode(esplayer);
2591 * // ... your codes ...
2592 * esplusplayer_close(esplayer);
2594 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2597 * @remark esplusplayer_set_unlimited_max_buffer_mode().
2598 * esplusplayer_buffer_status_cb() will be invoked in
2599 * overrun/underrun buffer status. but
2600 * esplusplayer_submit_packet()/esplusplayer_submit_trust_zone_packet()
2601 * /esplusplayer_submit_encrypted_packet()
2602 * does not return ESPLUSPLAYER_SUBMIT_STATUS_FULL
2603 * @see esplusplayer_open() \n
2604 * esplusplayer_submit_packet() \n
2605 * esplusplayer_submit_trust_zone_packet() \n
2606 * esplusplayer_submit_encrypted_packet()
2608 int esplusplayer_set_unlimited_max_buffer_mode(esplusplayer_handle handle);
2610 * @brief Provided api to deliver fmm signal and getting fmm auto status.
2611 * The player just delivers fmm signal to system. It doesn't
2613 * activating fmm mode. System refers to fmm signal when it decides
2616 * @param [in] handle : esplusplayer handle.
2617 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE fmm auto mode on
2618 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION fmm auto mode off
2619 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_STATE Internal operation failed
2621 * esplusplayer_open(esplayer);
2622 * esplusplayer_set_fmm_mode(esplayer);
2623 * // ... your codes ...
2624 * esplusplayer_close(esplayer);
2626 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
2627 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
2628 * or #ESPLUSPLAYER_STATE_PAUSED
2631 * @see esplusplayer_open()
2633 int esplusplayer_set_fmm_mode(esplusplayer_handle handle);
2635 * @brief Provided api for setting audio codec type for playback.
2636 * @param [in] handle : esplusplayer handle.
2637 * @param [in] type : codec type(hardware/software).
2638 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2639 esplusplayer_error_type
2640 * values will be returned.
2641 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2642 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2643 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2646 * esplusplayer_open(esplayer);
2647 * esplusplayer_set_audio_codec_type(esplayer,ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW);
2648 * // ... your codes ...
2649 * esplusplayer_close(esplayer);
2651 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2652 When the audio stream is not set or deactivated, it can be set
2653 in #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
2654 #ESPLUSPLAYER_STATE_PLAYING. The set codec type will be
2655 applied when esplusplayer_activate() is called.
2658 * @see esplusplayer_open() \n
2659 * esplusplayer_deactivate() \n
2660 esplusplayer_activate() \n
2661 esplusplayer_set_audio_stream_info()
2663 int esplusplayer_set_audio_codec_type(esplusplayer_handle handle,
2664 esplusplayer_audio_codec_type type);
2666 * @brief Provided api for setting video codec type for playback.
2667 * @param [in] handle : esplusplayer handle.
2668 * @param [in] type : codec type(hardware/software).
2669 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2670 esplusplayer_error_type
2671 * values will be returned.
2672 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2673 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2674 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2677 * esplusplayer_open(esplayer);
2678 * esplusplayer_set_video_codec_type(esplayer,ESPLUSPLAYER_VIDEO_CODEC_TYPE_SW);
2679 * // ... your codes ...
2680 * esplusplayer_close(esplayer);
2682 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2683 When the video stream is not set or deactivated, it can be set
2684 in #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PAUSED and
2685 #ESPLUSPLAYER_STATE_PLAYING. The set codec type will be
2686 applied when esplusplayer_activate() is called.
2689 * @see esplusplayer_open() \n
2690 * esplusplayer_deactivate() \n
2691 esplusplayer_activate() \n
2692 esplusplayer_set_video_stream_info()
2694 int esplusplayer_set_video_codec_type(esplusplayer_handle handle,
2695 esplusplayer_video_codec_type type);
2697 * @brief Provided api for setting alternative video resource(sub decoder
2699 * @param [in] handle : esplusplayer handle ptr.
2700 * @param [in] rsc_type : set alternative video resource
2701 * (@c 0 [defualt] = set all video resources(decoder/scaler) to main
2703 * @c 1 = set all video resources(decoder/scaler) to sub resources,
2704 * @c 2 = set only decoder to sub resource,
2705 * @c 3 = set only scaler to sub resource)
2706 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2707 * esplusplayer_error_type
2708 * values will be returned.
2709 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2710 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2711 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2714 * esplusplayer_open(esplayer);
2715 * esplusplayer_set_alternative_video_resource(esplayer,1);
2716 * // ... your codes ...
2717 * esplusplayer_close(esplayer);
2719 * @pre The player state can be all of #State except
2720 * #ESPLUSPLAYER_STATE_NONE.
2723 * @remark if app has set not default resource allocate policy via
2724 * esplusplayer_set_resource_allocate_policy(), this api will return
2727 * @see esplusplayer_open()
2729 int esplusplayer_set_alternative_video_resource(esplusplayer_handle handle,
2730 unsigned int rsc_type);
2732 * @brief Provided api for setting alternative audio resource(sub decoder
2733 * and simple mix audio out)
2734 * @param [in] handle : esplusplayer handle ptr.
2735 * @param [in] rsc_type : set alternative audio resource type
2736 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2737 * esplusplayer_error_type
2738 * values will be returned.
2739 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2740 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2741 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2744 * esplusplayer_open(esplayer);
2745 * esplusplayer_set_audio_codec_type(esplayer,
2746 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW)
2747 * esplusplayer_set_alternative_audio_resource(esplayer,
2748 * ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT);
2749 * // ... your codes ...
2750 * esplusplayer_close(esplayer);
2752 * prepare esplayer done
2753 * // ... your codes ...
2754 * esplusplayer_deactivate(esplayer, ESPLUSPLAYER_STREAM_TYPE_AUDIO)
2755 * esplusplayer_set_audio_codec_type(esplayer,
2756 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW)
2757 * esplusplayer_set_alternative_audio_resource(esplayer,
2758 * ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT);
2759 * esplusplayer_activate(esplayer, ESPLUSPLAYER_STREAM_TYPE_AUDIO)
2760 * // ... your codes ...
2761 * esplusplayer_close(esplayer);
2763 * @pre The player state can be all of #State except
2764 * #ESPLUSPLAYER_STATE_NONE.
2767 * @remark Simple out is no sound effect. Simple mix out sound is mixed with
2768 * main sound and output
2769 * through only main speaker. Simple mix out output format is
2770 * fixed(eg. 48kh, 2ch).
2771 * If you use simple mix out resource, audio decoder should be S/W
2774 * @see esplusplayer_open() \n
2775 * esplusplayer_set_audio_codec_type()
2777 int esplusplayer_set_alternative_audio_resource(
2778 esplusplayer_handle handle, esplusplayer_audio_resource_type rsc_type);
2780 * @brief Provided api for switching audio stream between the different
2781 * audio codec types on the fly
2782 * @param [in] handle : esplusplayer handle ptr.
2783 * @param [in] stream : audio stream pointer
2784 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2785 * esplusplayer_error_type
2786 * values will be returned.
2787 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2788 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2789 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2792 * prepare esplayer done
2793 * // ... your codes ...
2794 * esplusplayer_audio_stream_info audio_stream;
2795 * audio_stream.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_AC3;
2796 * audio_stream.sample_rate = 48000;
2797 * audio_stream.channels = 2;
2798 * esplusplayer_switch_audio_stream_onthefly(esplayer,
2800 * // ... your codes ...
2801 * esplusplayer_close(esplayer);
2803 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY,
2804 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING
2807 * @remark Audio codec can be switched between only
2808 * #ESPLUSPLAYER_AUDIO_MIME_TYPE_AAC,
2809 * #ESPLUSPLAYER_AUDIO_MIME_TYPE_EAC3
2810 * and #ESPLUSPLAYER_AUDIO_MIME_TYPE_AC3.
2811 * if other codec is set, this api will return false.
2813 * @see esplusplayer_prepare_async()
2815 int esplusplayer_switch_audio_stream_onthefly(
2816 esplusplayer_handle handle, esplusplayer_audio_stream_info* stream);
2818 * @brief Provided api for setting aifilter
2819 * @param [in] handle : esplusplayer handle ptr.
2820 * @param [in] aifilter : aifilter plugin.
2821 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2822 * esplusplayer_error_type
2823 * values will be returned.
2824 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2825 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2826 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2829 * esplusplayer_open(esplayer);
2830 * GstElement* aifilter_ =
2831 * gst_element_factory_make("aifilter_autozoom","auto_zoom");
2832 * g_object_set(G_OBJECT(aifilter_), "az_cb_out_fps", 30, NULL);
2833 * g_object_set(G_OBJECT(aifilter_), "az_inference_fps", 2, NULL);
2834 * g_object_set(G_OBJECT(aifilter_), "az_disp_width", 1920, NULL);
2835 * g_object_set(G_OBJECT(aifilter_), "az_disp_height", 1080, NULL);
2836 * g_object_set(G_OBJECT(aifilter_), "az_detection_type", 2, NULL);
2837 * g_object_set(G_OBJECT(aifilter_), "az_scaler_type", 1, NULL);
2838 * g_object_set(G_OBJECT(aifilter_), "az_target_num", 2, NULL);
2839 * esplusplayer_set_aifilter(esplayer,aifilter_);
2840 * // ... your codes ...
2841 * esplusplayer_close(esplayer);
2843 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
2847 * @see esplusplayer_open()
2849 int esplusplayer_set_aifilter(esplusplayer_handle handle, void* aifilter);
2852 * @brief Provided api for setting render time offset
2853 * @param [in] handle : esplusplayer handle ptr.
2854 * @param [in] type : stream type
2855 * @param [in] offset : offset (default in milliseconds, can be set by
2856 * @esplusplayer_set_timeunit_type).
2857 * G_MININT64 <= offset * 1000000 <= G_MAXINT64
2858 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2859 * esplusplayer_error_type
2860 * values will be returned.
2861 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2862 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2863 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2866 * esplusplayer_open(esplayer);
2867 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_NONE);
2869 * // ... your codes ...
2870 * int64_t set_offset = 10;
2871 * esplusplayer_set_render_time_offset(esplayer,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
2873 * int64_t get_offset = 0;
2874 * esplusplayer_get_render_time_offset(esplayer_,ESPLUSPLAYER_STREAM_TYPE_VIDEO,
2876 * // ... your codes ...
2877 * esplusplayer_close(esplayer);
2879 * @pre The player state must be set to #ESPLUSPLAYER_STATE_READY,
2880 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
2881 * It have to be set to low latency mode. (all mode except
2882 * # ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC)
2883 * @remark esplusplayer_set_low_latency_mode().
2887 * @see esplusplayer_open()
2889 int esplusplayer_set_render_time_offset(esplusplayer_handle handle,
2890 esplusplayer_stream_type type,
2893 * @brief Provided api for getting render time offset
2894 * @param [in] handle : esplusplayer handle ptr.
2895 * @param [in] type : stream type
2896 * @param [in] offset : offset ptr (default in milliseconds, can be set by
2897 * @esplusplayer_set_timeunit_type).
2898 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2899 * esplusplayer_error_type
2900 * values will be returned.
2901 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2902 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2903 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2905 * @pre The player state must be set to #ESPLUSPLAYER_STATE_READY,
2906 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
2907 * It have to be set to low latency mode.
2908 * @remark esplusplayer_set_low_latency_mode().
2912 * see esplusplayer_set_render_time_offset
2914 int esplusplayer_get_render_time_offset(esplusplayer_handle handle,
2915 esplusplayer_stream_type type,
2918 * @brief Provided api for setting catch up speed level in low latency mode
2919 * @param [in] handle : esplusplayer handle.
2920 * @param [in] level : speed level to catch up
2921 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2922 * esplusplayer_error_type
2923 * values will be returned.
2924 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2925 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2926 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2929 * esplusplayer_open(esplayer);
2930 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO);
2931 * esplusplayer_set_catch_up_speed(esplayer,ESPLUSPLAYER_CATCH_UP_SPEED_MID);
2932 * // ... your codes ...
2933 * esplusplayer_close(esplayer);
2935 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
2936 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
2937 * or #ESPLUSPLAYER_STATE_PAUSED
2938 * esplusplayer_set_low_latency_mode() should be called as below
2939 * before this api is called.
2940 * esplusplayer_set_low_latency_mode(handle,
2941 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
2942 * esplusplayer_set_low_latency_mode(handle,
2943 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
2944 * esplusplayer_set_low_latency_mode(handle,
2945 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
2946 * esplusplayer_set_low_latency_mode(handle,
2947 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_VIDEO_QUALITY)
2951 * @see esplusplayer_open()
2953 int esplusplayer_set_catch_up_speed(esplusplayer_handle handle,
2954 esplusplayer_catch_up_speed level);
2957 * @brief Provided api for getting current video latency status
2958 * @param [in] handle : esplusplayer handle.
2959 * @param [out] status : current latency status
2960 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2961 * esplusplayer_error_type
2962 * values will be returned.
2963 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2964 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2965 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2968 * prepare esplayer done
2969 * // ... your codes ...
2970 * esplusplayer_latency_status current_status =
2971 * ESPLUSPLAYER_LATENCY_LOW;
2972 * esplusplayer_get_video_latency_status(esplayer, ¤t_status);
2973 * // ... your codes ...
2974 * esplusplayer_stop(esplayer);
2976 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY,
2977 * #ESPLUSPLAYER_STATE_PLAYING or #ESPLUSPLAYER_STATE_PAUSED
2981 * @see esplusplayer_prepare_async()
2983 int esplusplayer_get_video_latency_status(esplusplayer_handle handle,
2984 esplusplayer_latency_status* status);
2987 * @brief Provided api for getting current audio latency status
2988 * @param [in] handle : esplusplayer handle.
2989 * @param [out] status : current latency status
2990 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
2991 * esplusplayer_error_type
2992 * values will be returned.
2993 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
2994 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
2995 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
2998 * prepare esplayer done
2999 * // ... your codes ...
3000 * esplusplayer_latency_status current_status =
3001 * ESPLUSPLAYER_LATENCY_LOW;
3002 * esplusplayer_get_audio_latency_status(esplayer, ¤t_status);
3003 * // ... your codes ...
3004 * esplusplayer_stop(esplayer);
3006 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY,
3007 * #ESPLUSPLAYER_STATE_PLAYING or #ESPLUSPLAYER_STATE_PAUSED
3011 * @see esplusplayer_prepare_async()
3013 int esplusplayer_get_audio_latency_status(esplusplayer_handle handle,
3014 esplusplayer_latency_status* status);
3017 * @brief Provided api for setting video mid latency threshold for low
3020 * @param [in] handle : esplusplayer handle.
3021 * @param [in] threshold: the threshold(number) of the video frames for mid
3023 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3024 * esplusplayer_error_type
3025 * values will be returned.
3026 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3027 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3028 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3031 * esplusplayer_open(esplayer);
3032 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO);
3033 * esplusplayer_set_video_mid_latency_threshold(esplayer,2);
3034 * // ... your codes ...
3035 * esplusplayer_close(esplayer);
3037 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
3038 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
3039 * or #ESPLUSPLAYER_STATE_PAUSED
3040 * esplusplayer_set_low_latency_mode() should be called as below
3041 * before this api is called.
3042 * esplusplayer_set_low_latency_mode(handle,
3043 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
3044 * esplusplayer_set_low_latency_mode(handle,
3045 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
3046 * esplusplayer_set_low_latency_mode(handle,
3047 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
3048 * esplusplayer_set_low_latency_mode(handle,
3049 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE)
3053 * @see esplusplayer_open()
3055 /// TODO:: set the min/max value of the threshold
3056 int esplusplayer_set_video_mid_latency_threshold(esplusplayer_handle handle,
3057 const unsigned int threshold);
3060 * @brief Provided api for setting audio mid latency threshold for low
3063 * @param [in] handle : esplusplayer handle.
3064 * @param [in] threshold: the threshold(number) of the audio frames for mid
3066 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3067 * esplusplayer_error_type
3068 * values will be returned.
3069 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3070 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3071 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3074 * esplusplayer_open(esplayer);
3075 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO);
3076 * esplusplayer_set_audio_mid_latency_threshold(esplayer,2);
3077 * // ... your codes ...
3078 * esplusplayer_close(esplayer);
3080 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
3081 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
3082 * or #ESPLUSPLAYER_STATE_PAUSED
3083 * esplusplayer_set_low_latency_mode() should be called as below
3084 * before this api is called.
3085 * esplusplayer_set_low_latency_mode(handle,
3086 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
3087 * esplusplayer_set_low_latency_mode(handle,
3088 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
3089 * esplusplayer_set_low_latency_mode(handle,
3090 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
3091 * esplusplayer_set_low_latency_mode(handle,
3092 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE)
3096 * @see esplusplayer_open()
3098 /// TODO:: set the min/max value of the threshold
3099 int esplusplayer_set_audio_mid_latency_threshold(esplusplayer_handle handle,
3100 const unsigned int threshold);
3103 * @brief Provided api for setting video high latency threshold for low
3106 * @param [in] handle : esplusplayer handle.
3107 * @param [in] threshold: the threshold(number) of the video frames for high
3109 * @param [in] video_high_latency_cb : high latency callback function to
3111 * @param [in] userdata : userdata of esplusplayer_high_latency_cb()
3112 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3113 * esplusplayer_error_type
3114 * values will be returned.
3115 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3116 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3117 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3120 * static void OnVideoHighLatency(void* userdata) {
3121 * printf ("OnVideoHighLatency\n");
3123 * esplusplayer_open(esplayer);
3124 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO);
3125 * esplusplayer_set_video_high_latency_threshold(esplayer, 2,
3126 * OnVideoHighLatency, nullptr);
3127 * // ... your codes ...
3128 * esplusplayer_close(esplayer);
3130 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
3131 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
3132 * or #ESPLUSPLAYER_STATE_PAUSED
3133 * esplusplayer_set_low_latency_mode() should be called as below
3134 * before this api is called.
3135 * esplusplayer_set_low_latency_mode(handle,
3136 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
3137 * esplusplayer_set_low_latency_mode(handle,
3138 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
3139 * esplusplayer_set_low_latency_mode(handle,
3140 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
3141 * esplusplayer_set_low_latency_mode(handle,
3142 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE)
3146 * @see esplusplayer_open()
3148 /// TODO:: set the min/max value of the threshold
3149 int esplusplayer_set_video_high_latency_threshold(
3150 esplusplayer_handle handle, const unsigned int threshold,
3151 esplusplayer_video_high_latency_cb video_high_latency_cb, void* userdata);
3154 * @brief Provided api for setting audio high latency threshold for low
3157 * @param [in] handle : esplusplayer handle.
3158 * @param [in] threshold: the threshold(number) of the audio frames for high
3160 * @param [in] audio_high_latency_cb : high latency callback function to
3162 * @param [in] userdata : userdata of esplusplayer_high_latency_cb()
3163 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3164 * esplusplayer_error_type
3165 * values will be returned.
3166 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3167 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3168 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3171 * static void OnAudioHighLatency(void* userdata) {
3172 * printf ("OnAudioHighLatency\n");
3174 * esplusplayer_open(esplayer);
3175 * esplusplayer_set_low_latency_mode(esplayer,ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO);
3176 * esplusplayer_set_audio_high_latency_threshold(esplayer, 2,
3177 * OnAudioHighLatency, nullptr);
3178 * // ... your codes ...
3179 * esplusplayer_close(esplayer);
3181 * @pre The player state must be one of #ESPLUSPLAYER_STATE_IDLE,
3182 * #ESPLUSPLAYER_STATE_READY, #ESPLUSPLAYER_STATE_PLAYING
3183 * or #ESPLUSPLAYER_STATE_PAUSED
3184 * esplusplayer_set_low_latency_mode() should be called as below
3185 * before this api is called.
3186 * esplusplayer_set_low_latency_mode(handle,
3187 * ESPLUSPLAYER_LOW_LATENCY_MODE_AUDIO),
3188 * esplusplayer_set_low_latency_mode(handle,
3189 * ESPLUSPLAYER_LOW_LATENCY_MODE_VIDEO),
3190 * esplusplayer_set_low_latency_mode(handle,
3191 * ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_SYNC),
3192 * esplusplayer_set_low_latency_mode(handle,
3193 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE)
3197 * @see esplusplayer_open()
3199 /// TODO:: set the min/max value of the threshold
3200 int esplusplayer_set_audio_high_latency_threshold(
3201 esplusplayer_handle handle, const unsigned int threshold,
3202 esplusplayer_audio_high_latency_cb audio_high_latency_cb, void* userdata);
3205 * @brief Provided api for getting the maximum number of frames.
3206 * @remark As a part of the dedicated app implementation.
3207 * If non dedicated app call this api, this api will return
3208 * ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION.
3209 * @param [in] handle : esplusplayer handle.
3210 * @param [out] frame_count : maximum frame count.
3211 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3212 * esplusplayer_error_type values will be returned.
3213 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3214 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3215 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3218 * esplusplayer_open(esplayer);
3219 * esplusplayer_set_low_latency_mode(esplayer,
3220 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE);
3221 * esplusplayer_audio_stream_info audio_stream;
3222 * audio_stream.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_PCM_S16LE;
3223 * audio_stream.sample_rate = 48000;
3224 * audio_stream.channels = 6;
3225 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
3226 * prepare esplayer done
3227 * // ... your codes ...
3228 * uint64_t frame_count = 0;
3229 * esplusplayer_get_low_latency_pcm_buffer_size(esplayer,
3231 * // ... your codes ...
3232 * esplusplayer_stop(esplayer);
3234 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY.
3235 * It has to be set to game mode.
3239 * @see esplusplayer_get_low_latency_pcm_current_buffer_level() \n
3240 * esplusplayer_get_low_latency_pcm_underrun_count()
3242 int esplusplayer_get_low_latency_pcm_buffer_size(esplusplayer_handle handle,
3243 uint64_t* frame_count);
3246 * @brief Provided api for getting the number of currently queued frames.
3247 * @remark As a part of the dedicated app implementation.
3248 * If non dedicated app call this api, this api will return
3249 * ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION.
3250 * @param [in] handle : esplusplayer handle.
3251 * @param [out] frame_count : queued frame count.
3252 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3253 * esplusplayer_error_type values will be returned.
3254 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3255 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3256 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3259 * esplusplayer_open(esplayer);
3260 * esplusplayer_set_low_latency_mode(esplayer,
3261 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE);
3262 * esplusplayer_audio_stream_info audio_stream;
3263 * audio_stream.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_PCM_S16LE;
3264 * audio_stream.sample_rate = 48000;
3265 * audio_stream.channels = 6;
3266 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
3267 * prepare esplayer done
3268 * // ... your codes ...
3269 * uint64_t frame_count = 0;
3270 * esplusplayer_get_low_latency_pcm_current_buffer_level(esplayer,
3272 * // ... your codes ...
3273 * esplusplayer_stop(esplayer);
3275 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY.
3276 * It has to be set to game mode.
3280 * @see esplusplayer_get_low_latency_pcm_buffer_size() \n
3281 * esplusplayer_get_low_latency_pcm_underrun_count()
3283 int esplusplayer_get_low_latency_pcm_current_buffer_level(
3284 esplusplayer_handle handle, uint64_t* frame_count);
3287 * @brief Provided api for getting the underrun counts in audio out.
3288 * @remark As a part of the dedicated app implementation.
3289 * If non dedicated app call this api, this api will return
3290 * ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION.
3291 * @param [in] handle : esplusplayer handle.
3292 * @param [out] underrun_count : underrun counts in audio out.
3293 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3294 * esplusplayer_error_type values will be returned.
3295 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3296 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3297 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3300 * esplusplayer_open(esplayer);
3301 * esplusplayer_set_low_latency_mode(esplayer,
3302 * ESPLUSPLAYER_LOW_LATENCY_MODE_ENABLE_GAME_MODE);
3303 * esplusplayer_audio_stream_info audio_stream;
3304 * audio_stream.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_PCM_S16LE;
3305 * audio_stream.sample_rate = 48000;
3306 * audio_stream.channels = 6;
3307 * esplusplayer_set_audio_stream_info(esplayer, &audio_stream);
3308 * prepare esplayer done
3309 * // ... your codes ...
3310 * uint64_t underrun_count = 0;
3311 * esplusplayer_get_low_latency_pcm_underrun_count(esplayer,
3313 * // ... your codes ...
3314 * esplusplayer_stop(esplayer);
3316 * @pre The player state must be at least #ESPLUSPLAYER_STATE_READY.
3317 * It has to be set to game mode.
3321 * @see esplusplayer_get_low_latency_pcm_buffer_size() \n
3322 * esplusplayer_get_low_latency_pcm_current_buffer_level()
3324 int esplusplayer_get_low_latency_pcm_underrun_count(esplusplayer_handle handle,
3325 uint64_t* underrun_count);
3328 * @brief Initialize easing info to esplayer.
3329 * @param [in] handle : esplusplayer handle.
3330 * @param [in] init_volume : initial easing volume (0 ~ 100).
3331 * @param [in] elapsed_time : initial elapsed time (millisecond).
3332 * @param [in] easing_info : target volume, duration, type.
3333 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3334 * esplusplayer_error_type
3335 * values will be returned.
3336 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3337 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3338 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3341 * esplusplayer_open(esplayer);
3342 * uint32_t volume = 50, elapsed_time = 10000;
3343 * esplusplayer_target_audio_easing_info easing_info;
3344 * easing_info.volume = 30;
3345 * easing_info.duration = 100;
3346 * easing_info.type = ESPLUSPLAYER_AUDIO_EASING_INCUBIC;
3347 * esplusplayer_init_audio_easing_info(esplayer,volume,elapsed_time,&easing_info);
3348 * // ... your codes ...
3349 * esplusplayer_close(esplayer);
3351 * @pre The player state can be all of #esplusplayer_state except
3352 * #ESPLUSPLAYER_STATE_NONE.
3356 * @see esplusplayer_open()
3358 int esplusplayer_init_audio_easing_info(
3359 esplusplayer_handle handle, uint32_t init_volume, uint32_t elapsed_time,
3360 const esplusplayer_target_audio_easing_info* easing_info);
3363 * @brief Update easing info to esplayer to update target info.
3364 * @param [in] handle : esplusplayer handle.
3365 * @param [in] easing_info : target volume, duration, type.
3366 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3367 * esplusplayer_error_type
3368 * values will be returned.
3369 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3370 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3371 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3374 * esplusplayer_open(esplayer);
3375 * // ... your codes ...
3376 * esplusplayer_target_audio_easing_info easing_info;
3377 * easing_info.volume = 30;
3378 * easing_info.duration = 100;
3379 * easing_info.type = ESPLUSPLAYER_AUDIO_EASING_INCUBIC;
3380 * esplusplayer_update_audio_easing_info(esplayer,&easing_info);
3381 * // ... your codes ...
3382 * esplusplayer_close(esplayer);
3384 * @pre The player state can be all of #esplusplayer_state except
3385 * #ESPLUSPLAYER_STATE_NONE.
3386 * This api should be called after
3387 * esplusplayer_init_audio_easing_info() is called
3391 * @see esplusplayer_open()
3393 int esplusplayer_update_audio_easing_info(
3394 esplusplayer_handle handle,
3395 const esplusplayer_target_audio_easing_info* easing_info);
3398 * @brief Get easing info currently in easing operation from esplayer
3399 * @param [in] handle : esplusplayer handle.
3400 * @param [out] current_volume : current volume (0 ~ 100).
3401 * @param [out] elapsed_time : elapsed time (millisecond).
3402 * @param [out] easing_info : target volume, duration, type.
3403 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3404 esplusplayer_error_type
3405 * values will be returned.
3406 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3407 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3408 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3411 * esplusplayer_open(esplayer);
3412 * // ... your codes ...
3413 * uint32_t cur_volume = 50, elapsed_time = 0;
3414 * esplusplayer_target_audio_easing_info easing_info;
3416 esplusplayer_get_audio_easing_info(esplayer,&cur_volume,&elapsed_time,&easing_info);
3417 * // ... your codes ...
3418 * esplusplayer_close(esplayer);
3420 * @pre The player state can be all of #esplusplayer_state except
3421 * #ESPLUSPLAYER_STATE_NONE.
3422 * This api should be called after
3423 * esplusplayer_init_audio_easing_info() is called
3427 * @see esplusplayer_open()
3430 int esplusplayer_get_audio_easing_info(
3431 esplusplayer_handle handle, uint32_t* current_volume,
3432 uint32_t* elapsed_time, esplusplayer_target_audio_easing_info* easing_info);
3435 * @brief Start audio easing using a registered audio easing info
3436 * @param [in] handle : esplusplayer handle.
3437 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3438 * esplusplayer_error_type
3439 * values will be returned.
3440 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3441 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3442 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3445 * prepare esplayer done
3446 * uint32_t volume = 50, elapsed_time = 10000;
3447 * esplusplayer_target_audio_easing_info easing_info;
3448 * easing_info.volume = 30;
3449 * easing_info.duration = 100;
3450 * easing_info.type = ESPLUSPLAYER_AUDIO_EASING_INCUBIC;
3451 * esplusplayer_init_audio_easing_info(esplayer,volume,elapsed_time,&easing_info);
3452 * esplusplayer_start_audio_easing(esplayer);
3453 * // ... your codes ...
3454 * esplusplayer_close(esplayer);
3456 * @pre The player state should be at least #ESPLUSPLAYER_STATE_READY.
3457 * This api should be called after
3458 * esplusplayer_init_audio_easing_info() is called
3462 * @see esplusplayer_open() \n
3463 * esplusplayer_init_audio_easing_info() \n
3464 * esplusplayer_update_audio_easing_info() \n
3465 * esplusplayer_stop_audio_easing() \n
3466 * esplusplayer_prepare_async()
3468 int esplusplayer_start_audio_easing(esplusplayer_handle handle);
3471 * @brief Stop audio easing
3472 * @param [in] handle : esplusplayer handle.
3473 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3474 * esplusplayer_error_type
3475 * values will be returned.
3476 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3477 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3478 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3481 * esplusplayer_open(esplayer);
3482 * // ... your codes ...
3483 * esplusplayer_stop_audio_easing(esplayer);
3484 * // ... your codes ...
3485 * esplusplayer_close(esplayer);
3487 * @pre The player state can be all of #esplusplayer_state except
3488 * #ESPLUSPLAYER_STATE_NONE.
3489 * This api should be called after
3490 * esplusplayer_init_audio_easing_info() is called
3494 * @see esplusplayer_open() \n
3495 * esplusplayer_start_audio_easing()
3497 int esplusplayer_stop_audio_easing(esplusplayer_handle handle);
3500 * @brief Get virtual resource id
3501 * @param [in] handle : esplusplayer handle.
3502 * @param [in] type : The resource type of virtual id.
3503 * @param [out] virtual_id : Stored virtual resource id value.
3504 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3505 esplusplayer_error_type
3506 * values will be returned.
3507 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3508 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3509 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3512 * prepare esplayer done
3513 * // ... your codes ...
3516 esplusplayer_get_virtual_rsc_id(esplayer,ESPLUSPLAYER_RSC_TYPE_VIDEO_RENDERER,&virtual_id);
3517 * // ... your codes ...
3518 * esplusplayer_close(esplayer);
3519 * esplusplayer_destroy(esplayer);
3521 * @pre The player state should be #State::kReady, #State::kPlaying or
3524 * @return @c True on success, otherwise @c False ("virtual_id" will be -1)
3527 * @remark This function returns virtual resource id which player is
3528 * allocated from resource manager. For example, virtual scaler id is
3529 * required for an application to use capture API directly.
3530 * @see esplusplayer_prepare_async()
3533 int esplusplayer_get_virtual_rsc_id(esplusplayer_handle handle,
3534 const esplusplayer_rsc_type type,
3538 * @brief Set advanced picture quality type.
3539 * @param [in] handle : esplusplayer handle.
3540 * @param [in] type : The picture quality type.
3541 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
3543 * @return @c one of esplusplayer_error_type values will be returned.
3547 int esplusplayer_set_advanced_picture_quality_type(
3548 esplusplayer_handle handle,
3549 esplusplayer_advanced_picture_quality_type type);
3552 * @brief Set resource allocate policy.
3553 * @param [in] handle : esplusplayer handle.
3554 * @param [in] policy : The resource allocate policy.
3555 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
3557 * @return @c one of esplusplayer_error_type values will be returned.
3560 * @remark If app has set not default alternaltive resource via
3561 * esplusplayer_set_alternative_video_resource(), alternative
3562 * resource setting will be ignored.
3564 int esplusplayer_set_resource_allocate_policy(
3565 esplusplayer_handle handle, esplusplayer_rsc_alloc_policy policy);
3568 * @brief Requests decoded video frame packet to acquire it. it works only
3569 * with #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_MANUAL_COPY
3571 * @param [in] handle : esplusplayer handle.
3572 * @param [out] packet : the decoded buffer.
3573 * @param [out] status : (nullable) the result of video frame requested
3574 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
3575 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
3577 * @return #ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise one of
3578 * esplusplayer_error_type values will be returned.
3581 * @see esplusplayer_set_video_frame_buffer_type()
3582 * @see esplusplayer_decoded_buffer_destroy()
3583 * @see esplusplayer_decoded_video_frame_buffer_type
3586 * esplusplayer_set_video_frame_buffer_type(handle,
3587 * ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_MANUAL_COPY);
3589 * esplusplayer_prepare_async(handle);
3592 * esplusplayer_decoded_video_packet packet;
3593 * esplusplayer_get_decoded_video_frame_status_type state;
3594 * int retval = esplusplayer_get_decoded_video_packet(handle, &packet, &state);
3595 * if (state == ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_SUCCESS) {
3596 * // successful case.
3597 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
3598 * // you have to call esplusplayer_decoded_buffer_destroy() after using the
3601 * esplusplayer_decoded_buffer_destroy(handle, &packet);
3602 * } else if (state ==
3603 * ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_REMAINING_BUFFER) {
3604 * // app has to call esplusplayer_decoded_buffer_destroy() with previous
3606 * // it means player couldn't draw the video frame into a buffer due to no
3608 * // in this case ,retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
3609 * } else if (state ==
3610 * ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_NO_FILLED_BUFFER) {
3611 * // it means app should retry to get decoded video packet.
3612 * // in most case, there were no buffers drawn in the timing you called this
3614 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_NONE
3615 * } else if (state == ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN) {
3616 * // internal error happened
3617 * // in this case, retval will be ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION
3622 int esplusplayer_get_decoded_video_packet(
3623 esplusplayer_handle handle, esplusplayer_decoded_video_packet* packet,
3624 esplusplayer_get_decoded_video_frame_status_type* status);
3627 * @brief Set preloading of the audio pipeline.
3628 * @param [in] handle : esplusplayer handle.
3629 * @return @c one of esplusplayer_error_type values will be returned.
3630 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
3632 * @remark If the other player is used by pre-loading mode, this player can
3633 * be prepared before the other player is released.
3634 * If app call esplusplayer_start before the original player is
3635 * released, the sound of original player can be affected.
3640 * esplusplayer_handle esplayer1 = esplusplayer_create();
3641 * esplusplayer_open(esplayer1);
3642 * esplusplayer_set_audio_preloading(esplayer1);
3643 * esplusplayer_audio_stream_info audio_stream_1;
3644 * if (audio_stream_1's mime type is PCM or G711_MULAW)
3645 * audio_stream_1.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_G711_MULAW;
3647 * audio_stream_1.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_AAC;
3648 * esplusplayer_set_audio_stream_info(esplayer1, &audio_stream_1);
3649 * esplusplayer_prepare_async(esplayer1);
3650 * esplusplayer_start(esplayer1);
3651 * // ... while playing esplayer1 ...
3652 * // the other player can be prepared if original player is preloading mode.
3653 * esplusplayer_handle esplayer2 = esplusplayer_create();
3654 * esplusplayer_open(esplayer2);
3655 * esplusplayer_set_audio_preloading(esplayer2);
3656 * esplusplayer_audio_stream_info audio_stream_2;
3657 * if (audio_stream_1's mime type is PCM or G711_MULAW) {
3658 * // audio_stream_2 can use the mime type except for PCM or G711_MULAW type.
3659 * audio_stream_2.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_AAC;
3660 * esplusplayer_set_audio_stream_info(esplayer2, &audio_stream_2);
3662 * if (audio_stream_2's mime type is PCM or G711_MULAW) {
3663 * audio_stream_2.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_G711_MULAW;
3664 * esplusplayer_set_audio_stream_info(esplayer2, &audio_stream_2);
3666 * // if all player don't use PCM or G711_MULAW type, one player need to set
3668 * audio_stream_2.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_AAC;
3669 * esplusplayer_set_audio_stream_info(esplayer2, &audio_stream_2);
3670 * esplusplayer_set_audio_codec_type(esplayer2,
3671 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW);
3674 * esplusplayer_prepare_async(esplayer2);
3675 * // the player can be started after the original player is stopped or the
3676 * // original player's audio stream is deactivated.
3677 * if (the app want to keep the original player instance)
3678 * esplusplayer_deactivate(esplayer1,ESPLUSPLAYER_STREAM_TYPE_AUDIO);
3680 * esplusplayer_stop(esplayer1);
3681 * esplusplayer_start(esplayer2);
3685 int esplusplayer_set_audio_preloading(esplusplayer_handle handle);
3688 * @brief Set a callback function to be invoked when video frames are
3690 * @param [in] handle : esplusplayer handle.
3691 * @param [in] video_frame_dropped_cb : the callback function to register.
3692 * @param [in] userdata : userdata of
3693 * esplusplayer_set_video_frame_dropped_cb()
3694 * @pre The player state must be one of #ESPLUSPLAYER_STATE_READY or
3695 * #ESPLUSPLAYER_STATE_PAUSED or #ESPLUSPLAYER_STATE_PLAYING.
3696 * @post esplusplayer_video_frame_dropped_cb() will be invoked.
3697 * if error_cb is set to null, esplusplayer_error_cb() will not be
3698 * @return #ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise one of
3699 * esplusplayer_error_type values will be returned.
3702 * @see esplusplayer_video_frame_dropped_cb()
3704 * void video_frame_dropped_cb(const uint64_t count, void* userdata){
3707 * esplusplayer_set_video_frame_dropped_cb(handle,
3708 * video_frame_dropped_cb, userdata);
3710 * esplusplayer_prepare_async(handle);
3714 int esplusplayer_set_video_frame_dropped_cb(
3715 esplusplayer_handle handle,
3716 esplusplayer_video_frame_dropped_cb video_frame_dropped_cb, void* userdata);
3719 * @brief Set video scan type.
3720 * @param [in] handle : esplusplayer handle.
3721 * @param [in] type : The video scan type.
3722 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE.
3724 * @return @c one of esplusplayer_error_type values will be returned.
3728 int esplusplayer_set_video_scan_type(esplusplayer_handle handle,
3729 esplusplayer_video_scan_type type);
3732 * @brief Get decoding time of the stream
3733 * @param [in] handle : esplusplayer handle.
3734 * @param [in] type : stream type.
3735 * @param [out] time_in_milliseconds : current decoding time in
3737 * @pre The player must be one of #ESPLUSPLAYER_STATE_PAUSE or
3738 * #ESPLUSPLAYER_STATE_PLAYING
3740 * @return @c one of esplusplayer_error_type values will be returned.
3744 int esplusplayer_get_decoding_time(esplusplayer_handle handle,
3745 esplusplayer_stream_type type,
3746 int32_t* time_in_milliseconds);
3749 * @brief Set the timeunit ms or us. All other espp time related API should
3750 * follow this time unit type.
3751 * @param [in] handle : esplusplayer handle.
3752 * @param [in] type : time unit type.
3753 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE
3755 * @return @c one of esplusplayer_error_type values will be returned.
3759 int esplusplayer_set_timeunit_type(esplusplayer_handle handle,
3760 esplusplayer_time_unit_type type);
3763 * @brief Set a callback function to be invoked when decoder receive one
3765 * @param [in] handle : esplusplayer handle.
3766 * @param [in] decoder_buffer_time_cb : the decoder input buffer time
3767 * callback function to register.
3768 * @param [in] userdata : userdata of
3769 * esplusplayer_set_decoder_input_buffer_time_cb()
3770 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3771 * esplusplayer_error_type
3772 * values will be returned.
3773 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3774 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3775 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3778 * refer to the sample code of esplusplayer_set_error_cb();
3780 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
3781 * or #ESPLUSPLAYER_STATE_IDLE.
3786 int esplusplayer_set_decoder_input_buffer_time_cb(
3787 esplusplayer_handle handle,
3788 esplusplayer_decoder_buffer_time_cb decoder_buffer_time_cb, void* userdata);
3791 * @brief Set a callback function to be invoked when get one output buffer
3793 * @param [in] handle : esplusplayer handle.
3794 * @param [in] decoder_buffer_time_cb : the decoder output buffer time
3795 * callback function to register.
3796 * @param [in] userdata : userdata of
3797 * esplusplayer_set_decoder_output_buffer_time_cb()
3798 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3799 * esplusplayer_error_type
3800 * values will be returned.
3801 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3802 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3803 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3806 * refer to the sample code of esplusplayer_set_error_cb();
3808 * @pre The player state must be set to #ESPLUSPLAYER_STATE_NONE
3809 * or #ESPLUSPLAYER_STATE_IDLE.
3814 int esplusplayer_set_decoder_output_buffer_time_cb(
3815 esplusplayer_handle handle,
3816 esplusplayer_decoder_buffer_time_cb decoder_buffer_time_cb, void* userdata);
3819 * @brief Set App id to esplayer to control resource confliction.
3820 * @param [in] handle : esplusplayer handle.
3821 * @param [in] app_info : application id, version, type, runtitle.
3822 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3823 * esplusplayer_error_type
3824 * values will be returned.
3825 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3826 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3827 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3830 * esplusplayer_app_info appinfo;
3831 * appinfo.id = "youtube";
3832 * appinfo.version = "3.0";
3833 * appinfo.type = "MSE";
3834 * appinfo.runtitle = "YouTube";
3835 * esplusplayer_handle esplayer = esplusplayer_create();
3836 * esplusplayer_open(esplayer);
3837 * esplusplayer_set_app_info_ex(esplayer,&appinfo);
3838 * // ... your codes ...
3839 * esplusplayer_close(esplayer);
3841 * @pre The player state must be #ESPLUSPLAYER_STATE_IDLE.
3845 * @see esplusplayer_open()
3847 int esplusplayer_set_app_info_ex(esplusplayer_handle handle,
3848 const esplusplayer_app_info_ex* app_info);
3851 * @brief Set the rotate angle of the video stream.
3852 * This API is used for rotate camera, e.g Pogo-Pin camera
3853 * In Pogo-Pin Camera Video Call scenario, just provide the rotate angle to
3855 * @remark This API will not actually rotate the video display
3856 * @param [in] handle : esplusplayer handle.
3857 * @param [in] rotation : the rotate angle of the video.
3858 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3859 * esplusplayer_error_type
3860 * values will be returned.
3861 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3862 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3863 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3866 * esplusplayer_open(esplayer);
3867 * esplusplayer_set_video_stream_rotation_info(esplayer_,ESPLUSPLAYER_VIDEO_ROTATION_90);
3868 * // ... your codes ...
3869 * esplusplayer_close(esplayer);
3871 * @pre The player state can be all of #esplusplayer_state except
3872 * #ESPLUSPLAYER_STATE_NONE.
3873 * @post this API worked only when video sink created.
3876 * @see esplusplayer_open() \n
3878 int esplusplayer_set_video_stream_rotation_info(
3879 esplusplayer_handle handle,
3880 const esplusplayer_video_stream_rotation_type rotation);
3883 * @brief Get the rotate angle of the video stream.
3884 * @param [in] handle : esplusplayer handle.
3885 * @param [out] rotation : the rotate angle of the video stream which want
3888 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3889 * esplusplayer_error_type
3890 * values will be returned.
3891 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3892 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3893 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3896 * esplusplayer_display_rotation_type rotation_get =
3897 * ESPLUSPLAYER_VIDEO_ROTATION_NONE;
3898 * esplusplayer_open(esplayer);
3899 * esplusplayer_set_video_stream_rotation_info(esplayer,ESPLUSPLAYER_VIDEO_ROTATION_90);
3900 * // ... your codes ...
3901 * esplusplayer_get_video_stream_rotation_info(esplayer,&rotation_get);
3902 * // ... your codes ...
3903 * esplusplayer_close(esplayer);
3905 * @pre The player state can be all of #esplusplayer_state except
3906 * #ESPLUSPLAYER_STATE_NONE.
3907 * @post this API worked only when video sink created.
3910 * @see esplusplayer_open() \n
3911 * esplusplayer_set_video_stream_rotation_info()
3913 int esplusplayer_get_video_stream_rotation_info(
3914 esplusplayer_handle handle,
3915 esplusplayer_video_stream_rotation_type* rotation);
3918 * @brief Provided api for setting buffer level of simple mix out
3919 * @param [in] handle : esplusplayer handle ptr.
3920 * @param [in] level : set buffer level of simple mix out
3921 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
3922 * esplusplayer_error_type values will be returned.
3923 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3924 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3925 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3928 * esplusplayer_open(esplayer);
3929 * esplusplayer_set_audio_codec_type(esplayer,
3930 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW)
3931 * esplusplayer_set_alternative_audio_resource(esplayer,
3932 * ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT);
3933 * esplusplayer_set_simple_mix_out_buffer_level(esplayer,
3934 * ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_LOW);
3935 * // ... your codes ...
3936 * esplusplayer_close(esplayer);
3938 * prepare esplayer done
3939 * // ... your codes ...
3940 * esplusplayer_deactivate(esplayer, ESPLUSPLAYER_STREAM_TYPE_AUDIO)
3941 * esplusplayer_set_audio_codec_type(esplayer,
3942 * ESPLUSPLAYER_AUDIO_CODEC_TYPE_SW)
3943 * esplusplayer_set_alternative_audio_resource(esplayer,
3944 * ESPLUSPLAYER_AUDIO_RESOURCE_SIMPLE_MIX_OUT);
3945 * esplusplayer_set_simple_mix_out_buffer_level(esplayer,
3946 * ESPLUSPLAYER_SIMPLE_MIX_OUT_BUFFER_LOW);
3947 * esplusplayer_activate(esplayer, ESPLUSPLAYER_STREAM_TYPE_AUDIO);
3948 * // ... your codes ...
3949 * esplusplayer_close(esplayer);
3951 * @pre The player state can be all of #State except
3952 * #ESPLUSPLAYER_STATE_NONE.
3955 * @remark This API can set only before esplusplayer_prepare_async() or
3956 * after esplusplayer_deactivate(ESPLUSPLAYER_STREAM_TYPE_AUDIO).
3958 * @see esplusplayer_open() \n
3959 * esplusplayer_set_audio_codec_type()
3960 * esplusplayer_set_alternative_audio_resource()
3962 int esplusplayer_set_simple_mix_out_buffer_level(
3963 esplusplayer_handle handle, esplusplayer_simple_mix_out_buffer_level level);
3965 #ifdef TIZEN_FEATURE_PUBLIC
3967 * @brief Provided api for enabling video hole.
3968 * @param [in] handle : esplusplayer handle.
3969 * @param [in] value : the value of video hole.
3970 * (@c true = video hole enabled, @c false = video hole disabled)
3971 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of
3972 * esplusplayer_error_type values will be returned.
3973 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
3974 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
3975 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
3978 * esplusplayer_open(esplayer);
3979 * esplusplayer_enable_video_hole(esplayer, false);
3980 * // ... your codes ...
3981 * esplusplayer_close(esplayer);
3983 * @pre The player state must not be #ESPLUSPLAYER_STATE_NONE.
3984 * @remark To disable video hole,
3985 * esplusplayer_decoded_video_frame_buffer_type() must not be set to
3986 * #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE. To enable video hole,
3987 * esplusplayer_set_display() must be set to #ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY
3990 * @see esplusplayer_set_video_frame_buffer_type()
3991 * esplusplayer_set_media_packet_video_decoded_cb()
3993 int esplusplayer_enable_video_hole(esplusplayer_handle handle,
3997 * @brief Set sound stream information
3998 * @param [in] handle : esplusplayer handle.
3999 * @param [in] stream_info : sound stream information
4000 * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
4001 * esplusplayer_error_type
4002 * values will be returned.
4003 * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
4004 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
4005 * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
4008 * esplusplayer_open(esplayer);
4009 * esplusplayer_set_sound_stream_info(esplayer, stream_info);
4010 * // ... your codes ...
4011 * esplusplayer_close(esplayer);
4013 * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE
4016 * @see esplusplayer_open()
4018 int esplusplayer_set_sound_stream_info(esplusplayer_handle handle,
4019 const sound_stream_info_h stream_info);
4025 #endif // __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__