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_resource_manager.h>
47 #include "mm_player_pd.h"
48 #include "mm_player_streaming.h"
50 /*===========================================================================================
52 | GLOBAL DEFINITIONS AND DECLARATIONS FOR MODULE |
54 ========================================================================================== */
56 /*---------------------------------------------------------------------------
58 ---------------------------------------------------------------------------*/
59 #define MM_PLAYER_IMGB_MPLANE_MAX 4
60 #define MM_PLAYER_STREAM_COUNT_MAX 3
62 #define MM_PLAYER_CAST(x_player) ((mm_player_t *)(x_player))
64 * @x_player: MMHandleType of player
66 * Get the PD downloader of this player.
68 #define MM_PLAYER_GET_PD(x_player) (MM_PLAYER_CAST(x_player)->pd_downloader)
70 * @x_player: MMHandleType of player
72 * Get the attributes handle of this player.
74 #define MM_PLAYER_GET_ATTRS(x_player) (MM_PLAYER_CAST(x_player)->attrs)
76 #define MM_MAX_STRING_LENGTH 4000 /* have to be less than MUSE_MSG_MAX_LENGTH */
78 #define VIDEO360_MAX_ZOOM 10.0f
80 /*---------------------------------------------------------------------------
81 | GLOBAL CONSTANT DEFINITIONS: |
82 ---------------------------------------------------------------------------*/
84 AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */
85 AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */
86 AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */
90 TAG_AUDIO_CODEC = 0x0001,
91 TAG_VIDEO_CODEC = 0x0002,
96 TAG_COPYRIGHT = 0x0040,
98 TAG_DESCRIPTION = 0x0100,
99 TAG_TRACK_NUMBER = 0x0200
102 enum content_attr_flag {
103 ATTR_MISSING_ONLY = 0x0001,
104 ATTR_DURATION = 0x0002,
107 ATTR_BITRATE = 0x0010,
111 enum MMPlayerSinkType {
112 MMPLAYER_VIDEO_SINK = 0x01,
113 MMPLAYER_AUDIO_SINK = 0x02,
114 MMPLAYER_TEXT_SINK = 0x04,
115 MMPLAYER_SINK_ALL = 0x07,
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 /*fakesink will hold whole pipeline state. */
178 MMPLAYER_M_SRC_FAKESINK,
180 /* streaming plugin */
181 MMPLAYER_M_MUXED_S_BUFFER,
182 MMPLAYER_M_DEMUXED_S_BUFFER,
184 MMPLAYER_M_ADAPTIVE_DEMUX,
186 /* es buff src queue */
191 /* FIXIT : if there's really no usage for following IDs. remove it */
199 MMPLAYER_M_V_INPUT_SELECTOR, // video input_select
200 MMPLAYER_M_A_INPUT_SELECTOR, // audio input_select
201 MMPLAYER_M_T_INPUT_SELECTOR, // text input_select
205 /* audio pipeline's element id */
206 enum AudioElementID {
207 MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */
211 MMPLAYER_A_FILTER_SEC,
212 MMPLAYER_A_CAPS_DEFAULT,
213 MMPLAYER_A_CONV_BFORMAT,
216 MMPLAYER_A_RESAMPLER,
217 MMPLAYER_A_DEINTERLEAVE,
222 /* video pipeline's element id */
223 enum VideoElementID {
224 MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
233 /* text pipeline's element id */
235 MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
237 MMPLAYER_T_VIDEO_QUEUE,
238 MMPLAYER_T_VIDEO_CONVERTER,
240 MMPLAYER_T_FAKE_SINK,
245 /* midi main pipeline's element id */
248 MMPLAYER_MIDI_PLAYER,
252 enum PlayerCommandState {
253 MMPLAYER_COMMAND_NONE,
254 MMPLAYER_COMMAND_CREATE,
255 MMPLAYER_COMMAND_DESTROY,
256 MMPLAYER_COMMAND_UNREALIZE,
257 MMPLAYER_COMMAND_START,
258 MMPLAYER_COMMAND_REALIZE,
259 MMPLAYER_COMMAND_STOP,
260 MMPLAYER_COMMAND_PAUSE,
261 MMPLAYER_COMMAND_RESUME,
265 /* Note : StreamingSrcError is error enum for streaming source which post error message
266 * using custom message made by itself. The enum value must start with zero,
267 * because the streaming source(secrtspsrc) also does.
269 enum StreamingSrcError {
270 MMPLAYER_STREAMING_ERROR_NONE = 0,
271 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
272 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
273 MMPLAYER_STREAMING_ERROR_CONNECTION_FAIL,
274 MMPLAYER_STREAMING_ERROR_DNS_FAIL,
275 MMPLAYER_STREAMING_ERROR_SERVER_DISCONNECTED,
276 MMPLAYER_STREAMING_ERROR_BAD_SERVER,
277 MMPLAYER_STREAMING_ERROR_INVALID_PROTOCOL,
278 MMPLAYER_STREAMING_ERROR_INVALID_URL,
279 MMPLAYER_STREAMING_ERROR_UNEXPECTED_MSG,
280 MMPLAYER_STREAMING_ERROR_OUT_OF_MEMORIES,
281 MMPLAYER_STREAMING_ERROR_RTSP_TIMEOUT,
282 MMPLAYER_STREAMING_ERROR_BAD_REQUEST,
283 MMPLAYER_STREAMING_ERROR_NOT_AUTHORIZED,
284 MMPLAYER_STREAMING_ERROR_PAYMENT_REQUIRED,
285 MMPLAYER_STREAMING_ERROR_FORBIDDEN,
286 MMPLAYER_STREAMING_ERROR_CONTENT_NOT_FOUND,
287 MMPLAYER_STREAMING_ERROR_METHOD_NOT_ALLOWED,
288 MMPLAYER_STREAMING_ERROR_NOT_ACCEPTABLE,
289 MMPLAYER_STREAMING_ERROR_PROXY_AUTHENTICATION_REQUIRED,
290 MMPLAYER_STREAMING_ERROR_SERVER_TIMEOUT,
291 MMPLAYER_STREAMING_ERROR_GONE,
292 MMPLAYER_STREAMING_ERROR_LENGTH_REQUIRED,
293 MMPLAYER_STREAMING_ERROR_PRECONDITION_FAILED,
294 MMPLAYER_STREAMING_ERROR_REQUEST_ENTITY_TOO_LARGE,
295 MMPLAYER_STREAMING_ERROR_REQUEST_URI_TOO_LARGE,
296 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_MEDIA_TYPE,
297 MMPLAYER_STREAMING_ERROR_PARAMETER_NOT_UNDERSTOOD,
298 MMPLAYER_STREAMING_ERROR_CONFERENCE_NOT_FOUND,
299 MMPLAYER_STREAMING_ERROR_NOT_ENOUGH_BANDWIDTH,
300 MMPLAYER_STREAMING_ERROR_NO_SESSION_ID,
301 MMPLAYER_STREAMING_ERROR_METHOD_NOT_VALID_IN_THIS_STATE,
302 MMPLAYER_STREAMING_ERROR_HEADER_FIELD_NOT_VALID_FOR_SOURCE,
303 MMPLAYER_STREAMING_ERROR_INVALID_RANGE,
304 MMPLAYER_STREAMING_ERROR_PARAMETER_IS_READONLY,
305 MMPLAYER_STREAMING_ERROR_AGGREGATE_OP_NOT_ALLOWED,
306 MMPLAYER_STREAMING_ERROR_ONLY_AGGREGATE_OP_ALLOWED,
307 MMPLAYER_STREAMING_ERROR_BAD_TRANSPORT,
308 MMPLAYER_STREAMING_ERROR_DESTINATION_UNREACHABLE,
309 MMPLAYER_STREAMING_ERROR_INTERNAL_SERVER_ERROR,
310 MMPLAYER_STREAMING_ERROR_NOT_IMPLEMENTED,
311 MMPLAYER_STREAMING_ERROR_BAD_GATEWAY,
312 MMPLAYER_STREAMING_ERROR_SERVICE_UNAVAILABLE,
313 MMPLAYER_STREAMING_ERROR_GATEWAY_TIME_OUT ,
314 MMPLAYER_STREAMING_ERROR_RTSP_VERSION_NOT_SUPPORTED,
315 MMPLAYER_STREAMING_ERROR_OPTION_NOT_SUPPORTED,
319 MMPLAYER_SEEK_NONE = 0,
320 MMPLAYER_SEEK_IN_PROGRESS,
321 MMPLAYER_SEEK_COMPLETED, /* after getting async done but before posting seek complete */
325 MMPLAYER_PATH_VOD = 0,
330 /* Video360 related enums. These are duplication from video360.h from
334 VIDEO360_MODE_UNKNOWN = -1,
335 VIDEO360_MODE_MONOSCOPIC = 0,
336 VIDEO360_MODE_STEREOSCOPIC_TOP_BOTTOM = 1,
337 VIDEO360_MODE_STEREOSCOPIC_LEFT_RIGHT = 2,
338 VIDEO360_MODE_STEREOSCOPIC_STEREO_MESH = 3,
339 VIDEO360_MODE_LAST_ITEM
340 } mm_player_stereo_mode_e;
343 VIDEO360_PROJECTION_TYPE_UNKNOWN = -1,
344 VIDEO360_PROJECTION_TYPE_EQUIRECTANGULAR = 0,
345 VIDEO360_PROJECTION_TYPE_CUBEMAP = 1,
346 VIDEO360_PROJECTION_TYPE_MESH = 2,
347 VIDEO360_PROJECTION_TYPE_LAST_ITEM
348 } mm_player_projection_type_e;
350 /* Spatial audio related enums. These are duplication from mm_file.h from
354 MMFILE_AMBISONIC_TYPE_UNKNOWN = 0,
355 MMFILE_AMBISONIC_TYPE_PERIPHONIC = 1, /**< To comply with Google's Spatial Audio RFC*/
356 MMFILE_AMBISONIC_TYPE_NON_PERIPHONIC = 2,
357 } MMFILE_AMBISONIC_TYPE;
360 MMFILE_AMBISONIC_FORMAT_UNKNOWN = 0,
361 MMFILE_AMBISONIC_FORMAT_AMBIX = 1, /**< AMBIX (Channel sequence: ACN, Normalization: SN3D) */
362 MMFILE_AMBISONIC_FORMAT_AMB = 2, /**< .AMB, Tetraproc (Channel sequence: FuMa, Normalization: FuMa) */
363 MMFILE_AMBISONIC_FORMAT_UA = 3, /**< Universal Ambisonics (Channel sequence: SID, Normalization: N3D) */
364 } MMFILE_AMBISONIC_FORMAT;
367 MMFILE_AMBISONIC_ORDER_UNKNOWN = 0,
368 MMFILE_AMBISONIC_ORDER_FOA = 1, /**< First order Ambisonics */
369 MMFILE_AMBISONIC_ORDER_SOA = 2, /**< Second order Ambisonics */
370 MMFILE_AMBISONIC_ORDER_TOA = 3, /**< Third order Ambisonics */
371 } MMFILE_AMBISONIC_ORDER;
373 /*---------------------------------------------------------------------------
374 | GLOBAL DATA TYPE DEFINITIONS: |
375 ---------------------------------------------------------------------------*/
380 } MMPlayerGstElement;
383 GstTagList *tag_list;
384 MMPlayerGstElement *mainbin;
385 MMPlayerGstElement *audiobin;
386 MMPlayerGstElement *videobin;
387 MMPlayerGstElement *textbin;
388 } MMPlayerGstPipelineInfo;
393 int bluetooth; /* enable/disable */
402 } MMPlayerInputBuffer;
407 MMPlayerInputBuffer input_mem;
408 char uri[MM_MAX_URL_LEN];
409 char urgent[MM_MAX_FILENAME_LEN];
410 } MMPlayerParseProfile;
414 storage_state_e state;
416 char path[MM_MAX_URL_LEN];
417 } MMPlayerStorageInfo;
422 } MMPlayerPendingSeek;
427 } MMPlayerSignalItem;
432 bool video_zc; // video zero-copy
434 bool media_packet_video_stream;
438 GMainContext *global_default;
439 GMainContext *thread_default;
440 } MMPlayerGMainContext;
455 gint active_pad_index;
456 gint total_track_num;
459 gulong event_probe_id;
460 } mm_player_selector_t;
465 gboolean stream_changed;
466 gboolean reconfigure;
468 GstClockTime start_time[MM_PLAYER_TRACK_TYPE_MAX]; /* updated once get SEGMENT event */
469 GstSegment segment[MM_PLAYER_TRACK_TYPE_MAX];
470 gboolean update_segment[MM_PLAYER_TRACK_TYPE_MAX];
472 } mm_player_gapless_t;
478 bool is_little_endian;
479 guint64 channel_mask;
483 } mm_player_audio_stream_buff_t;
486 * @brief data of video_bo_list
487 * @details this will be used when the sw codec is running.
493 } mm_player_video_bo_info_t;
504 } MMAdaptiveVariantInfo;
509 char *stitching_software;
510 char *projection_type_string;
511 char *stereo_mode_string;
512 mm_player_projection_type_e projection_type;
513 mm_player_stereo_mode_e stereo_mode;
515 int init_view_heading;
519 int full_pano_width_pixels;
520 int full_pano_height_pixels;
521 int cropped_area_image_width;
522 int cropped_area_image_height;
523 int cropped_area_left;
524 int cropped_area_top;
526 int ambisonic_format;
528 } mm_player_spherical_metadata_t;
532 int state; // player current state
533 int prev_state; // player previous state
534 int pending_state; // player state which is going to now
535 int target_state; // player state which user want to go to
536 guint state_change_timeout;
544 GMutex playback_lock;
546 /* gapless play thread */
547 GThread *gapless_play_thread;
548 gboolean gapless_play_thread_exit;
549 GCond gapless_play_thread_cond;
550 GMutex gapless_play_thread_mutex;
551 mm_player_gapless_t gapless;
554 GThread *capture_thread;
555 gboolean capture_thread_exit;
556 GCond capture_thread_cond;
557 GMutex capture_thread_mutex;
558 MMPlayerVideoCapture capture;
559 MMPlayerVideoColorspace video_cs;
560 MMVideoBuffer captured;
562 /* gst bus msg thread, create during realize */
563 GThread *bus_msg_thread;
564 gboolean bus_msg_thread_exit;
565 GCond bus_msg_thread_cond;
566 GMutex bus_msg_thread_mutex;
568 /* fakesink handling lock */
571 /* update tag lock */
572 GMutex update_tag_lock;
574 /* player attributes */
577 /* message callback */
578 MMMessageCallback msg_cb;
581 /* progressive download */
582 mm_player_pd_t *pd_downloader;
583 gchar *pd_file_save_path;
584 MMPlayerPDMode pd_mode;
586 /* streaming player */
587 mm_player_streaming_t *streamer;
588 gchar *http_file_buffering_path;
590 /* gstreamer pipeline */
591 MMPlayerGstPipelineInfo *pipeline;
594 GstPad *ghost_pad_for_videobin;
596 guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX];
597 guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX];
598 mm_player_media_stream_buffer_status_callback media_stream_buffer_status_cb[MM_PLAYER_STREAM_TYPE_MAX];
599 mm_player_media_stream_seek_data_callback media_stream_seek_data_cb[MM_PLAYER_STREAM_TYPE_MAX];
600 GMutex media_stream_cb_lock;
602 int video_num_buffers; /* total num of buffers in vcodec */
603 int video_extra_num_buffers; /* extra num of buffers in vcodec */
605 void *buffer_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
606 void *seek_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
608 /* video stream changed callback */
609 mm_player_stream_changed_callback video_stream_changed_cb;
610 void* video_stream_changed_cb_user_param;
612 /* audio stream changed callback */
613 mm_player_stream_changed_callback audio_stream_changed_cb;
614 void* audio_stream_changed_cb_user_param;
616 /* video stream callback */
617 mm_player_video_stream_callback video_stream_cb;
618 void *video_stream_cb_user_param;
620 GMutex video_bo_mutex;
621 GList *video_bo_list; /* mm_player_video_bo_info_t, bo list for decoded video data by sw codec */
623 bool video_stream_prerolled;
625 /* audio stream callback */
626 mm_player_audio_stream_callback audio_stream_render_cb;
627 void *audio_stream_cb_user_param;
628 bool audio_stream_sink_sync;
629 GList *audio_stream_buff_list; /* mm_player_audio_stream_buff_t, buff list of extract pcm data */
631 /* video capture callback*/
632 gulong video_capture_cb_probe_id;
635 MMPlayerSoundInfo sound;
640 /* video stream caps parsed by demuxer */
641 GstCaps *v_stream_caps;
643 /* audio effect infomation */
644 MMAudioEffectInfo audio_effect_info;
645 gboolean bypass_audio_effect;
647 /* content profile */
648 MMPlayerParseProfile profile;
649 MMPlayerStorageInfo storage_info[MMPLAYER_PATH_MAX];
651 /* streaming service type */
652 MMStreamingType streaming_type;
656 GList *parsers; // list of linked parser name
657 GList *audio_decoders; // list of linked audio name
658 gboolean no_more_pad;
659 gint num_dynamic_pad;
660 gboolean has_many_types;
662 /* progress callback timer */
663 /* FIXIT : since duplicated functionality with get_position
664 * this function will be deprecated after fixing all application
665 * which are using it.
667 guint progress_timer;
669 /* timer for sending delayed EOS */
672 /* last point that player is paused or seeking */
673 gint64 last_position;
678 /* data size of http streaming */
679 guint64 http_content_size;
682 gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
684 gboolean smooth_streaming;
686 gint videodec_linked;
687 gint audiodec_linked;
688 gint textsink_linked;
690 /* missing plugin during autoplugging */
691 MissingCodec not_supported_codec;
693 /* unlinked audio/video mime type */
694 gchar *unlinked_video_mime;
695 gchar *unlinked_audio_mime;
696 gchar *unlinked_demuxer_mime;
698 /* found codec during autoplugging */
699 FoundCodec can_support_codec;
701 gboolean not_found_demuxer;
703 /* support seek even though player is not start */
704 MMPlayerPendingSeek pending_seek;
705 MMPlayerSeekState seek_state;
707 /* prevent to post msg over and over */
710 /* list of sink elements */
711 GList *sink_elements;
713 /* signal notifiers */
714 GList *signals[MM_PLAYER_SIGNAL_TYPE_MAX];
717 GMutex bus_msg_q_lock;
718 MMPlayerGMainContext context;
719 MMPlayerUriList uri_info;
721 gboolean is_sound_extraction;
723 gfloat playback_rate;
725 /* player state resumed by fast rewind */
726 gboolean resumed_by_rewind;
728 gboolean is_nv12_tiled;
730 /* resource manager for H/W resources */
731 mm_resource_manager_h resource_manager;
732 mm_resource_manager_res_h video_overlay_resource;
733 mm_resource_manager_res_h video_decoder_resource;
734 gboolean interrupted_by_resource;
736 gboolean is_subtitle_off;
737 gboolean is_external_subtitle_present;
738 gboolean is_external_subtitle_added_now;
739 gboolean pending_resume;
741 /* contents bitrate for buffering management */
742 guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
744 guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
745 guint total_maximum_bitrate;
747 /* prevent it from posting duplicatly*/
750 gboolean play_subtitle;
751 gboolean is_subtitle_force_drop; // set TRUE after bus_cb get EOS
753 /* PD downloader message callback and param */
754 MMMessageCallback pd_msg_cb;
755 void *pd_msg_cb_param;
757 /* adjust subtitle position store */
758 gint64 adjust_subtitle_pos;
759 GList *subtitle_language_list;
760 GCond subtitle_info_cond;
761 GMutex subtitle_info_mutex;
763 /* To store the current multiwindow status */
764 gboolean last_multiwin_status;
766 /* To store the current running audio pad index of demuxer */
767 gint demux_pad_index;
769 mm_player_selector_t selector[MM_PLAYER_TRACK_TYPE_MAX];
771 guint internal_text_idx;
772 guint external_text_idx;
774 MMPlayerSetMode set_mode;
776 /* initialize values */
779 /* store dump pad list */
782 /* whether a video has closed caption or not */
783 gboolean has_closed_caption;
786 /* audio stream caps parsed by demuxer or set by external demuxer */
787 GstCaps *a_stream_caps;
789 /* subtitle stream caps parsed by demuxer or set by external demuxer */
790 GstCaps *s_stream_caps;
792 /* es player using feed-data callback or calling app_src_push_buffer directly*/
793 gboolean es_player_push_mode;
795 /* tmb buffer manager for s/w codec tmb_bo */
798 MMAdaptiveVariantInfo adaptive_info;
800 /* Video360 related stuff
802 gboolean is_360_feature_enabled;
803 gboolean is_content_spherical;
804 mm_player_spherical_metadata_t video360_metadata;
805 gboolean is_openal_plugin_used;
806 /* User settable values */
807 gboolean is_video360_enabled;
808 float video360_yaw_radians;
809 float video360_pitch_radians;
811 int video360_horizontal_fov;
812 int video360_vertical_fov;
814 /* Video ROI area scale value */
815 MMPlayerVideoROI video_roi;
819 gchar *language_code;
822 } MMPlayerLangStruct;
826 gulong probe_handle_id;
827 FILE *dump_element_file;
835 int valid_type; // validity type
836 int value_min; //<- set validity value range
840 /*===========================================================================================
842 | GLOBAL FUNCTION PROTOTYPES |
844 ========================================================================================== */
849 int _mmplayer_create_player(MMHandleType hplayer);
850 int _mmplayer_destroy(MMHandleType hplayer);
851 int _mmplayer_realize(MMHandleType hplayer);
852 int _mmplayer_unrealize(MMHandleType hplayer);
853 int _mmplayer_get_state(MMHandleType hplayer, int *pstate);
854 int _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume);
855 int _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType *volume);
856 int _mmplayer_set_mute(MMHandleType hplayer, int mute);
857 int _mmplayer_get_mute(MMHandleType hplayer, int *pmute);
858 int _mmplayer_start(MMHandleType hplayer);
859 int _mmplayer_stop(MMHandleType hplayer);
860 int _mmplayer_pause(MMHandleType hplayer);
861 int _mmplayer_abort_pause(MMHandleType hplayer);
862 int _mmplayer_resume(MMHandleType hplayer);
863 int _mmplayer_set_position(MMHandleType hplayer, gint64 pos);
864 int _mmplayer_get_position(MMHandleType hplayer, gint64 *pos);
865 int _mmplayer_get_duration(MMHandleType hplayer, gint64 *duration);
866 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format, int pos);
867 int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming);
868 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
869 int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
870 int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
871 int _mmplayer_set_videostream_cb(MMHandleType hplayer, mm_player_video_stream_callback callback, void *user_param);
872 int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent);
873 int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int *silent);
874 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char *filepath);
875 int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long *start_pos, unsigned long *stop_pos);
876 int _mmplayer_update_video_param(mm_player_t *player, char *param_name);
877 int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
878 int _mmplayer_audio_effect_custom_apply(mm_player_t *player);
879 int _mmplayer_set_audiostream_cb(MMHandleType hplayer, bool sync, mm_player_audio_stream_callback callback, void *user_param);
880 int _mmplayer_change_track_language(MMHandleType hplayer, MMPlayerTrackType type, int index);
881 int _mmplayer_sync_subtitle_pipeline(mm_player_t *player);
882 int _mmplayer_use_system_clock(MMHandleType hplayer);
883 int _mmplayer_set_file_buffering_path(MMHandleType hplayer, const char *file_path);
884 int _mmplayer_set_uri(MMHandleType hplayer, const char *uri);
885 int _mmplayer_set_next_uri(MMHandleType hplayer, const char *uri, bool is_first_path);
886 int _mmplayer_get_next_uri(MMHandleType hplayer, char **uri);
887 int _mmplayer_has_closed_caption(MMHandleType hplayer, bool* exist);
888 void _mm_player_video_stream_internal_buffer_unref(void *buffer);
889 int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
890 int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num);
891 int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int id, int state);
892 int _mmplayer_video_stream_release_bo(mm_player_t *player, void *bo);
893 int _mmplayer_get_adaptive_variant_info(MMHandleType hplayer, int *num, char **var_info);
894 int _mmplayer_set_max_adaptive_variant_limit(MMHandleType hplayer, int bandwidth, int width, int height);
895 int _mmplayer_get_max_adaptive_variant_limit(MMHandleType hplayer, int *bandwidth, int *width, int *height);
896 int _mmplayer_set_audio_only(MMHandleType hplayer, bool audio_only);
897 int _mmplayer_get_audio_only(MMHandleType hplayer, bool *paudio_only);
898 int _mmplayer_set_streaming_buffering_time(MMHandleType hplayer, int buffer_ms, int rebuffer_ms);
899 int _mmplayer_get_streaming_buffering_time(MMHandleType hplayer, int *buffer_ms, int *rebuffer_ms);
900 int _mmplayer_set_codec_type(MMHandleType hplayer, MMPlayerStreamType stream_type, MMPlayerVideoCodecType codec_type);
901 int _mmplayer_set_replaygain_enabled(MMHandleType hplayer, bool enabled);
902 int _mmplayer_is_replaygain_enabled(MMHandleType hplayer, bool *enabled);
903 int _mmplayer_set_video_roi_area(MMHandleType hplayer, double scale_x, double scale_y, double scale_width, double scale_height);
904 int _mmplayer_get_video_roi_area(MMHandleType hplayer, double *scale_x, double *scale_y, double *scale_width, double *scale_height);
907 void __mmplayer_bus_msg_thread_destroy(MMHandleType hplayer);
909 void __mmplayer_set_state(mm_player_t *player, int state);
910 int __mmplayer_check_state(mm_player_t *player, enum PlayerCommandState command);
911 gboolean __mmplayer_update_content_attrs(mm_player_t *player, enum content_attr_flag flag);
912 void __mmplayer_cancel_eos_timer(mm_player_t *player);
913 void __mmplayer_audio_stream_clear_buffer(mm_player_t *player, gboolean send_all);
914 MMStreamingType __mmplayer_get_stream_service_type(mm_player_t *player);
915 int __mmplayer_get_video_angle(mm_player_t *player, int *display_angle, int *orientations);
916 gboolean __mmplayer_gst_remove_fakesink(mm_player_t *player, MMPlayerGstElement *fakesink);
917 void __mmplayer_add_signal_connection(mm_player_t *player, GObject *object, MMPlayerSignalType type, const gchar *signal, GCallback cb_funct, gpointer u_data);
918 void __mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data);
919 gint __mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data);
920 gboolean __mmplayer_gst_create_decoder(mm_player_t *player, GstPad *srcpad, const GstCaps *caps);
921 void __mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data);
922 GstElement* __mmplayer_gst_make_decodebin(mm_player_t *player);
923 int __mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket);
924 int __mmplayer_gst_element_link_bucket(GList *element_bucket);
925 void __mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data);
926 int __mmplayer_parse_profile(const char *uri, void *param, MMPlayerParseProfile *data);
933 #endif /* __MM_PLAYER_PRIV_H__ */