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 ---------------------------------------------------------------------------*/
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 ---------------------------------------------------------------------------*/
85 AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */
86 AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */
87 AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */
91 TAG_AUDIO_CODEC = 0x0001,
92 TAG_VIDEO_CODEC = 0x0002,
97 TAG_COPYRIGHT = 0x0040,
99 TAG_DESCRIPTION = 0x0100,
100 TAG_TRACK_NUMBER = 0x0200
103 enum content_attr_flag {
104 ATTR_MISSING_ONLY = 0x0001,
105 ATTR_DURATION = 0x0002,
108 ATTR_BITRATE = 0x0010,
112 /* async mode makes trouble. alsasink sometimes fails to pause. */
119 * Enumerations of Player Uri type
121 enum MMPlayerUriType {
122 MM_PLAYER_URI_TYPE_NONE, /**< Player URI type None */
123 MM_PLAYER_URI_TYPE_URL_RTSP, /**< Player URI type RTSP */
124 MM_PLAYER_URI_TYPE_URL_WFD, /**< Player URI type WFD */
125 MM_PLAYER_URI_TYPE_URL_HTTP, /**< Player URI type HTTP */
126 MM_PLAYER_URI_TYPE_URL_MMS, /**< Player URI type MMS */
127 MM_PLAYER_URI_TYPE_MEM, /**< Player URI type Mem */
128 MM_PLAYER_URI_TYPE_FILE, /**< Player URI type File */
129 MM_PLAYER_URI_TYPE_URL, /**< Player URI type URL */
130 MM_PLAYER_URI_TYPE_MS_BUFF, /**< Player URI type Media Stream Buffer */
131 MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */
132 MM_PLAYER_URI_TYPE_SS, /**< Player URI type Smooth streaming */
133 MM_PLAYER_URI_TYPE_DASH, /**< Player URI type Mpeg Dash */
134 MM_PLAYER_URI_TYPE_NO_PERMISSION, /**< Player URI type No Permission */
135 MM_PLAYER_URI_TYPE_TEMP, /**< Player URI type Temp */
138 typedef enum _MissingCodec {
139 MISSING_PLUGIN_NONE = 0x00,
140 MISSING_PLUGIN_AUDIO = 0x01,
141 MISSING_PLUGIN_VIDEO = 0x02
145 typedef enum _FoundCodec {
146 FOUND_PLUGIN_NONE = 0x00,
147 FOUND_PLUGIN_AUDIO = 0x01,
148 FOUND_PLUGIN_VIDEO = 0x02
152 * Enumeration of signal type
155 MM_PLAYER_SIGNAL_TYPE_AUTOPLUG = 0,
156 MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
157 MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
158 MM_PLAYER_SIGNAL_TYPE_TEXTBIN,
159 MM_PLAYER_SIGNAL_TYPE_OTHERS,
160 MM_PLAYER_SIGNAL_TYPE_ALL,
161 MM_PLAYER_SIGNAL_TYPE_MAX = MM_PLAYER_SIGNAL_TYPE_ALL,
162 } MMPlayerSignalType;
164 /* main pipeline's element id */
166 MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
168 MMPLAYER_M_2ND_SRC, /* 2nd Source Element for es buff src */
171 /* it could be a decodebin or could be a typefind. depends on player ini */
175 MMPLAYER_M_AUTOPLUG_V_DEC,
176 MMPLAYER_M_AUTOPLUG_A_DEC,
178 /* NOTE : we need two fakesink to autoplug without decodebin.
179 * first one will hold whole pipeline state. and second one will hold state of
180 * a sink-decodebin for an elementary stream. no metter if there's more then one
181 * elementary streams because MSL reuse it.
183 MMPLAYER_M_SRC_FAKESINK,
184 MMPLAYER_M_SRC_2ND_FAKESINK,
186 /* streaming plugin */
187 MMPLAYER_M_MUXED_S_BUFFER,
188 MMPLAYER_M_DEMUXED_S_BUFFER,
191 /* es buff src queue */
196 /* FIXIT : if there's really no usage for following IDs. remove it */
204 MMPLAYER_M_V_INPUT_SELECTOR, // video input_select
205 MMPLAYER_M_A_INPUT_SELECTOR, // audio input_select
206 MMPLAYER_M_T_INPUT_SELECTOR, // text input_select
212 MMPLAYER_M_A_DEINTERLEAVE,
213 MMPLAYER_M_A_SELECTOR,
219 /* audio pipeline's element id */
220 enum AudioElementID {
221 MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */
226 MMPLAYER_A_FILTER_SEC,
227 MMPLAYER_A_CAPS_DEFAULT,
229 MMPLAYER_A_RESAMPLER,
230 MMPLAYER_A_DEINTERLEAVE,
234 /* video pipeline's element id */
235 enum VideoElementID {
236 MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
245 /* text pipeline's element id */
247 MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
249 MMPLAYER_T_VIDEO_QUEUE,
250 MMPLAYER_T_VIDEO_CONVERTER,
252 MMPLAYER_T_FAKE_SINK,
257 /* midi main pipeline's element id */
260 MMPLAYER_MIDI_PLAYER,
264 enum PlayerCommandState {
265 MMPLAYER_COMMAND_NONE,
266 MMPLAYER_COMMAND_CREATE,
267 MMPLAYER_COMMAND_DESTROY,
268 MMPLAYER_COMMAND_UNREALIZE,
269 MMPLAYER_COMMAND_START,
270 MMPLAYER_COMMAND_REALIZE,
271 MMPLAYER_COMMAND_STOP,
272 MMPLAYER_COMMAND_PAUSE,
273 MMPLAYER_COMMAND_RESUME,
277 /* Note : StreamingSrcError is error enum for streaming source which post error message
278 * using custom message made by itself. The enum value must start with zero,
279 * because the streaming source(secrtspsrc) also does.
281 enum StreamingSrcError {
282 MMPLAYER_STREAMING_ERROR_NONE = 0,
283 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
284 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
285 MMPLAYER_STREAMING_ERROR_CONNECTION_FAIL,
286 MMPLAYER_STREAMING_ERROR_DNS_FAIL,
287 MMPLAYER_STREAMING_ERROR_SERVER_DISCONNECTED,
288 MMPLAYER_STREAMING_ERROR_BAD_SERVER,
289 MMPLAYER_STREAMING_ERROR_INVALID_PROTOCOL,
290 MMPLAYER_STREAMING_ERROR_INVALID_URL,
291 MMPLAYER_STREAMING_ERROR_UNEXPECTED_MSG,
292 MMPLAYER_STREAMING_ERROR_OUT_OF_MEMORIES,
293 MMPLAYER_STREAMING_ERROR_RTSP_TIMEOUT,
294 MMPLAYER_STREAMING_ERROR_BAD_REQUEST,
295 MMPLAYER_STREAMING_ERROR_NOT_AUTHORIZED,
296 MMPLAYER_STREAMING_ERROR_PAYMENT_REQUIRED,
297 MMPLAYER_STREAMING_ERROR_FORBIDDEN,
298 MMPLAYER_STREAMING_ERROR_CONTENT_NOT_FOUND,
299 MMPLAYER_STREAMING_ERROR_METHOD_NOT_ALLOWED,
300 MMPLAYER_STREAMING_ERROR_NOT_ACCEPTABLE,
301 MMPLAYER_STREAMING_ERROR_PROXY_AUTHENTICATION_REQUIRED,
302 MMPLAYER_STREAMING_ERROR_SERVER_TIMEOUT,
303 MMPLAYER_STREAMING_ERROR_GONE,
304 MMPLAYER_STREAMING_ERROR_LENGTH_REQUIRED,
305 MMPLAYER_STREAMING_ERROR_PRECONDITION_FAILED,
306 MMPLAYER_STREAMING_ERROR_REQUEST_ENTITY_TOO_LARGE,
307 MMPLAYER_STREAMING_ERROR_REQUEST_URI_TOO_LARGE,
308 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_MEDIA_TYPE,
309 MMPLAYER_STREAMING_ERROR_PARAMETER_NOT_UNDERSTOOD,
310 MMPLAYER_STREAMING_ERROR_CONFERENCE_NOT_FOUND,
311 MMPLAYER_STREAMING_ERROR_NOT_ENOUGH_BANDWIDTH,
312 MMPLAYER_STREAMING_ERROR_NO_SESSION_ID,
313 MMPLAYER_STREAMING_ERROR_METHOD_NOT_VALID_IN_THIS_STATE,
314 MMPLAYER_STREAMING_ERROR_HEADER_FIELD_NOT_VALID_FOR_SOURCE,
315 MMPLAYER_STREAMING_ERROR_INVALID_RANGE,
316 MMPLAYER_STREAMING_ERROR_PARAMETER_IS_READONLY,
317 MMPLAYER_STREAMING_ERROR_AGGREGATE_OP_NOT_ALLOWED,
318 MMPLAYER_STREAMING_ERROR_ONLY_AGGREGATE_OP_ALLOWED,
319 MMPLAYER_STREAMING_ERROR_BAD_TRANSPORT,
320 MMPLAYER_STREAMING_ERROR_DESTINATION_UNREACHABLE,
321 MMPLAYER_STREAMING_ERROR_INTERNAL_SERVER_ERROR,
322 MMPLAYER_STREAMING_ERROR_NOT_IMPLEMENTED,
323 MMPLAYER_STREAMING_ERROR_BAD_GATEWAY,
324 MMPLAYER_STREAMING_ERROR_SERVICE_UNAVAILABLE,
325 MMPLAYER_STREAMING_ERROR_GATEWAY_TIME_OUT ,
326 MMPLAYER_STREAMING_ERROR_RTSP_VERSION_NOT_SUPPORTED,
327 MMPLAYER_STREAMING_ERROR_OPTION_NOT_SUPPORTED,
331 MMPLAYER_PATH_VOD = 0,
336 /*---------------------------------------------------------------------------
337 | GLOBAL DATA TYPE DEFINITIONS: |
338 ---------------------------------------------------------------------------*/
343 } MMPlayerGstElement;
346 GstTagList *tag_list;
347 MMPlayerGstElement *mainbin;
348 MMPlayerGstElement *audiobin;
349 MMPlayerGstElement *videobin;
350 MMPlayerGstElement *textbin;
351 } MMPlayerGstPipelineInfo;
356 int bluetooth; /* enable/disable */
364 } tBuffer; /* FIXIT : choose better name */
371 char uri[MM_MAX_URL_LEN];
372 char urgent[MM_MAX_FILENAME_LEN];
373 } MMPlayerParseProfile;
377 storage_state_e state;
379 } MMPlayerStorageInfo;
383 MMPlayerPosFormatType format;
385 } MMPlayerPendingSeek;
390 } MMPlayerSignalItem;
396 bool video_zc; // video zero-copy
398 bool media_packet_video_stream;
402 GMainContext *global_default;
403 GMainContext *thread_default;
404 } MMPlayerGMainContext;
412 gint active_pad_index;
413 gint total_track_num;
416 gulong event_probe_id;
417 } mm_player_selector_t;
422 gboolean stream_changed;
423 gboolean reconfigure;
425 GstClockTime start_time[MM_PLAYER_TRACK_TYPE_MAX]; /* updated once get SEGMENT event */
426 GstSegment segment[MM_PLAYER_TRACK_TYPE_MAX];
427 gboolean update_segment[MM_PLAYER_TRACK_TYPE_MAX];
429 } mm_player_gapless_t;
435 bool is_little_endian;
436 guint64 channel_mask;
440 } mm_player_audio_stream_buff_t;
443 * @brief data of video_bo_list
444 * @details this will be used when the sw codec is running.
450 } mm_player_video_bo_info_t;
454 int state; // player current state
455 int prev_state; // player previous state
456 int pending_state; // player state which is going to now
457 int target_state; // player state which user want to go to
458 guint state_change_timeout;
460 gboolean section_repeat;
461 gint section_repeat_start;
462 gint section_repeat_end;
471 GMutex playback_lock;
473 /* repeat thread lock */
474 GCond repeat_thread_cond;
475 GMutex repeat_thread_mutex;
476 GThread* repeat_thread;
477 gboolean repeat_thread_exit;
479 /* next play thread */
480 GThread* next_play_thread;
481 gboolean next_play_thread_exit;
482 GCond next_play_thread_cond;
483 GMutex next_play_thread_mutex;
484 mm_player_gapless_t gapless;
487 GThread* capture_thread;
488 gboolean capture_thread_exit;
489 GCond capture_thread_cond;
490 GMutex capture_thread_mutex;
491 MMPlayerVideoCapture capture;
492 MMPlayerVideoColorspace video_cs;
493 MMVideoBuffer captured;
495 /* fakesink handling lock */
498 /* update tag lock */
499 GMutex update_tag_lock;
501 /* player attributes */
504 /* message callback */
505 MMMessageCallback msg_cb;
508 /* progressive download */
509 mm_player_pd_t *pd_downloader;
510 gchar *pd_file_save_path;
511 MMPlayerPDMode pd_mode;
513 /* streaming player */
514 mm_player_streaming_t *streamer;
515 gchar *http_file_buffering_path;
517 /* gstreamer pipeline */
518 MMPlayerGstPipelineInfo *pipeline;
521 GstPad *ghost_pad_for_videobin;
523 guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX];
524 guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX];
525 mm_player_media_stream_buffer_status_callback media_stream_buffer_status_cb[MM_PLAYER_STREAM_TYPE_MAX];
526 mm_player_media_stream_seek_data_callback media_stream_seek_data_cb[MM_PLAYER_STREAM_TYPE_MAX];
527 GMutex media_stream_cb_lock;
529 int video_num_buffers; /* total num of buffers in vcodec */
530 int video_extra_num_buffers; /* extra num of buffers in vcodec */
532 void* buffer_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
533 void* seek_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
535 /* video stream changed callback */
536 mm_player_stream_changed_callback video_stream_changed_cb;
537 void* video_stream_changed_cb_user_param;
539 /* audio stream changed callback */
540 mm_player_stream_changed_callback audio_stream_changed_cb;
541 void* audio_stream_changed_cb_user_param;
543 /* video stream callback */
544 mm_player_video_stream_callback video_stream_cb;
545 void* video_stream_cb_user_param;
547 GMutex video_bo_mutex;
548 GList* video_bo_list; /* mm_player_video_bo_info_t, bo list for decoded video data by sw codec */
550 bool video_stream_prerolled;
552 /* audio stram callback */
553 mm_player_audio_stream_callback audio_stream_cb;
554 void* audio_stream_cb_user_param;
555 bool audio_stream_sink_sync;
556 GList* audio_stream_buff_list; /* mm_player_audio_stream_buff_t, buff list of extract pcm data */
558 /* audio buffer callback */
559 mm_player_audio_stream_callback_ex audio_stream_render_cb_ex;
561 /* video capture callback*/
562 gulong video_capture_cb_probe_id;
565 MMPlayerSoundInfo sound;
570 /* video stream caps parsed by demuxer */
571 GstCaps* v_stream_caps;
573 /* audio effect infomation */
574 MMAudioEffectInfo audio_effect_info;
575 gboolean bypass_audio_effect;
577 gulong audio_cb_probe_id;
582 /* content profile */
583 MMPlayerParseProfile profile;
584 MMPlayerStorageInfo storage_info[MMPLAYER_PATH_MAX];
586 /* streaming service type */
587 MMStreamingType streaming_type;
591 gboolean have_dynamic_pad;
592 GList* parsers; // list of linked parser name
593 GList* audio_decoders; // list of linked audio name
594 gboolean no_more_pad;
595 gint num_dynamic_pad;
596 gboolean has_many_types;
598 /* progress callback timer */
599 /* FIXIT : since duplicated functionality with get_position
600 * this function will be deprecated after fixing all application
601 * which are using it.
603 guint progress_timer;
605 /* timer for sending delayed EOS */
608 /* last point (msec) that player is paused or seeking */
609 gint64 last_position;
614 /* data size of http streaming */
615 guint64 http_content_size;
618 gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
620 gboolean smooth_streaming;
622 gint videodec_linked;
623 gint audiodec_linked;
624 gint videosink_linked;
625 gint audiosink_linked;
626 gint textsink_linked;
628 /* missing plugin during autoplugging */
629 MissingCodec not_supported_codec;
631 /* unlinked audio/video mime type */
632 gchar *unlinked_video_mime;
633 gchar *unlinked_audio_mime;
634 gchar *unlinked_demuxer_mime;
636 /* found codec during autoplugging */
637 FoundCodec can_support_codec;
639 gboolean not_found_demuxer;
641 /* support seek even though player is not start */
642 MMPlayerPendingSeek pending_seek;
646 /* prevent to post msg over and over */
649 /* list of sink elements */
650 GList* sink_elements;
652 /* signal notifiers */
653 GList* signals[MM_PLAYER_SIGNAL_TYPE_MAX];
655 MMPlayerGMainContext context;
656 MMPlayerUriList uri_info;
658 gboolean is_sound_extraction;
660 gfloat playback_rate;
662 /* player state resumed by fast rewind */
663 gboolean resumed_by_rewind;
665 gboolean is_nv12_tiled;
667 /* resource manager for H/W resources */
668 MMPlayerResourceManager resource_manager;
670 /* sound focus for being compatible with legacy session policy internally */
671 MMPlayerSoundFocus sound_focus;
673 gboolean is_subtitle_off;
674 gboolean is_external_subtitle_present;
675 gboolean is_external_subtitle_added_now;
676 gboolean pending_resume;
678 /* contents bitrate for buffering management */
679 guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
681 guint updated_bitrate_count;
682 guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
683 guint total_maximum_bitrate;
684 guint updated_maximum_bitrate_count;
686 /* prevent it from posting duplicatly*/
689 /* timeout source for lazy pause */
690 guint lazy_pause_event_id;
691 guint resume_event_id;
692 guint resumable_cancel_id;
694 gboolean keep_detecting_vcodec;
696 gboolean play_subtitle;
697 gboolean is_subtitle_force_drop; // set TRUE after bus_cb get EOS
699 /* PD downloader message callback and param */
700 MMMessageCallback pd_msg_cb;
701 void* pd_msg_cb_param;
703 /* adjust subtitle position store */
704 gint64 adjust_subtitle_pos;
705 GList *subtitle_language_list;
707 /* To store the current multiwindow status */
708 gboolean last_multiwin_status;
710 /* To store the current running audio pad index of demuxer */
711 gint demux_pad_index;
713 mm_player_selector_t selector[MM_PLAYER_TRACK_TYPE_MAX];
714 mm_player_selector_t audio_mode;
715 gboolean use_deinterleave;
716 guint max_audio_channels;
718 guint internal_text_idx;
719 guint external_text_idx;
721 MMPlayerSetMode set_mode;
724 gboolean use_decodebin;
726 /* initialize values */
729 /* check to use h/w codec */
730 GstCaps* state_tune_caps;
731 gboolean ignore_asyncdone;
733 /* video share sync */
734 gint64 video_share_api_delta;
735 gint64 video_share_clock_delta;
737 /* just for native app (video hub) */
738 gboolean video_hub_download_mode;
739 gboolean sync_handler;
741 /* store dump pad list */
744 /* whether a video has closed caption or not */
745 gboolean has_closed_caption;
747 GstElement *video_fakesink;
749 /* audio stream caps parsed by demuxer or set by external demuxer */
750 GstCaps* a_stream_caps;
752 /* subtitle stream caps parsed by demuxer or set by external demuxer */
753 GstCaps* s_stream_caps;
755 /* es player using feed-data callback or calling app_src_push_buffer directly*/
756 gboolean es_player_push_mode;
758 /* tmb buffer manager for s/w codec tmb_bo */
766 gchar *language_code;
769 } MMPlayerLangStruct;
773 gulong probe_handle_id;
774 FILE *dump_element_file;
782 int valid_type; // validity type
783 int value_min; //<- set validity value range
787 /*===========================================================================================
789 | GLOBAL FUNCTION PROTOTYPES |
791 ========================================================================================== */
796 int _mmplayer_create_player(MMHandleType hplayer);
797 int _mmplayer_destroy(MMHandleType hplayer);
798 int _mmplayer_realize(MMHandleType hplayer);
799 int _mmplayer_unrealize(MMHandleType hplayer);
800 int _mmplayer_get_state(MMHandleType hplayer, int* pstate);
801 int _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume);
802 int _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType *volume);
803 int _mmplayer_set_mute(MMHandleType hplayer, int mute);
804 int _mmplayer_get_mute(MMHandleType hplayer, int* pmute);
805 int _mmplayer_start(MMHandleType hplayer);
806 int _mmplayer_stop(MMHandleType hplayer);
807 int _mmplayer_pause(MMHandleType hplayer);
808 int _mmplayer_resume(MMHandleType hplayer);
809 int _mmplayer_set_position(MMHandleType hplayer, int format, int pos);
810 int _mmplayer_get_position(MMHandleType hplayer, int format, unsigned long *pos);
811 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format, int pos);
812 int _mmplayer_adjust_video_postion(MMHandleType hplayer, int offset);
813 int _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, unsigned long end);
814 int _mmplayer_deactivate_section_repeat(MMHandleType hplayer);
815 int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming);
816 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
817 int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
818 int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
819 int _mmplayer_set_videostream_cb(MMHandleType hplayer, mm_player_video_stream_callback callback, void *user_param);
820 int _mmplayer_set_audiostream_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
821 int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent);
822 int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int* silent);
823 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filepath);
824 int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos);
826 /* test API for tuning audio gain. this API should be
827 * deprecated before the day of final release
829 int _mmplayer_set_volume_tune(MMHandleType hplayer, MMPlayerVolumeType volume);
830 int _mmplayer_update_video_param(mm_player_t* player, char *param_name);
831 int _mmplayer_set_audiobuffer_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
832 int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
833 int _mmplayer_audio_effect_custom_apply(mm_player_t *player);
835 int _mmplayer_set_audiostream_cb_ex(MMHandleType hplayer, bool sync, mm_player_audio_stream_callback_ex callback, void *user_param);
836 gboolean __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessageParamType* param);
838 int _mmplayer_gst_set_audio_channel(MMHandleType hplayer, MMPlayerAudioChannel ch_idx);
839 int _mmplayer_change_track_language(MMHandleType hplayer, MMPlayerTrackType type, int index);
840 int _mmplayer_sync_subtitle_pipeline(mm_player_t* player);
841 int _mmplayer_set_prepare_buffering_time(MMHandleType hplayer, int second);
842 int _mmplayer_set_runtime_buffering_mode(MMHandleType hplayer, MMPlayerBufferingMode mode, int second);
843 int _mmplayer_set_display_zoom(MMHandleType hplayer, float level, int x, int y);
844 int _mmplayer_get_display_zoom(MMHandleType hplayer, float *level, int *x, int *y);
845 int _mmplayer_set_video_hub_download_mode(MMHandleType hplayer, bool mode);
846 int _mmplayer_use_system_clock(MMHandleType hplayer);
847 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);
848 int _mmplayer_get_video_share_master_clock(MMHandleType hplayer, long long *video_time, long long *media_clock, long long *audio_time);
849 int _mmplayer_get_video_rotate_angle(MMHandleType hplayer, int *angle);
850 int _mmplayer_enable_sync_handler(MMHandleType hplayer, bool enable);
851 int _mmplayer_set_file_buffering_path(MMHandleType hplayer, const char* file_path);
852 int _mmplayer_set_uri(MMHandleType hplayer, const char* uri);
853 int _mmplayer_set_next_uri(MMHandleType hplayer, const char* uri, bool is_first_path);
854 int _mmplayer_get_next_uri(MMHandleType hplayer, char** uri);
855 int _mmplayer_has_closed_caption(MMHandleType hplayer, bool* exist);
856 void * _mm_player_media_packet_video_stream_internal_buffer_ref(void *buffer);
857 void _mm_player_media_packet_video_stream_internal_buffer_unref(void *buffer);
858 int _mmplayer_set_pcm_spec(MMHandleType hplayer, int samplerate, int channel);
859 int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
860 int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num);
861 int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int state);
862 int __mmplayer_gst_set_state(mm_player_t* player, GstElement * pipeline, GstState state, gboolean async, gint timeout);
863 int __mmplayer_set_state(mm_player_t* player, int state);
864 int __mmplayer_check_state(mm_player_t* player, enum PlayerCommandState command);
865 gboolean __mmplayer_dump_pipeline_state(mm_player_t* player);
866 void __mmplayer_remove_g_source_from_context(GMainContext *context, guint source_id);
868 const gchar * __get_state_name(int state);
869 gboolean __mmplayer_can_do_interrupt(mm_player_t *player);
870 gboolean __is_streaming(mm_player_t* player);
871 gboolean __is_rtsp_streaming(mm_player_t* player);
872 gboolean __is_wfd_streaming(mm_player_t* player);
873 gboolean __is_live_streaming(mm_player_t* player);
874 gboolean __is_http_streaming(mm_player_t* player);
875 gboolean __is_http_live_streaming(mm_player_t* player);
876 gboolean __is_dash_streaming(mm_player_t* player);
877 gboolean __is_smooth_streaming(mm_player_t* player);
878 gboolean __is_http_progressive_down(mm_player_t* player);
880 gboolean __mmplayer_check_useful_message(mm_player_t *player, GstMessage * message);
881 gboolean __mmplayer_handle_gst_error(mm_player_t* player, GstMessage * message, GError* error);
882 gint __gst_handle_core_error(mm_player_t* player, int code);
883 gint __gst_handle_library_error(mm_player_t* player, int code);
884 gint __gst_handle_resource_error(mm_player_t* player, int code, GstMessage * message);
885 gint __gst_handle_stream_error(mm_player_t* player, GError* error, GstMessage * message);
886 int _mmplayer_sound_register_with_pid(MMHandleType hplayer, int pid);
887 int _mmplayer_get_client_pid(MMHandleType hplayer, int* pid);
888 int __mmplayer_get_video_angle(mm_player_t* player, int *user_angle, int *org_angle);
889 int _mmplayer_video_stream_release_bo(mm_player_t* player, void* bo);
895 #endif /* __MM_PLAYER_PRIV_H__ */