4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>,
7 * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 #ifndef __MM_PLAYER_PRIV_H__
24 #define __MM_PLAYER_PRIV_H__
26 /*===========================================================================================
30 ========================================================================================== */
39 #include <tbm_bufmgr.h>
41 #include "mm_player.h"
42 #include "mm_player_internal.h"
43 #include "mm_player_audioeffect.h"
44 #include "mm_message.h"
45 #include "mm_player_ini.h"
46 #include "mm_player_resource.h"
47 #include "mm_player_sound_focus.h"
48 #include "mm_player_pd.h"
49 #include "mm_player_streaming.h"
51 /*===========================================================================================
53 | GLOBAL DEFINITIONS AND DECLARATIONS FOR MODULE |
55 ========================================================================================== */
57 /*---------------------------------------------------------------------------
59 ---------------------------------------------------------------------------*/
61 #define MM_PLAYER_IMGB_MPLANE_MAX 4
62 #define MM_PLAYER_STREAM_COUNT_MAX 3
64 #define MM_PLAYER_CAST(x_player) ((mm_player_t *)(x_player))
66 * @x_player: MMHandleType of player
68 * Get the PD downloader of this player.
70 #define MM_PLAYER_GET_PD(x_player) (MM_PLAYER_CAST(x_player)->pd_downloader)
72 * @x_player: MMHandleType of player
74 * Get the attributes handle of this player.
76 #define MM_PLAYER_GET_ATTRS(x_player) (MM_PLAYER_CAST(x_player)->attrs)
78 #define ROTATION_USING_SINK 0
79 #define ROTATION_USING_CUSTOM 1
80 #define ROTATION_USING_FLIP 2
82 /*---------------------------------------------------------------------------
83 | GLOBAL CONSTANT DEFINITIONS: |
84 ---------------------------------------------------------------------------*/
87 AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */
88 AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */
89 AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */
94 TAG_AUDIO_CODEC = 0x0001,
95 TAG_VIDEO_CODEC = 0x0002,
100 TAG_COPYRIGHT = 0x0040,
102 TAG_DESCRIPTION = 0x0100,
103 TAG_TRACK_NUMBER = 0x0200
106 enum content_attr_flag
108 ATTR_MISSING_ONLY = 0x0001,
109 ATTR_DURATION = 0x0002,
112 ATTR_BITRATE = 0x0010,
116 /* async mode makes trouble. alsasink sometimes fails to pause. */
124 * Enumerations of Player Uri type
126 enum MMPlayerUriType {
127 MM_PLAYER_URI_TYPE_NONE, /**< Player URI type None */
128 MM_PLAYER_URI_TYPE_URL_RTSP, /**< Player URI type RTSP */
129 MM_PLAYER_URI_TYPE_URL_WFD, /**< Player URI type WFD */
130 MM_PLAYER_URI_TYPE_URL_HTTP,/**< Player URI type HTTP */
131 MM_PLAYER_URI_TYPE_URL_MMS,/**< Player URI type MMS */
132 MM_PLAYER_URI_TYPE_MEM, /**< Player URI type Mem */
133 MM_PLAYER_URI_TYPE_FILE, /**< Player URI type File */
134 MM_PLAYER_URI_TYPE_URL, /**< Player URI type URL */
135 MM_PLAYER_URI_TYPE_BUFF, /**< Player URI type Buffer */
136 MM_PLAYER_URI_TYPE_MS_BUFF, /**< Player URI type Media Stream Buffer */
137 MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */
138 MM_PLAYER_URI_TYPE_SS, /**< Player URI type Smooth streaming */
139 MM_PLAYER_URI_TYPE_DASH, /**< Player URI type Mpeg Dash */
140 MM_PLAYER_URI_TYPE_NO_PERMISSION,/**< Player URI type No Permission */
141 MM_PLAYER_URI_TYPE_TEMP, /**< Player URI type Temp */
144 typedef enum _MissingCodec
146 MISSING_PLUGIN_NONE = 0x00,
147 MISSING_PLUGIN_AUDIO = 0x01,
148 MISSING_PLUGIN_VIDEO = 0x02
152 typedef enum _FoundCodec
154 FOUND_PLUGIN_NONE = 0x00,
155 FOUND_PLUGIN_AUDIO = 0x01,
156 FOUND_PLUGIN_VIDEO = 0x02
160 * Enumeration of signal type
163 MM_PLAYER_SIGNAL_TYPE_AUTOPLUG = 0,
164 MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
165 MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
166 MM_PLAYER_SIGNAL_TYPE_TEXTBIN,
167 MM_PLAYER_SIGNAL_TYPE_OTHERS,
168 MM_PLAYER_SIGNAL_TYPE_ALL,
169 MM_PLAYER_SIGNAL_TYPE_MAX = MM_PLAYER_SIGNAL_TYPE_ALL,
172 /* main pipeline's element id */
175 MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
177 MMPLAYER_M_2ND_SRC, /* 2nd Source Element for es buff src */
180 /* it could be a decodebin or could be a typefind. depends on player ini */
184 MMPLAYER_M_AUTOPLUG_V_DEC,
185 MMPLAYER_M_AUTOPLUG_A_DEC,
187 /* NOTE : we need two fakesink to autoplug without decodebin.
188 * first one will hold whole pipeline state. and second one will hold state of
189 * a sink-decodebin for an elementary stream. no metter if there's more then one
190 * elementary streams because MSL reuse it.
192 MMPLAYER_M_SRC_FAKESINK,
193 MMPLAYER_M_SRC_2ND_FAKESINK,
195 /* streaming plugin */
196 MMPLAYER_M_MUXED_S_BUFFER,
197 MMPLAYER_M_DEMUXED_S_BUFFER,
200 /* es buff src queue */
205 /* FIXIT : if there's really no usage for following IDs. remove it */
213 MMPLAYER_M_V_INPUT_SELECTOR, // video input_select
214 MMPLAYER_M_A_INPUT_SELECTOR, // audio input_select
215 MMPLAYER_M_T_INPUT_SELECTOR, // text input_select
221 MMPLAYER_M_A_DEINTERLEAVE,
222 MMPLAYER_M_A_SELECTOR,
228 /* audio pipeline's element id */
231 MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */
236 MMPLAYER_A_FILTER_SEC,
238 MMPLAYER_A_CAPS_DEFAULT,
240 MMPLAYER_A_RESAMPLER,
241 MMPLAYER_A_DEINTERLEAVE,
245 /* video pipeline's element id */
248 MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
257 /* text pipeline's element id */
260 MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
262 MMPLAYER_T_VIDEO_QUEUE,
263 MMPLAYER_T_VIDEO_CONVERTER,
265 MMPLAYER_T_FAKE_SINK,
270 /* midi main pipeline's element id */
274 MMPLAYER_MIDI_PLAYER,
278 enum PlayerCommandState
280 MMPLAYER_COMMAND_NONE,
281 MMPLAYER_COMMAND_CREATE,
282 MMPLAYER_COMMAND_DESTROY,
283 MMPLAYER_COMMAND_UNREALIZE,
284 MMPLAYER_COMMAND_START,
285 MMPLAYER_COMMAND_REALIZE,
286 MMPLAYER_COMMAND_STOP,
287 MMPLAYER_COMMAND_PAUSE,
288 MMPLAYER_COMMAND_RESUME,
292 /* Note : StreamingSrcError is error enum for streaming source which post error message
293 * using custom message made by itself. The enum value must start with zero,
294 * because the streaming source(secrtspsrc) also does.
296 enum StreamingSrcError
298 MMPLAYER_STREAMING_ERROR_NONE = 0,
299 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
300 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
301 MMPLAYER_STREAMING_ERROR_CONNECTION_FAIL,
302 MMPLAYER_STREAMING_ERROR_DNS_FAIL,
303 MMPLAYER_STREAMING_ERROR_SERVER_DISCONNECTED,
304 MMPLAYER_STREAMING_ERROR_BAD_SERVER,
305 MMPLAYER_STREAMING_ERROR_INVALID_PROTOCOL,
306 MMPLAYER_STREAMING_ERROR_INVALID_URL,
307 MMPLAYER_STREAMING_ERROR_UNEXPECTED_MSG,
308 MMPLAYER_STREAMING_ERROR_OUT_OF_MEMORIES,
309 MMPLAYER_STREAMING_ERROR_RTSP_TIMEOUT,
310 MMPLAYER_STREAMING_ERROR_BAD_REQUEST,
311 MMPLAYER_STREAMING_ERROR_NOT_AUTHORIZED,
312 MMPLAYER_STREAMING_ERROR_PAYMENT_REQUIRED,
313 MMPLAYER_STREAMING_ERROR_FORBIDDEN,
314 MMPLAYER_STREAMING_ERROR_CONTENT_NOT_FOUND,
315 MMPLAYER_STREAMING_ERROR_METHOD_NOT_ALLOWED,
316 MMPLAYER_STREAMING_ERROR_NOT_ACCEPTABLE,
317 MMPLAYER_STREAMING_ERROR_PROXY_AUTHENTICATION_REQUIRED,
318 MMPLAYER_STREAMING_ERROR_SERVER_TIMEOUT,
319 MMPLAYER_STREAMING_ERROR_GONE,
320 MMPLAYER_STREAMING_ERROR_LENGTH_REQUIRED,
321 MMPLAYER_STREAMING_ERROR_PRECONDITION_FAILED,
322 MMPLAYER_STREAMING_ERROR_REQUEST_ENTITY_TOO_LARGE,
323 MMPLAYER_STREAMING_ERROR_REQUEST_URI_TOO_LARGE,
324 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_MEDIA_TYPE,
325 MMPLAYER_STREAMING_ERROR_PARAMETER_NOT_UNDERSTOOD,
326 MMPLAYER_STREAMING_ERROR_CONFERENCE_NOT_FOUND,
327 MMPLAYER_STREAMING_ERROR_NOT_ENOUGH_BANDWIDTH,
328 MMPLAYER_STREAMING_ERROR_NO_SESSION_ID,
329 MMPLAYER_STREAMING_ERROR_METHOD_NOT_VALID_IN_THIS_STATE,
330 MMPLAYER_STREAMING_ERROR_HEADER_FIELD_NOT_VALID_FOR_SOURCE,
331 MMPLAYER_STREAMING_ERROR_INVALID_RANGE,
332 MMPLAYER_STREAMING_ERROR_PARAMETER_IS_READONLY,
333 MMPLAYER_STREAMING_ERROR_AGGREGATE_OP_NOT_ALLOWED,
334 MMPLAYER_STREAMING_ERROR_ONLY_AGGREGATE_OP_ALLOWED,
335 MMPLAYER_STREAMING_ERROR_BAD_TRANSPORT,
336 MMPLAYER_STREAMING_ERROR_DESTINATION_UNREACHABLE,
337 MMPLAYER_STREAMING_ERROR_INTERNAL_SERVER_ERROR,
338 MMPLAYER_STREAMING_ERROR_NOT_IMPLEMENTED,
339 MMPLAYER_STREAMING_ERROR_BAD_GATEWAY,
340 MMPLAYER_STREAMING_ERROR_SERVICE_UNAVAILABLE,
341 MMPLAYER_STREAMING_ERROR_GATEWAY_TIME_OUT ,
342 MMPLAYER_STREAMING_ERROR_RTSP_VERSION_NOT_SUPPORTED,
343 MMPLAYER_STREAMING_ERROR_OPTION_NOT_SUPPORTED,
346 /*---------------------------------------------------------------------------
347 | GLOBAL DATA TYPE DEFINITIONS: |
348 ---------------------------------------------------------------------------*/
354 } MMPlayerGstElement;
358 GstTagList *tag_list;
359 MMPlayerGstElement *mainbin;
360 MMPlayerGstElement *audiobin;
361 MMPlayerGstElement *videobin;
362 MMPlayerGstElement *textbin;
363 } MMPlayerGstPipelineInfo;
369 int bluetooth; /* enable/disable */
377 } tBuffer; /* FIXIT : choose better name */
384 char uri[MM_MAX_URL_LEN];
385 char urgent[MM_MAX_FILENAME_LEN];
386 } MMPlayerParseProfile;
390 MMPlayerPosFormatType format;
392 }MMPlayerPendingSeek;
397 } MMPlayerSignalItem;
403 bool video_zc; // video zero-copy
405 bool media_packet_video_stream;
409 GMainContext *global_default;
410 GMainContext *thread_default;
411 }MMPlayerGMainContext;
419 gint active_pad_index;
420 gint total_track_num;
423 gulong event_probe_id;
424 } mm_player_selector_t;
429 gboolean stream_changed;
430 gboolean reconfigure;
432 GstClockTime next_pts; /* latest decoded buffer's pts+duration */
433 GstClockTime start_time; /* updated once get SEGMENT event */
435 gulong audio_data_probe_id;
436 gulong video_data_probe_id;
437 } mm_player_gapless_t;
443 bool is_little_endian;
444 guint64 channel_mask;
448 } mm_player_audio_stream_buff_t;
451 * @brief data of video_bo_list
452 * @details this will be used when the sw codec is running.
458 } mm_player_video_bo_info_t;
462 int state; // player current state
463 int prev_state; // player previous state
464 int pending_state; // player state which is going to now
465 int target_state; // player state which user want to go to
466 guint state_change_timeout;
468 gboolean section_repeat;
469 gint section_repeat_start;
470 gint section_repeat_end;
479 GMutex playback_lock;
481 /* repeat thread lock */
482 GCond repeat_thread_cond;
483 GMutex repeat_thread_mutex;
484 GThread* repeat_thread;
485 gboolean repeat_thread_exit;
487 /* next play thread */
488 GThread* next_play_thread;
489 gboolean next_play_thread_exit;
490 GCond next_play_thread_cond;
491 GMutex next_play_thread_mutex;
492 mm_player_gapless_t gapless;
495 GThread* capture_thread;
496 gboolean capture_thread_exit;
497 GCond capture_thread_cond;
498 GMutex capture_thread_mutex;
499 MMPlayerVideoCapture capture;
500 MMPlayerVideoColorspace video_cs;
501 MMVideoBuffer captured;
503 /* fakesink handling lock */
506 /* player attributes */
509 /* message callback */
510 MMMessageCallback msg_cb;
514 /* progressive download */
515 mm_player_pd_t *pd_downloader;
516 gchar *pd_file_save_path;
517 MMPlayerPDMode pd_mode;
519 /* streaming player */
520 mm_player_streaming_t *streamer;
521 gchar *http_file_buffering_path;
523 /* gstreamer pipeline */
524 MMPlayerGstPipelineInfo *pipeline;
527 GstPad *ghost_pad_for_videobin;
529 guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX];
530 guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX];
531 mm_player_media_stream_buffer_status_callback media_stream_buffer_status_cb[MM_PLAYER_STREAM_TYPE_MAX];
532 mm_player_media_stream_seek_data_callback media_stream_seek_data_cb[MM_PLAYER_STREAM_TYPE_MAX];
533 int video_num_buffers; /* total num of buffers in vcodec */
534 int video_extra_num_buffers; /* extra num of buffers in vcodec */
536 void* buffer_cb_user_param;
538 /* video stream changed callback */
539 mm_player_stream_changed_callback video_stream_changed_cb;
540 void* video_stream_changed_cb_user_param;
542 /* audio stream changed callback */
543 mm_player_stream_changed_callback audio_stream_changed_cb;
544 void* audio_stream_changed_cb_user_param;
546 /* video stream callback */
547 mm_player_video_stream_callback video_stream_cb;
548 void* video_stream_cb_user_param;
549 int use_video_stream;
551 GMutex video_bo_mutex;
552 GList* video_bo_list; /* mm_player_video_bo_info_t, bo list for decoded video data by sw codec */
555 /* audio stram callback */
556 mm_player_audio_stream_callback audio_stream_cb;
557 void* audio_stream_cb_user_param;
558 bool audio_stream_sink_sync;
559 GList* audio_stream_buff_list; /* mm_player_audio_stream_buff_t, buff list of extract pcm data */
561 /* audio buffer callback */
562 mm_player_audio_stream_callback_ex audio_stream_render_cb_ex;
564 /* video capture callback*/
565 gulong video_capture_cb_probe_id;
568 MMPlayerSoundInfo sound;
573 /* video stream caps parsed by demuxer */
574 GstCaps* v_stream_caps;
576 /* audio effect infomation */
577 MMAudioEffectInfo audio_effect_info;
578 gboolean bypass_audio_effect;
580 gulong audio_cb_probe_id;
581 gulong video_cb_probe_id;
586 /* content profile */
587 MMPlayerParseProfile profile;
589 /* streaming service type */
590 MMStreamingType streaming_type;
594 gboolean have_dynamic_pad;
595 GList* parsers; // list of linked parser name
596 GList* audio_decoders; // list of linked audio name
597 gboolean no_more_pad;
598 gint num_dynamic_pad;
599 gboolean has_many_types;
601 /* progress callback timer */
602 /* FIXIT : since duplicated functionality with get_position
603 * this function will be deprecated after fixing all application
604 * which are using it.
606 guint progress_timer;
608 /* timer for sending delayed EOS */
611 /* last point (msec) that player is paused or seeking */
612 gint64 last_position;
617 /* data size of http streaming */
618 guint64 http_content_size;
621 gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
623 gboolean smooth_streaming;
625 gint videodec_linked;
626 gint audiodec_linked;
627 gint videosink_linked;
628 gint audiosink_linked;
629 gint textsink_linked;
631 /* missing plugin during autoplugging */
632 MissingCodec not_supported_codec;
634 /* unlinked audio/video mime type */
635 gchar *unlinked_video_mime;
636 gchar *unlinked_audio_mime;
637 gchar *unlinked_demuxer_mime;
639 /* found codec during autoplugging */
640 FoundCodec can_support_codec;
642 gboolean not_found_demuxer;
644 /* support seek even though player is not start */
645 MMPlayerPendingSeek pending_seek;
649 /* prevent to post msg over and over */
652 /* list of sink elements */
653 GList* sink_elements;
655 /* signal notifiers */
656 GList* signals[MM_PLAYER_SIGNAL_TYPE_MAX];
658 MMPlayerGMainContext context;
659 MMPlayerUriList uri_info;
661 gboolean is_sound_extraction;
663 gfloat playback_rate;
665 /* player state resumed by fast rewind */
666 gboolean resumed_by_rewind;
668 gboolean is_nv12_tiled;
669 gboolean is_drm_file;
671 /* resource manager for H/W resources */
672 MMPlayerResourceManager resource_manager;
674 /* sound focus for being compatible with legacy session policy internally */
675 MMPlayerSoundFocus sound_focus;
677 gboolean is_subtitle_off;
678 gboolean is_external_subtitle_present;
680 /* contents bitrate for buffering management */
681 guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
683 guint updated_bitrate_count;
684 guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
685 guint total_maximum_bitrate;
686 guint updated_maximum_bitrate_count;
688 /* prevent it from posting duplicatly*/
691 /* timeout source for lazy pause */
692 guint lazy_pause_event_id;
693 guint resume_event_id;
694 guint resumable_cancel_id;
696 gboolean keep_detecting_vcodec;
698 gboolean play_subtitle;
699 gboolean use_textoverlay;
700 gboolean is_subtitle_force_drop; // set TRUE after bus_cb get EOS
702 /* PD downloader message callback and param */
703 MMMessageCallback pd_msg_cb;
704 void* pd_msg_cb_param;
706 /* adjust subtitle position store */
707 gint64 adjust_subtitle_pos;
708 GList *subtitle_language_list;
710 /* To store the current multiwindow status */
711 gboolean last_multiwin_status;
713 /* To store the current running audio pad index of demuxer */
714 gint demux_pad_index;
716 mm_player_selector_t selector[MM_PLAYER_TRACK_TYPE_MAX];
717 mm_player_selector_t audio_mode;
718 gboolean use_deinterleave;
719 guint max_audio_channels;
721 guint internal_text_idx;
722 guint external_text_idx;
724 MMPlayerSetMode set_mode;
727 gboolean use_decodebin;
729 /* initialize values */
732 /* check to use h/w codec */
733 GstCaps* state_tune_caps;
734 gboolean ignore_asyncdone;
736 /* video share sync */
737 gint64 video_share_api_delta;
738 gint64 video_share_clock_delta;
740 /* just for native app (video hub) */
741 gboolean video_hub_download_mode;
742 gboolean sync_handler;
744 /* store dump pad list */
747 /* whether a video has closed caption or not */
748 gboolean has_closed_caption;
750 GstElement *video_fakesink;
752 /* audio stream caps parsed by demuxer or set by external demuxer */
753 GstCaps* a_stream_caps;
755 /* subtitle stream caps parsed by demuxer or set by external demuxer */
756 GstCaps* s_stream_caps;
758 /* es player using feed-data callback or calling app_src_push_buffer directly*/
759 gboolean es_player_push_mode;
761 /* tmb buffer manager for s/w codec tmb_bo */
770 gchar *language_code;
778 gulong probe_handle_id;
779 FILE *dump_element_file;
787 int valid_type; // validity type
788 int value_min; //<- set validity value range
792 /*===========================================================================================
794 | GLOBAL FUNCTION PROTOTYPES |
796 ========================================================================================== */
801 int _mmplayer_create_player(MMHandleType hplayer);
802 int _mmplayer_destroy(MMHandleType hplayer);
803 int _mmplayer_realize(MMHandleType hplayer);
804 int _mmplayer_unrealize(MMHandleType hplayer);
805 int _mmplayer_get_state(MMHandleType hplayer, int* pstate);
806 int _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume);
807 int _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType *volume);
808 int _mmplayer_set_mute(MMHandleType hplayer, int mute);
809 int _mmplayer_get_mute(MMHandleType hplayer, int* pmute);
810 int _mmplayer_start(MMHandleType hplayer);
811 int _mmplayer_stop(MMHandleType hplayer);
812 int _mmplayer_pause(MMHandleType hplayer);
813 int _mmplayer_resume(MMHandleType hplayer);
814 int _mmplayer_set_position(MMHandleType hplayer, int format, int pos);
815 int _mmplayer_get_position(MMHandleType hplayer, int format, unsigned long *pos);
816 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format, int pos);
817 int _mmplayer_adjust_video_postion(MMHandleType hplayer,int offset);
818 int _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, unsigned long end);
819 int _mmplayer_deactivate_section_repeat(MMHandleType hplayer);
820 int _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size);
821 int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming);
822 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
823 int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
824 int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
825 int _mmplayer_set_videostream_cb(MMHandleType hplayer,mm_player_video_stream_callback callback, void *user_param);
826 int _mmplayer_set_audiostream_cb(MMHandleType hplayer,mm_player_audio_stream_callback callback, void *user_param);
827 int _mmplayer_set_subtitle_silent (MMHandleType hplayer, int silent);
828 int _mmplayer_get_subtitle_silent (MMHandleType hplayer, int* silent);
829 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filepath);
830 int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos);
832 /* test API for tuning audio gain. this API should be
833 * deprecated before the day of final release
835 int _mmplayer_set_volume_tune(MMHandleType hplayer, MMPlayerVolumeType volume);
836 int _mmplayer_update_video_param(mm_player_t* player, char *param_name);
837 int _mmplayer_set_audiobuffer_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
838 int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
839 int _mmplayer_audio_effect_custom_apply(mm_player_t *player);
841 int _mmplayer_set_audiostream_cb_ex(MMHandleType hplayer, bool sync, mm_player_audio_stream_callback_ex callback, void *user_param);
842 gboolean __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessageParamType* param);
844 int _mmplayer_gst_set_audio_channel(MMHandleType hplayer, MMPlayerAudioChannel ch_idx);
845 int _mmplayer_change_track_language (MMHandleType hplayer, MMPlayerTrackType type, int index);
846 int _mmplayer_sync_subtitle_pipeline(mm_player_t* player);
847 int _mmplayer_set_prepare_buffering_time(MMHandleType hplayer, int second);
848 int _mmplayer_set_runtime_buffering_mode(MMHandleType hplayer, MMPlayerBufferingMode mode, int second);
849 int _mmplayer_set_display_zoom(MMHandleType hplayer, float level, int x, int y);
850 int _mmplayer_get_display_zoom(MMHandleType hplayer, float *level, int *x, int *y);
851 int _mmplayer_set_video_hub_download_mode(MMHandleType hplayer, bool mode);
852 int _mmplayer_use_system_clock (MMHandleType hplayer);
853 int _mmplayer_set_video_share_master_clock(MMHandleType hplayer, long long clock, long long clock_delta, long long video_time, long long media_clock, long long audio_time);
854 int _mmplayer_get_video_share_master_clock(MMHandleType hplayer, long long *video_time, long long *media_clock, long long *audio_time);
855 int _mmplayer_get_video_rotate_angle(MMHandleType hplayer, int *angle);
856 int _mmplayer_enable_sync_handler(MMHandleType hplayer, bool enable);
857 int _mmplayer_set_file_buffering_path(MMHandleType hplayer, const char* file_path);
858 int _mmplayer_set_uri(MMHandleType hplayer, const char* uri);
859 int _mmplayer_set_next_uri(MMHandleType hplayer, const char* uri, bool is_first_path);
860 int _mmplayer_get_next_uri(MMHandleType hplayer, char** uri);
861 int _mmplayer_has_closed_caption(MMHandleType hplayer, bool* exist);
862 int _mmplayer_enable_media_packet_video_stream(MMHandleType hplayer, bool enable);
863 void * _mm_player_media_packet_video_stream_internal_buffer_ref(void *buffer);
864 void _mm_player_media_packet_video_stream_internal_buffer_unref(void *buffer);
865 int _mmplayer_set_pcm_spec(MMHandleType hplayer, int samplerate, int channel);
866 int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
867 int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num);
868 int __mmplayer_gst_set_state (mm_player_t* player, GstElement * pipeline, GstState state, gboolean async, gint timeout );
869 int __mmplayer_set_state(mm_player_t* player, int state);
870 int __mmplayer_check_state(mm_player_t* player, enum PlayerCommandState command);
871 gboolean __mmplayer_dump_pipeline_state( mm_player_t* player );
872 void __mmplayer_remove_g_source_from_context(GMainContext *context, guint source_id);
874 const gchar * __get_state_name ( int state );
875 gboolean __mmplayer_can_do_interrupt(mm_player_t *player);
876 gboolean __is_streaming( mm_player_t* player );
877 gboolean __is_rtsp_streaming( mm_player_t* player );
878 gboolean __is_wfd_streaming( mm_player_t* player );
879 gboolean __is_live_streaming ( mm_player_t* player );
880 gboolean __is_http_streaming( mm_player_t* player );
881 gboolean __is_http_live_streaming( mm_player_t* player );
882 gboolean __is_dash_streaming( mm_player_t* player );
883 gboolean __is_smooth_streaming( mm_player_t* player );
884 gboolean __is_http_progressive_down(mm_player_t* player);
886 gboolean __mmplayer_check_useful_message(mm_player_t *player, GstMessage * message);
887 gboolean __mmplayer_handle_gst_error ( mm_player_t* player, GstMessage * message, GError* error );
888 gint __gst_handle_core_error( mm_player_t* player, int code );
889 gint __gst_handle_library_error( mm_player_t* player, int code );
890 gint __gst_handle_resource_error( mm_player_t* player, int code );
891 gint __gst_handle_stream_error( mm_player_t* player, GError* error, GstMessage * message );
892 int _mmplayer_sound_register_with_pid(MMHandleType hplayer, int pid);
893 int _mmplayer_get_client_pid(MMHandleType hplayer, int* pid);
894 int __mmplayer_get_video_angle(mm_player_t* player, int *user_angle, int *org_angle);
895 int _mmplayer_video_stream_release_bo(mm_player_t* player, void* bo);
901 #endif /* __MM_PLAYER_PRIV_H__ */