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>
40 #include "mm_player.h"
41 #include "mm_player_internal.h"
42 #include "mm_player_audioeffect.h"
43 #include "mm_message.h"
44 #include "mm_player_ini.h"
45 #include "mm_player_resource.h"
46 #include "mm_player_sound_focus.h"
47 #include "mm_player_pd.h"
48 #include "mm_player_streaming.h"
50 /*===========================================================================================
52 | GLOBAL DEFINITIONS AND DECLARATIONS FOR MODULE |
54 ========================================================================================== */
56 /*---------------------------------------------------------------------------
58 ---------------------------------------------------------------------------*/
60 #define MM_PLAYER_IMGB_MPLANE_MAX 4
61 #define MM_PLAYER_STREAM_COUNT_MAX 3
63 #define MM_PLAYER_CAST(x_player) ((mm_player_t *)(x_player))
65 * @x_player: MMHandleType of player
67 * Get the PD downloader of this player.
69 #define MM_PLAYER_GET_PD(x_player) (MM_PLAYER_CAST(x_player)->pd_downloader)
71 * @x_player: MMHandleType of player
73 * Get the attributes handle of this player.
75 #define MM_PLAYER_GET_ATTRS(x_player) (MM_PLAYER_CAST(x_player)->attrs)
77 #define ROTATION_USING_SINK 0
78 #define ROTATION_USING_CUSTOM 1
79 #define ROTATION_USING_FLIP 2
81 /*---------------------------------------------------------------------------
82 | GLOBAL CONSTANT DEFINITIONS: |
83 ---------------------------------------------------------------------------*/
86 AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */
87 AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */
88 AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */
93 TAG_AUDIO_CODEC = 0x0001,
94 TAG_VIDEO_CODEC = 0x0002,
99 TAG_COPYRIGHT = 0x0040,
101 TAG_DESCRIPTION = 0x0100,
102 TAG_TRACK_NUMBER = 0x0200
105 enum content_attr_flag
107 ATTR_MISSING_ONLY = 0x0001,
108 ATTR_DURATION = 0x0002,
111 ATTR_BITRATE = 0x0010,
115 /* async mode makes trouble. alsasink sometimes fails to pause. */
123 * Enumerations of Player Uri type
125 enum MMPlayerUriType {
126 MM_PLAYER_URI_TYPE_NONE, /**< Player URI type None */
127 MM_PLAYER_URI_TYPE_URL_RTSP, /**< Player URI type RTSP */
128 MM_PLAYER_URI_TYPE_URL_WFD, /**< Player URI type WFD */
129 MM_PLAYER_URI_TYPE_URL_HTTP,/**< Player URI type HTTP */
130 MM_PLAYER_URI_TYPE_URL_MMS,/**< Player URI type MMS */
131 MM_PLAYER_URI_TYPE_MEM, /**< Player URI type Mem */
132 MM_PLAYER_URI_TYPE_FILE, /**< Player URI type File */
133 MM_PLAYER_URI_TYPE_URL, /**< Player URI type URL */
134 MM_PLAYER_URI_TYPE_BUFF, /**< Player URI type Buffer */
135 MM_PLAYER_URI_TYPE_MS_BUFF, /**< Player URI type Media Stream Buffer */
136 MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */
137 MM_PLAYER_URI_TYPE_SS, /**< Player URI type Smooth streaming */
138 MM_PLAYER_URI_TYPE_DASH, /**< Player URI type Mpeg Dash */
139 MM_PLAYER_URI_TYPE_NO_PERMISSION,/**< Player URI type No Permission */
140 MM_PLAYER_URI_TYPE_TEMP, /**< Player URI type Temp */
143 typedef enum _MissingCodec
145 MISSING_PLUGIN_NONE = 0x00,
146 MISSING_PLUGIN_AUDIO = 0x01,
147 MISSING_PLUGIN_VIDEO = 0x02
151 typedef enum _FoundCodec
153 FOUND_PLUGIN_NONE = 0x00,
154 FOUND_PLUGIN_AUDIO = 0x01,
155 FOUND_PLUGIN_VIDEO = 0x02
159 * Enumeration of signal type
162 MM_PLAYER_SIGNAL_TYPE_AUTOPLUG = 0,
163 MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
164 MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
165 MM_PLAYER_SIGNAL_TYPE_TEXTBIN,
166 MM_PLAYER_SIGNAL_TYPE_OTHERS,
167 MM_PLAYER_SIGNAL_TYPE_ALL,
168 MM_PLAYER_SIGNAL_TYPE_MAX = MM_PLAYER_SIGNAL_TYPE_ALL,
171 /* main pipeline's element id */
174 MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
176 MMPLAYER_M_2ND_SRC, /* 2nd Source Element for es buff src */
179 /* it could be a decodebin or could be a typefind. depends on player ini */
183 MMPLAYER_M_AUTOPLUG_V_DEC,
184 MMPLAYER_M_AUTOPLUG_A_DEC,
186 /* NOTE : we need two fakesink to autoplug without decodebin.
187 * first one will hold whole pipeline state. and second one will hold state of
188 * a sink-decodebin for an elementary stream. no metter if there's more then one
189 * elementary streams because MSL reuse it.
191 MMPLAYER_M_SRC_FAKESINK,
192 MMPLAYER_M_SRC_2ND_FAKESINK,
194 /* streaming plugin */
195 MMPLAYER_M_MUXED_S_BUFFER,
196 MMPLAYER_M_DEMUXED_S_BUFFER,
199 /* es buff src queue */
204 /* FIXIT : if there's really no usage for following IDs. remove it */
212 MMPLAYER_M_V_INPUT_SELECTOR, // video input_select
213 MMPLAYER_M_A_INPUT_SELECTOR, // audio input_select
214 MMPLAYER_M_T_INPUT_SELECTOR, // text input_select
220 MMPLAYER_M_A_DEINTERLEAVE,
221 MMPLAYER_M_A_SELECTOR,
227 /* audio pipeline's element id */
230 MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */
235 MMPLAYER_A_FILTER_SEC,
237 MMPLAYER_A_CAPS_DEFAULT,
239 MMPLAYER_A_RESAMPLER,
240 MMPLAYER_A_DEINTERLEAVE,
244 /* video pipeline's element id */
247 MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
256 /* text pipeline's element id */
259 MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
261 MMPLAYER_T_VIDEO_QUEUE,
262 MMPLAYER_T_VIDEO_CONVERTER,
264 MMPLAYER_T_FAKE_SINK,
269 /* midi main pipeline's element id */
273 MMPLAYER_MIDI_PLAYER,
277 enum PlayerCommandState
279 MMPLAYER_COMMAND_NONE,
280 MMPLAYER_COMMAND_CREATE,
281 MMPLAYER_COMMAND_DESTROY,
282 MMPLAYER_COMMAND_UNREALIZE,
283 MMPLAYER_COMMAND_START,
284 MMPLAYER_COMMAND_REALIZE,
285 MMPLAYER_COMMAND_STOP,
286 MMPLAYER_COMMAND_PAUSE,
287 MMPLAYER_COMMAND_RESUME,
291 /* Note : StreamingSrcError is error enum for streaming source which post error message
292 * using custom message made by itself. The enum value must start with zero,
293 * because the streaming source(secrtspsrc) also does.
295 enum StreamingSrcError
297 MMPLAYER_STREAMING_ERROR_NONE = 0,
298 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
299 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
300 MMPLAYER_STREAMING_ERROR_CONNECTION_FAIL,
301 MMPLAYER_STREAMING_ERROR_DNS_FAIL,
302 MMPLAYER_STREAMING_ERROR_SERVER_DISCONNECTED,
303 MMPLAYER_STREAMING_ERROR_BAD_SERVER,
304 MMPLAYER_STREAMING_ERROR_INVALID_PROTOCOL,
305 MMPLAYER_STREAMING_ERROR_INVALID_URL,
306 MMPLAYER_STREAMING_ERROR_UNEXPECTED_MSG,
307 MMPLAYER_STREAMING_ERROR_OUT_OF_MEMORIES,
308 MMPLAYER_STREAMING_ERROR_RTSP_TIMEOUT,
309 MMPLAYER_STREAMING_ERROR_BAD_REQUEST,
310 MMPLAYER_STREAMING_ERROR_NOT_AUTHORIZED,
311 MMPLAYER_STREAMING_ERROR_PAYMENT_REQUIRED,
312 MMPLAYER_STREAMING_ERROR_FORBIDDEN,
313 MMPLAYER_STREAMING_ERROR_CONTENT_NOT_FOUND,
314 MMPLAYER_STREAMING_ERROR_METHOD_NOT_ALLOWED,
315 MMPLAYER_STREAMING_ERROR_NOT_ACCEPTABLE,
316 MMPLAYER_STREAMING_ERROR_PROXY_AUTHENTICATION_REQUIRED,
317 MMPLAYER_STREAMING_ERROR_SERVER_TIMEOUT,
318 MMPLAYER_STREAMING_ERROR_GONE,
319 MMPLAYER_STREAMING_ERROR_LENGTH_REQUIRED,
320 MMPLAYER_STREAMING_ERROR_PRECONDITION_FAILED,
321 MMPLAYER_STREAMING_ERROR_REQUEST_ENTITY_TOO_LARGE,
322 MMPLAYER_STREAMING_ERROR_REQUEST_URI_TOO_LARGE,
323 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_MEDIA_TYPE,
324 MMPLAYER_STREAMING_ERROR_PARAMETER_NOT_UNDERSTOOD,
325 MMPLAYER_STREAMING_ERROR_CONFERENCE_NOT_FOUND,
326 MMPLAYER_STREAMING_ERROR_NOT_ENOUGH_BANDWIDTH,
327 MMPLAYER_STREAMING_ERROR_NO_SESSION_ID,
328 MMPLAYER_STREAMING_ERROR_METHOD_NOT_VALID_IN_THIS_STATE,
329 MMPLAYER_STREAMING_ERROR_HEADER_FIELD_NOT_VALID_FOR_SOURCE,
330 MMPLAYER_STREAMING_ERROR_INVALID_RANGE,
331 MMPLAYER_STREAMING_ERROR_PARAMETER_IS_READONLY,
332 MMPLAYER_STREAMING_ERROR_AGGREGATE_OP_NOT_ALLOWED,
333 MMPLAYER_STREAMING_ERROR_ONLY_AGGREGATE_OP_ALLOWED,
334 MMPLAYER_STREAMING_ERROR_BAD_TRANSPORT,
335 MMPLAYER_STREAMING_ERROR_DESTINATION_UNREACHABLE,
336 MMPLAYER_STREAMING_ERROR_INTERNAL_SERVER_ERROR,
337 MMPLAYER_STREAMING_ERROR_NOT_IMPLEMENTED,
338 MMPLAYER_STREAMING_ERROR_BAD_GATEWAY,
339 MMPLAYER_STREAMING_ERROR_SERVICE_UNAVAILABLE,
340 MMPLAYER_STREAMING_ERROR_GATEWAY_TIME_OUT ,
341 MMPLAYER_STREAMING_ERROR_RTSP_VERSION_NOT_SUPPORTED,
342 MMPLAYER_STREAMING_ERROR_OPTION_NOT_SUPPORTED,
345 /*---------------------------------------------------------------------------
346 | GLOBAL DATA TYPE DEFINITIONS: |
347 ---------------------------------------------------------------------------*/
353 } MMPlayerGstElement;
357 GstTagList *tag_list;
358 MMPlayerGstElement *mainbin;
359 MMPlayerGstElement *audiobin;
360 MMPlayerGstElement *videobin;
361 MMPlayerGstElement *textbin;
362 } MMPlayerGstPipelineInfo;
368 int bluetooth; /* enable/disable */
376 } tBuffer; /* FIXIT : choose better name */
383 char uri[MM_MAX_URL_LEN];
384 char urgent[MM_MAX_FILENAME_LEN];
385 } MMPlayerParseProfile;
389 MMPlayerPosFormatType format;
391 }MMPlayerPendingSeek;
396 } MMPlayerSignalItem;
402 bool video_zc; // video zero-copy
404 bool media_packet_video_stream;
408 GMainContext *global_default;
409 GMainContext *thread_default;
410 }MMPlayerGMainContext;
418 gint active_pad_index;
419 gint total_track_num;
422 gulong event_probe_id;
423 } mm_player_selector_t;
428 gboolean stream_changed;
429 gboolean reconfigure;
431 GstClockTime next_pts; /* latest decoded buffer's pts+duration */
432 GstClockTime start_time; /* updated once get SEGMENT event */
434 gulong audio_data_probe_id;
435 gulong video_data_probe_id;
436 } mm_player_gapless_t;
440 int state; // player current state
441 int prev_state; // player previous state
442 int pending_state; // player state which is going to now
443 int target_state; // player state which user want to go to
444 guint state_change_timeout;
446 gboolean section_repeat;
447 gint section_repeat_start;
448 gint section_repeat_end;
457 GMutex playback_lock;
459 /* repeat thread lock */
460 GCond repeat_thread_cond;
461 GMutex repeat_thread_mutex;
462 GThread* repeat_thread;
463 gboolean repeat_thread_exit;
465 /* next play thread */
466 GThread* next_play_thread;
467 gboolean next_play_thread_exit;
468 GCond next_play_thread_cond;
469 GMutex next_play_thread_mutex;
470 mm_player_gapless_t gapless;
473 GThread* capture_thread;
474 gboolean capture_thread_exit;
475 GCond capture_thread_cond;
476 GMutex capture_thread_mutex;
477 MMPlayerVideoCapture capture;
478 MMPlayerVideoColorspace video_cs;
479 MMVideoBuffer captured;
481 /* fakesink handling lock */
484 /* player attributes */
487 /* message callback */
488 MMMessageCallback msg_cb;
492 /* progressive download */
493 mm_player_pd_t *pd_downloader;
494 gchar *pd_file_save_path;
495 MMPlayerPDMode pd_mode;
497 /* streaming player */
498 mm_player_streaming_t *streamer;
500 /* gstreamer pipeline */
501 MMPlayerGstPipelineInfo *pipeline;
504 GstPad *ghost_pad_for_videobin;
506 guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX];
507 guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX];
508 mm_player_media_stream_buffer_status_callback media_stream_buffer_status_cb[MM_PLAYER_STREAM_TYPE_MAX];
509 mm_player_media_stream_seek_data_callback media_stream_seek_data_cb[MM_PLAYER_STREAM_TYPE_MAX];
511 void* buffer_cb_user_param;
513 /* video stream changed callback */
514 mm_player_stream_changed_callback video_stream_changed_cb;
515 void* video_stream_changed_cb_user_param;
517 /* audio stream changed callback */
518 mm_player_stream_changed_callback audio_stream_changed_cb;
519 void* audio_stream_changed_cb_user_param;
521 /* video stream callback */
522 mm_player_video_stream_callback video_stream_cb;
523 void* video_stream_cb_user_param;
524 int use_video_stream;
526 /* audio stram callback */
527 mm_player_audio_stream_callback audio_stream_cb;
528 void* audio_stream_cb_user_param;
529 bool audio_stream_sink_sync;
531 /* audio buffer callback */
532 mm_player_audio_stream_callback_ex audio_stream_render_cb_ex;
534 /* video capture callback*/
535 gulong video_capture_cb_probe_id;
537 /* video frame render error callback */
538 mm_player_video_frame_render_error_callback video_frame_render_error_cb;
539 void* video_frame_render_error_cb_user_param;
542 MMPlayerSoundInfo sound;
547 /* video stream caps parsed by demuxer */
548 GstCaps* v_stream_caps;
550 /* audio effect infomation */
551 MMAudioEffectInfo audio_effect_info;
552 gboolean bypass_audio_effect;
554 gulong audio_cb_probe_id;
555 gulong video_cb_probe_id;
560 /* content profile */
561 MMPlayerParseProfile profile;
563 /* streaming service type */
564 MMStreamingType streaming_type;
568 gboolean have_dynamic_pad;
569 GList* parsers; // list of linked parser name
570 GList* audio_decoders; // list of linked audio name
571 gboolean no_more_pad;
572 gint num_dynamic_pad;
573 gboolean has_many_types;
575 /* progress callback timer */
576 /* FIXIT : since duplicated functionality with get_position
577 * this function will be deprecated after fixing all application
578 * which are using it.
580 guint progress_timer;
582 /* timer for sending delayed EOS */
585 /* last point (msec) that player is paused or seeking */
586 gint64 last_position;
591 /* data size of http streaming */
592 guint64 http_content_size;
595 gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
597 gboolean smooth_streaming;
599 gint videodec_linked;
600 gint audiodec_linked;
601 gint videosink_linked;
602 gint audiosink_linked;
603 gint textsink_linked;
605 /* missing plugin during autoplugging */
606 MissingCodec not_supported_codec;
608 /*unlinked audio/video mime type */
609 gchar *unlinked_video_mime;
610 gchar *unlinked_audio_mime;
611 gchar *unlinked_demuxer_mime;
613 /* found codec during autoplugging */
614 FoundCodec can_support_codec;
616 gboolean not_found_demuxer;
618 /* support seek even though player is not start */
619 MMPlayerPendingSeek pending_seek;
623 /* prevent to post msg over and over */
626 /* list of sink elements */
627 GList* sink_elements;
629 /* signal notifiers */
630 GList* signals[MM_PLAYER_SIGNAL_TYPE_MAX];
632 MMPlayerGMainContext context;
633 MMPlayerUriList uri_info;
635 gboolean is_sound_extraction;
637 gfloat playback_rate;
639 /* player state resumed by fast rewind */
640 gboolean resumed_by_rewind;
642 gboolean is_nv12_tiled;
643 gboolean is_drm_file;
645 /* resource manager for H/W resources */
646 MMPlayerResourceManager resource_manager;
648 /* sound focus for being compatible with legacy session policy internally */
649 MMPlayerSoundFocus sound_focus;
651 gboolean is_subtitle_off;
652 gboolean is_external_subtitle_present;
654 /* contents bitrate for buffering management */
655 guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
657 guint updated_bitrate_count;
658 guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
659 guint total_maximum_bitrate;
660 guint updated_maximum_bitrate_count;
662 /* prevent it from posting duplicatly*/
665 /* timeout source for lazy pause */
666 guint lazy_pause_event_id;
667 guint resume_event_id;
668 guint resumable_cancel_id;
670 gboolean keep_detecting_vcodec;
672 gboolean play_subtitle;
673 gboolean use_textoverlay;
674 gboolean is_subtitle_force_drop; // set TRUE after bus_cb get EOS
676 /* PD downloader message callback and param */
677 MMMessageCallback pd_msg_cb;
678 void* pd_msg_cb_param;
680 /* adjust subtitle position store */
681 gint64 adjust_subtitle_pos;
682 GList *subtitle_language_list;
684 /* To store the current multiwindow status */
685 gboolean last_multiwin_status;
687 /* To store the current running audio pad index of demuxer */
688 gint demux_pad_index;
690 mm_player_selector_t selector[MM_PLAYER_TRACK_TYPE_MAX];
691 mm_player_selector_t audio_mode;
692 gboolean use_deinterleave;
693 guint max_audio_channels;
695 guint internal_text_idx;
696 guint external_text_idx;
698 MMPlayerSetMode set_mode;
701 gboolean use_decodebin;
703 /* initialize values */
706 /* check to use h/w codec */
707 GstCaps* state_tune_caps;
708 gboolean ignore_asyncdone;
710 /* video share sync */
711 gint64 video_share_api_delta;
712 gint64 video_share_clock_delta;
714 /* just for native app (video hub) */
715 gboolean video_hub_download_mode;
716 gboolean sync_handler;
718 /* store dump pad list */
721 /* whether a video has closed caption or not */
722 gboolean has_closed_caption;
724 GstElement *video_fakesink;
726 /* audio stream caps parsed by demuxer or set by external demuxer */
727 GstCaps* a_stream_caps;
729 /* subtitle stream caps parsed by demuxer or set by external demuxer */
730 GstCaps* s_stream_caps;
732 /*es player using feed-data callback or calling app_src_push_buffer directly*/
733 gboolean es_player_push_mode;
735 /* tmb buffer manager for s/w codec tmb_bo */
744 gchar *language_code;
752 gulong probe_handle_id;
753 FILE *dump_element_file;
761 int valid_type; // validity type
762 int value_min; //<- set validity value range
766 /*===========================================================================================
768 | GLOBAL FUNCTION PROTOTYPES |
770 ========================================================================================== */
775 int _mmplayer_create_player(MMHandleType hplayer);
776 int _mmplayer_destroy(MMHandleType hplayer);
777 int _mmplayer_realize(MMHandleType hplayer);
778 int _mmplayer_unrealize(MMHandleType hplayer);
779 int _mmplayer_get_state(MMHandleType hplayer, int* pstate);
780 int _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume);
781 int _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType *volume);
782 int _mmplayer_set_mute(MMHandleType hplayer, int mute);
783 int _mmplayer_get_mute(MMHandleType hplayer, int* pmute);
784 int _mmplayer_start(MMHandleType hplayer);
785 int _mmplayer_stop(MMHandleType hplayer);
786 int _mmplayer_pause(MMHandleType hplayer);
787 int _mmplayer_resume(MMHandleType hplayer);
788 int _mmplayer_set_position(MMHandleType hplayer, int format, int pos);
789 int _mmplayer_get_position(MMHandleType hplayer, int format, unsigned long *pos);
790 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format, int pos);
791 int _mmplayer_adjust_video_postion(MMHandleType hplayer,int offset);
792 int _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, unsigned long end);
793 int _mmplayer_deactivate_section_repeat(MMHandleType hplayer);
794 int _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size);
795 int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming);
796 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
797 int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
798 int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
799 int _mmplayer_set_videostream_cb(MMHandleType hplayer,mm_player_video_stream_callback callback, void *user_param);
800 int _mmplayer_set_audiostream_cb(MMHandleType hplayer,mm_player_audio_stream_callback callback, void *user_param);
801 int _mmplayer_set_videoframe_render_error_cb(MMHandleType hplayer, mm_player_video_frame_render_error_callback callback, void *user_param);
802 int _mmplayer_set_subtitle_silent (MMHandleType hplayer, int silent);
803 int _mmplayer_get_subtitle_silent (MMHandleType hplayer, int* silent);
804 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filepath);
805 int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos);
807 /* test API for tuning audio gain. this API should be
808 * deprecated before the day of final release
810 int _mmplayer_set_volume_tune(MMHandleType hplayer, MMPlayerVolumeType volume);
811 int _mmplayer_update_video_param(mm_player_t* player);
812 int _mmplayer_set_audiobuffer_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
813 int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
814 int _mmplayer_audio_effect_custom_apply(mm_player_t *player);
816 int _mmplayer_set_audiostream_cb_ex(MMHandleType hplayer, bool sync, mm_player_audio_stream_callback_ex callback, void *user_param);
817 gboolean __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessageParamType* param);
819 int _mmplayer_gst_set_audio_channel(MMHandleType hplayer, MMPlayerAudioChannel ch_idx);
820 int _mmplayer_change_track_language (MMHandleType hplayer, MMPlayerTrackType type, int index);
821 int _mmplayer_sync_subtitle_pipeline(mm_player_t* player);
822 int _mmplayer_set_prepare_buffering_time(MMHandleType hplayer, int second);
823 int _mmplayer_set_runtime_buffering_mode(MMHandleType hplayer, MMPlayerBufferingMode mode, int second);
824 int _mmplayer_set_display_zoom(MMHandleType hplayer, float level, int x, int y);
825 int _mmplayer_get_display_zoom(MMHandleType hplayer, float *level, int *x, int *y);
826 int _mmplayer_set_video_hub_download_mode(MMHandleType hplayer, bool mode);
827 int _mmplayer_use_system_clock (MMHandleType hplayer);
828 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);
829 int _mmplayer_get_video_share_master_clock(MMHandleType hplayer, long long *video_time, long long *media_clock, long long *audio_time);
830 int _mmplayer_get_video_rotate_angle(MMHandleType hplayer, int *angle);
831 int _mmplayer_enable_sync_handler(MMHandleType hplayer, bool enable);
832 int _mmplayer_set_uri(MMHandleType hplayer, const char* uri);
833 int _mmplayer_set_next_uri(MMHandleType hplayer, const char* uri, bool is_first_path);
834 int _mmplayer_get_next_uri(MMHandleType hplayer, char** uri);
835 int _mmplayer_has_closed_caption(MMHandleType hplayer, bool* exist);
836 int _mmplayer_enable_media_packet_video_stream(MMHandleType hplayer, bool enable);
837 void * _mm_player_media_packet_video_stream_internal_buffer_ref(void *buffer);
838 void _mm_player_media_packet_video_stream_internal_buffer_unref(void *buffer);
839 int _mmplayer_set_pcm_spec(MMHandleType hplayer, int samplerate, int channel);
840 int __mmplayer_gst_set_state (mm_player_t* player, GstElement * pipeline, GstState state, gboolean async, gint timeout );
841 int __mmplayer_set_state(mm_player_t* player, int state);
842 int __mmplayer_check_state(mm_player_t* player, enum PlayerCommandState command);
843 gboolean __mmplayer_dump_pipeline_state( mm_player_t* player );
844 void __mmplayer_remove_g_source_from_context(GMainContext *context, guint source_id);
846 const gchar * __get_state_name ( int state );
847 gboolean __mmplayer_can_do_interrupt(mm_player_t *player);
848 gboolean __is_streaming( mm_player_t* player );
849 gboolean __is_rtsp_streaming( mm_player_t* player );
850 gboolean __is_wfd_streaming( mm_player_t* player );
851 gboolean __is_live_streaming ( mm_player_t* player );
852 gboolean __is_http_streaming( mm_player_t* player );
853 gboolean __is_http_live_streaming( mm_player_t* player );
854 gboolean __is_dash_streaming( mm_player_t* player );
855 gboolean __is_smooth_streaming( mm_player_t* player );
856 gboolean __is_http_progressive_down(mm_player_t* player);
858 gboolean __mmplayer_check_useful_message(mm_player_t *player, GstMessage * message);
859 gboolean __mmplayer_handle_gst_error ( mm_player_t* player, GstMessage * message, GError* error );
860 gint __gst_handle_core_error( mm_player_t* player, int code );
861 gint __gst_handle_library_error( mm_player_t* player, int code );
862 gint __gst_handle_resource_error( mm_player_t* player, int code );
863 gint __gst_handle_stream_error( mm_player_t* player, GError* error, GstMessage * message );
864 int _mmplayer_set_shm_stream_path(MMHandleType hplayer, const char *path);
865 int _mmplayer_get_raw_video_caps(mm_player_t *player, char **caps);
866 int _mmplayer_sound_register_with_pid(MMHandleType hplayer, int pid);
867 int _mmplayer_is_streaming(MMHandleType hplayer, bool* is_streaming);
868 int __mmplayer_get_video_angle(mm_player_t* player, int *user_angle, int *org_angle);
873 #endif /* __MM_PLAYER_PRIV_H__ */