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_HTTP, /**< Player URI type HTTP */
125 MM_PLAYER_URI_TYPE_URL_MMS, /**< Player URI type MMS */
126 MM_PLAYER_URI_TYPE_MEM, /**< Player URI type Mem */
127 MM_PLAYER_URI_TYPE_FILE, /**< Player URI type File */
128 MM_PLAYER_URI_TYPE_URL, /**< Player URI type URL */
129 MM_PLAYER_URI_TYPE_MS_BUFF, /**< Player URI type Media Stream Buffer */
130 MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */
131 MM_PLAYER_URI_TYPE_SS, /**< Player URI type Smooth streaming */
132 MM_PLAYER_URI_TYPE_DASH, /**< Player URI type Mpeg Dash */
133 MM_PLAYER_URI_TYPE_NO_PERMISSION, /**< Player URI type No Permission */
134 MM_PLAYER_URI_TYPE_TEMP, /**< Player URI type Temp */
137 typedef enum _MissingCodec {
138 MISSING_PLUGIN_NONE = 0x00,
139 MISSING_PLUGIN_AUDIO = 0x01,
140 MISSING_PLUGIN_VIDEO = 0x02
144 typedef enum _FoundCodec {
145 FOUND_PLUGIN_NONE = 0x00,
146 FOUND_PLUGIN_AUDIO = 0x01,
147 FOUND_PLUGIN_VIDEO = 0x02
151 * Enumeration of signal type
154 MM_PLAYER_SIGNAL_TYPE_AUTOPLUG = 0,
155 MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
156 MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
157 MM_PLAYER_SIGNAL_TYPE_TEXTBIN,
158 MM_PLAYER_SIGNAL_TYPE_OTHERS,
159 MM_PLAYER_SIGNAL_TYPE_ALL,
160 MM_PLAYER_SIGNAL_TYPE_MAX = MM_PLAYER_SIGNAL_TYPE_ALL,
161 } MMPlayerSignalType;
163 /* main pipeline's element id */
165 MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
167 MMPLAYER_M_2ND_SRC, /* 2nd Source Element for es buff src */
170 /* it could be a decodebin or could be a typefind. depends on player ini */
174 MMPLAYER_M_AUTOPLUG_V_DEC,
175 MMPLAYER_M_AUTOPLUG_A_DEC,
177 /* NOTE : we need two fakesink to autoplug without decodebin.
178 * first one will hold whole pipeline state. and second one will hold state of
179 * a sink-decodebin for an elementary stream. no metter if there's more then one
180 * elementary streams because MSL reuse it.
182 MMPLAYER_M_SRC_FAKESINK,
183 MMPLAYER_M_SRC_2ND_FAKESINK,
185 /* streaming plugin */
186 MMPLAYER_M_MUXED_S_BUFFER,
187 MMPLAYER_M_DEMUXED_S_BUFFER,
189 MMPLAYER_M_ADAPTIVE_DEMUX,
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;
461 } MMAdaptiveVariantInfo;
465 int state; // player current state
466 int prev_state; // player previous state
467 int pending_state; // player state which is going to now
468 int target_state; // player state which user want to go to
469 guint state_change_timeout;
471 gboolean section_repeat;
472 gint section_repeat_start;
473 gint section_repeat_end;
482 GMutex playback_lock;
484 /* repeat thread lock */
485 GCond repeat_thread_cond;
486 GMutex repeat_thread_mutex;
487 GThread* repeat_thread;
488 gboolean repeat_thread_exit;
490 /* next play thread */
491 GThread* next_play_thread;
492 gboolean next_play_thread_exit;
493 GCond next_play_thread_cond;
494 GMutex next_play_thread_mutex;
495 mm_player_gapless_t gapless;
498 GThread* capture_thread;
499 gboolean capture_thread_exit;
500 GCond capture_thread_cond;
501 GMutex capture_thread_mutex;
502 MMPlayerVideoCapture capture;
503 MMPlayerVideoColorspace video_cs;
504 MMVideoBuffer captured;
506 /* fakesink handling lock */
509 /* update tag lock */
510 GMutex update_tag_lock;
512 /* player attributes */
515 /* message callback */
516 MMMessageCallback msg_cb;
519 /* progressive download */
520 mm_player_pd_t *pd_downloader;
521 gchar *pd_file_save_path;
522 MMPlayerPDMode pd_mode;
524 /* streaming player */
525 mm_player_streaming_t *streamer;
526 gchar *http_file_buffering_path;
528 /* gstreamer pipeline */
529 MMPlayerGstPipelineInfo *pipeline;
532 GstPad *ghost_pad_for_videobin;
534 guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX];
535 guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX];
536 mm_player_media_stream_buffer_status_callback media_stream_buffer_status_cb[MM_PLAYER_STREAM_TYPE_MAX];
537 mm_player_media_stream_seek_data_callback media_stream_seek_data_cb[MM_PLAYER_STREAM_TYPE_MAX];
538 GMutex media_stream_cb_lock;
540 int video_num_buffers; /* total num of buffers in vcodec */
541 int video_extra_num_buffers; /* extra num of buffers in vcodec */
543 void* buffer_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
544 void* seek_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
546 /* video stream changed callback */
547 mm_player_stream_changed_callback video_stream_changed_cb;
548 void* video_stream_changed_cb_user_param;
550 /* audio stream changed callback */
551 mm_player_stream_changed_callback audio_stream_changed_cb;
552 void* audio_stream_changed_cb_user_param;
554 /* video stream callback */
555 mm_player_video_stream_callback video_stream_cb;
556 void* video_stream_cb_user_param;
558 GMutex video_bo_mutex;
559 GList* video_bo_list; /* mm_player_video_bo_info_t, bo list for decoded video data by sw codec */
561 bool video_stream_prerolled;
563 /* audio stram callback */
564 mm_player_audio_stream_callback audio_stream_cb;
565 void* audio_stream_cb_user_param;
566 bool audio_stream_sink_sync;
567 GList* audio_stream_buff_list; /* mm_player_audio_stream_buff_t, buff list of extract pcm data */
569 /* audio buffer callback */
570 mm_player_audio_stream_callback_ex audio_stream_render_cb_ex;
572 /* video capture callback*/
573 gulong video_capture_cb_probe_id;
576 MMPlayerSoundInfo sound;
581 /* video stream caps parsed by demuxer */
582 GstCaps* v_stream_caps;
584 /* audio effect infomation */
585 MMAudioEffectInfo audio_effect_info;
586 gboolean bypass_audio_effect;
588 gulong audio_cb_probe_id;
593 /* content profile */
594 MMPlayerParseProfile profile;
595 MMPlayerStorageInfo storage_info[MMPLAYER_PATH_MAX];
597 /* streaming service type */
598 MMStreamingType streaming_type;
602 gboolean have_dynamic_pad;
603 GList* parsers; // list of linked parser name
604 GList* audio_decoders; // list of linked audio name
605 gboolean no_more_pad;
606 gint num_dynamic_pad;
607 gboolean has_many_types;
609 /* progress callback timer */
610 /* FIXIT : since duplicated functionality with get_position
611 * this function will be deprecated after fixing all application
612 * which are using it.
614 guint progress_timer;
616 /* timer for sending delayed EOS */
619 /* last point (msec) that player is paused or seeking */
620 gint64 last_position;
625 /* data size of http streaming */
626 guint64 http_content_size;
629 gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
631 gboolean smooth_streaming;
633 gint videodec_linked;
634 gint audiodec_linked;
635 gint videosink_linked;
636 gint audiosink_linked;
637 gint textsink_linked;
639 /* missing plugin during autoplugging */
640 MissingCodec not_supported_codec;
642 /* unlinked audio/video mime type */
643 gchar *unlinked_video_mime;
644 gchar *unlinked_audio_mime;
645 gchar *unlinked_demuxer_mime;
647 /* found codec during autoplugging */
648 FoundCodec can_support_codec;
650 gboolean not_found_demuxer;
652 /* support seek even though player is not start */
653 MMPlayerPendingSeek pending_seek;
657 /* prevent to post msg over and over */
660 /* list of sink elements */
661 GList* sink_elements;
663 /* signal notifiers */
664 GList* signals[MM_PLAYER_SIGNAL_TYPE_MAX];
666 MMPlayerGMainContext context;
667 MMPlayerUriList uri_info;
669 gboolean is_sound_extraction;
671 gfloat playback_rate;
673 /* player state resumed by fast rewind */
674 gboolean resumed_by_rewind;
676 gboolean is_nv12_tiled;
678 /* resource manager for H/W resources */
679 MMPlayerResourceManager resource_manager[RESOURCE_TYPE_MAX];
681 /* sound focus for being compatible with legacy session policy internally */
682 MMPlayerSoundFocus sound_focus;
684 gboolean is_subtitle_off;
685 gboolean is_external_subtitle_present;
686 gboolean is_external_subtitle_added_now;
687 gboolean pending_resume;
689 /* contents bitrate for buffering management */
690 guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
692 guint updated_bitrate_count;
693 guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
694 guint total_maximum_bitrate;
695 guint updated_maximum_bitrate_count;
697 /* prevent it from posting duplicatly*/
700 /* timeout source for lazy pause */
701 guint resume_event_id;
702 guint resumable_cancel_id;
704 gboolean play_subtitle;
705 gboolean is_subtitle_force_drop; // set TRUE after bus_cb get EOS
707 /* PD downloader message callback and param */
708 MMMessageCallback pd_msg_cb;
709 void* pd_msg_cb_param;
711 /* adjust subtitle position store */
712 gint64 adjust_subtitle_pos;
713 GList *subtitle_language_list;
715 /* To store the current multiwindow status */
716 gboolean last_multiwin_status;
718 /* To store the current running audio pad index of demuxer */
719 gint demux_pad_index;
721 mm_player_selector_t selector[MM_PLAYER_TRACK_TYPE_MAX];
722 mm_player_selector_t audio_mode;
723 gboolean use_deinterleave;
724 guint max_audio_channels;
726 guint internal_text_idx;
727 guint external_text_idx;
729 MMPlayerSetMode set_mode;
731 /* initialize values */
734 /* video share sync */
735 gint64 video_share_api_delta;
736 gint64 video_share_clock_delta;
738 /* just for native app (video hub) */
739 gboolean video_hub_download_mode;
740 gboolean sync_handler;
742 /* store dump pad list */
745 /* whether a video has closed caption or not */
746 gboolean has_closed_caption;
748 GstElement *video_fakesink;
750 /* audio stream caps parsed by demuxer or set by external demuxer */
751 GstCaps* a_stream_caps;
753 /* subtitle stream caps parsed by demuxer or set by external demuxer */
754 GstCaps* s_stream_caps;
756 /* es player using feed-data callback or calling app_src_push_buffer directly*/
757 gboolean es_player_push_mode;
759 /* tmb buffer manager for s/w codec tmb_bo */
765 MMAdaptiveVariantInfo adaptive_info;
769 gchar *language_code;
772 } MMPlayerLangStruct;
776 gulong probe_handle_id;
777 FILE *dump_element_file;
785 int valid_type; // validity type
786 int value_min; //<- set validity value range
790 /*===========================================================================================
792 | GLOBAL FUNCTION PROTOTYPES |
794 ========================================================================================== */
799 int _mmplayer_create_player(MMHandleType hplayer);
800 int _mmplayer_destroy(MMHandleType hplayer);
801 int _mmplayer_realize(MMHandleType hplayer);
802 int _mmplayer_unrealize(MMHandleType hplayer);
803 int _mmplayer_get_state(MMHandleType hplayer, int* pstate);
804 int _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume);
805 int _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType *volume);
806 int _mmplayer_set_mute(MMHandleType hplayer, int mute);
807 int _mmplayer_get_mute(MMHandleType hplayer, int* pmute);
808 int _mmplayer_start(MMHandleType hplayer);
809 int _mmplayer_stop(MMHandleType hplayer);
810 int _mmplayer_pause(MMHandleType hplayer);
811 int _mmplayer_resume(MMHandleType hplayer);
812 int _mmplayer_set_position(MMHandleType hplayer, int format, int pos);
813 int _mmplayer_get_position(MMHandleType hplayer, int format, unsigned long *pos);
814 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format, int pos);
815 int _mmplayer_adjust_video_postion(MMHandleType hplayer, int offset);
816 int _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, unsigned long end);
817 int _mmplayer_deactivate_section_repeat(MMHandleType hplayer);
818 int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming);
819 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
820 int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
821 int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
822 int _mmplayer_set_videostream_cb(MMHandleType hplayer, mm_player_video_stream_callback callback, void *user_param);
823 int _mmplayer_set_audiostream_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
824 int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent);
825 int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int* silent);
826 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filepath);
827 int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos);
829 /* test API for tuning audio gain. this API should be
830 * deprecated before the day of final release
832 int _mmplayer_set_volume_tune(MMHandleType hplayer, MMPlayerVolumeType volume);
833 int _mmplayer_update_video_param(mm_player_t* player, char *param_name);
834 int _mmplayer_set_audiobuffer_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
835 int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
836 int _mmplayer_audio_effect_custom_apply(mm_player_t *player);
838 int _mmplayer_set_audiostream_cb_ex(MMHandleType hplayer, bool sync, mm_player_audio_stream_callback_ex callback, void *user_param);
839 gboolean __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessageParamType* param);
841 int _mmplayer_change_track_language(MMHandleType hplayer, MMPlayerTrackType type, int index);
842 int _mmplayer_sync_subtitle_pipeline(mm_player_t* player);
843 int _mmplayer_set_video_hub_download_mode(MMHandleType hplayer, bool mode);
844 int _mmplayer_use_system_clock(MMHandleType hplayer);
845 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);
846 int _mmplayer_get_video_share_master_clock(MMHandleType hplayer, long long *video_time, long long *media_clock, long long *audio_time);
847 int _mmplayer_get_video_rotate_angle(MMHandleType hplayer, int *angle);
848 int _mmplayer_enable_sync_handler(MMHandleType hplayer, bool enable);
849 int _mmplayer_set_file_buffering_path(MMHandleType hplayer, const char* file_path);
850 int _mmplayer_set_uri(MMHandleType hplayer, const char* uri);
851 int _mmplayer_set_next_uri(MMHandleType hplayer, const char* uri, bool is_first_path);
852 int _mmplayer_get_next_uri(MMHandleType hplayer, char** uri);
853 int _mmplayer_has_closed_caption(MMHandleType hplayer, bool* exist);
854 void _mm_player_video_stream_internal_buffer_unref(void *buffer);
855 int _mmplayer_set_pcm_spec(MMHandleType hplayer, int samplerate, int channel);
856 int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
857 int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num);
858 int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int state);
859 int __mmplayer_gst_set_state(mm_player_t* player, GstElement * pipeline, GstState state, gboolean async, gint timeout);
860 int __mmplayer_set_state(mm_player_t* player, int state);
861 int __mmplayer_check_state(mm_player_t* player, enum PlayerCommandState command);
862 gboolean __mmplayer_dump_pipeline_state(mm_player_t* player);
863 void __mmplayer_remove_g_source_from_context(GMainContext *context, guint source_id);
865 const gchar * __get_state_name(int state);
866 gboolean __mmplayer_can_do_interrupt(mm_player_t *player);
867 gboolean __is_streaming(mm_player_t* player);
868 gboolean __is_rtsp_streaming(mm_player_t* player);
869 gboolean __is_live_streaming(mm_player_t* player);
870 gboolean __is_http_streaming(mm_player_t* player);
871 gboolean __is_http_live_streaming(mm_player_t* player);
872 gboolean __is_dash_streaming(mm_player_t* player);
873 gboolean __is_smooth_streaming(mm_player_t* player);
874 gboolean __is_http_progressive_down(mm_player_t* player);
876 gboolean __mmplayer_check_useful_message(mm_player_t *player, GstMessage * message);
877 gboolean __mmplayer_handle_gst_error(mm_player_t* player, GstMessage * message, GError* error);
878 gint __gst_handle_core_error(mm_player_t* player, int code);
879 gint __gst_handle_library_error(mm_player_t* player, int code);
880 gint __gst_handle_resource_error(mm_player_t* player, int code, GstMessage * message);
881 gint __gst_handle_stream_error(mm_player_t* player, GError* error, GstMessage * message);
882 int _mmplayer_sound_register_with_pid(MMHandleType hplayer, int pid);
883 int _mmplayer_get_client_pid(MMHandleType hplayer, int* pid);
884 int __mmplayer_get_video_angle(mm_player_t* player, int *user_angle, int *org_angle);
885 int _mmplayer_video_stream_release_bo(mm_player_t* player, void* bo);
886 int _mmplayer_get_adaptive_variant_info(MMHandleType hplayer, int *num, char **var_info);
887 int _mmplayer_set_max_adaptive_variant_limit(MMHandleType hplayer, int bandwidth, int width, int height);
888 int _mmplayer_get_max_adaptive_variant_limit(MMHandleType hplayer, int *bandwidth, int *width, int *height);
889 int _mmplayer_set_audio_only(MMHandleType hplayer, bool audio_only);
890 int _mmplayer_get_audio_only(MMHandleType hplayer, bool *paudio_only);
891 int _mmplayer_set_streaming_buffering_time(MMHandleType hplayer, int buffer_ms, int rebuffer_ms);
892 int _mmplayer_get_streaming_buffering_time(MMHandleType hplayer, int *buffer_ms, int *rebuffer_ms);
898 #endif /* __MM_PLAYER_PRIV_H__ */