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_audioeffect.h"
43 #include "mm_message.h"
44 #include "mm_player_ini.h"
45 #include <mm_resource_manager.h>
46 #include "mm_player_streaming.h"
48 /*===========================================================================================
50 | GLOBAL DEFINITIONS AND DECLARATIONS FOR MODULE |
52 ========================================================================================== */
54 /*---------------------------------------------------------------------------
56 ---------------------------------------------------------------------------*/
57 #define MM_PLAYER_IMGB_MPLANE_MAX 4
58 #define MM_PLAYER_STREAM_COUNT_MAX 3
60 #define MM_PLAYER_CAST(x_player) ((mmplayer_t *)(x_player))
62 * @x_player: MMHandleType of player
64 * Get the attributes handle of this player.
66 #define MM_PLAYER_GET_ATTRS(x_player) (MM_PLAYER_CAST(x_player)->attrs)
68 #define MM_MAX_STRING_LENGTH 4000 /* have to be less than MUSE_MSG_MAX_LENGTH */
70 #define VIDEO360_MAX_ZOOM 10.0f
72 /*---------------------------------------------------------------------------
73 | GLOBAL CONSTANT DEFINITIONS: |
74 ---------------------------------------------------------------------------*/
76 AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */
77 AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */
78 AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */
82 TAG_AUDIO_CODEC = 0x0001,
83 TAG_VIDEO_CODEC = 0x0002,
88 TAG_COPYRIGHT = 0x0040,
90 TAG_DESCRIPTION = 0x0100,
91 TAG_TRACK_NUMBER = 0x0200
94 enum content_attr_flag {
95 ATTR_MISSING_ONLY = 0x0001,
96 ATTR_DURATION = 0x0002,
99 ATTR_BITRATE = 0x0010,
103 enum mmplayer_sink_type {
104 MMPLAYER_VIDEO_SINK = 0x01,
105 MMPLAYER_AUDIO_SINK = 0x02,
106 MMPLAYER_TEXT_SINK = 0x04,
107 MMPLAYER_SINK_ALL = 0x07,
111 * Enumerations of Player Uri type
113 enum mmplayer_uri_type {
114 MM_PLAYER_URI_TYPE_NONE, /**< Player URI type None */
115 MM_PLAYER_URI_TYPE_URL_RTSP, /**< Player URI type RTSP */
116 MM_PLAYER_URI_TYPE_URL_HTTP, /**< Player URI type HTTP */
117 MM_PLAYER_URI_TYPE_URL_MMS, /**< Player URI type MMS */
118 MM_PLAYER_URI_TYPE_MEM, /**< Player URI type Mem */
119 MM_PLAYER_URI_TYPE_FILE, /**< Player URI type File */
120 MM_PLAYER_URI_TYPE_URL, /**< Player URI type URL */
121 MM_PLAYER_URI_TYPE_MS_BUFF, /**< Player URI type Media Stream Buffer */
122 MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */
123 MM_PLAYER_URI_TYPE_SS, /**< Player URI type Smooth streaming */
124 MM_PLAYER_URI_TYPE_DASH, /**< Player URI type Mpeg Dash */
125 MM_PLAYER_URI_TYPE_NO_PERMISSION, /**< Player URI type No Permission */
126 MM_PLAYER_URI_TYPE_TEMP, /**< Player URI type Temp */
130 MISSING_PLUGIN_NONE = 0x00,
131 MISSING_PLUGIN_AUDIO = 0x01,
132 MISSING_PLUGIN_VIDEO = 0x02
137 FOUND_PLUGIN_NONE = 0x00,
138 FOUND_PLUGIN_AUDIO = 0x01,
139 FOUND_PLUGIN_VIDEO = 0x02
143 * Enumeration of signal type
146 MM_PLAYER_SIGNAL_TYPE_AUTOPLUG = 0,
147 MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
148 MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
149 MM_PLAYER_SIGNAL_TYPE_TEXTBIN,
150 MM_PLAYER_SIGNAL_TYPE_OTHERS,
151 MM_PLAYER_SIGNAL_TYPE_ALL,
152 MM_PLAYER_SIGNAL_TYPE_MAX = MM_PLAYER_SIGNAL_TYPE_ALL,
153 } mmplayer_signal_type_e;
155 /* main pipeline's element id */
157 MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
159 MMPLAYER_M_2ND_SRC, /* 2nd Source Element for es buff src */
162 /* it could be a decodebin or could be a typefind. depends on player ini */
166 MMPLAYER_M_AUTOPLUG_V_DEC,
167 MMPLAYER_M_AUTOPLUG_A_DEC,
169 /*fakesink will hold whole pipeline state. */
170 MMPLAYER_M_SRC_FAKESINK,
172 /* streaming plugin */
173 MMPLAYER_M_MUXED_S_BUFFER,
174 MMPLAYER_M_DEMUXED_S_BUFFER,
176 MMPLAYER_M_ADAPTIVE_DEMUX,
178 /* es buff src queue */
183 /* FIXIT : if there's really no usage for following IDs. remove it */
190 MMPLAYER_M_V_INPUT_SELECTOR, // video input_select
191 MMPLAYER_M_A_INPUT_SELECTOR, // audio input_select
192 MMPLAYER_M_T_INPUT_SELECTOR, // text input_select
196 /* audio pipeline's element id */
197 enum audio_element_id {
198 MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */
202 MMPLAYER_A_FILTER_SEC,
203 MMPLAYER_A_CONV_BFORMAT,
206 MMPLAYER_A_RESAMPLER,
208 MMPLAYER_A_CONV_PITCH,
213 MMPLAYER_A_EXTRACT_CONV,
214 MMPLAYER_A_EXTRACT_RESAMPLER,
215 MMPLAYER_A_EXTRACT_CAPS,
216 MMPLAYER_A_EXTRACT_DEINTERLEAVE,
217 MMPLAYER_A_EXTRACT_SINK,
221 /* video pipeline's element id */
222 enum video_element_id {
223 MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
231 /* text pipeline's element id */
232 enum text_element_id {
233 MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
235 MMPLAYER_T_VIDEO_QUEUE,
236 MMPLAYER_T_VIDEO_CONVERTER,
238 MMPLAYER_T_FAKE_SINK,
244 MMPLAYER_COMMAND_NONE,
245 MMPLAYER_COMMAND_CREATE,
246 MMPLAYER_COMMAND_DESTROY,
247 MMPLAYER_COMMAND_UNREALIZE,
248 MMPLAYER_COMMAND_START,
249 MMPLAYER_COMMAND_REALIZE,
250 MMPLAYER_COMMAND_STOP,
251 MMPLAYER_COMMAND_PAUSE,
252 MMPLAYER_COMMAND_RESUME,
254 } mmplayer_command_state_e;
256 /* Note : mmplayer_streaming_src_error is error enum for streaming source which post error message
257 * using custom message made by itself. The enum value must start with zero,
258 * because the streaming source(secrtspsrc) also does.
260 enum mmplayer_streaming_src_error {
261 MMPLAYER_STREAMING_ERROR_NONE = 0,
262 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
263 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
264 MMPLAYER_STREAMING_ERROR_CONNECTION_FAIL,
265 MMPLAYER_STREAMING_ERROR_DNS_FAIL,
266 MMPLAYER_STREAMING_ERROR_SERVER_DISCONNECTED,
267 MMPLAYER_STREAMING_ERROR_BAD_SERVER,
268 MMPLAYER_STREAMING_ERROR_INVALID_PROTOCOL,
269 MMPLAYER_STREAMING_ERROR_INVALID_URL,
270 MMPLAYER_STREAMING_ERROR_UNEXPECTED_MSG,
271 MMPLAYER_STREAMING_ERROR_OUT_OF_MEMORIES,
272 MMPLAYER_STREAMING_ERROR_RTSP_TIMEOUT,
273 MMPLAYER_STREAMING_ERROR_BAD_REQUEST,
274 MMPLAYER_STREAMING_ERROR_NOT_AUTHORIZED,
275 MMPLAYER_STREAMING_ERROR_PAYMENT_REQUIRED,
276 MMPLAYER_STREAMING_ERROR_FORBIDDEN,
277 MMPLAYER_STREAMING_ERROR_CONTENT_NOT_FOUND,
278 MMPLAYER_STREAMING_ERROR_METHOD_NOT_ALLOWED,
279 MMPLAYER_STREAMING_ERROR_NOT_ACCEPTABLE,
280 MMPLAYER_STREAMING_ERROR_PROXY_AUTHENTICATION_REQUIRED,
281 MMPLAYER_STREAMING_ERROR_SERVER_TIMEOUT,
282 MMPLAYER_STREAMING_ERROR_GONE,
283 MMPLAYER_STREAMING_ERROR_LENGTH_REQUIRED,
284 MMPLAYER_STREAMING_ERROR_PRECONDITION_FAILED,
285 MMPLAYER_STREAMING_ERROR_REQUEST_ENTITY_TOO_LARGE,
286 MMPLAYER_STREAMING_ERROR_REQUEST_URI_TOO_LARGE,
287 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_MEDIA_TYPE,
288 MMPLAYER_STREAMING_ERROR_PARAMETER_NOT_UNDERSTOOD,
289 MMPLAYER_STREAMING_ERROR_CONFERENCE_NOT_FOUND,
290 MMPLAYER_STREAMING_ERROR_NOT_ENOUGH_BANDWIDTH,
291 MMPLAYER_STREAMING_ERROR_NO_SESSION_ID,
292 MMPLAYER_STREAMING_ERROR_METHOD_NOT_VALID_IN_THIS_STATE,
293 MMPLAYER_STREAMING_ERROR_HEADER_FIELD_NOT_VALID_FOR_SOURCE,
294 MMPLAYER_STREAMING_ERROR_INVALID_RANGE,
295 MMPLAYER_STREAMING_ERROR_PARAMETER_IS_READONLY,
296 MMPLAYER_STREAMING_ERROR_AGGREGATE_OP_NOT_ALLOWED,
297 MMPLAYER_STREAMING_ERROR_ONLY_AGGREGATE_OP_ALLOWED,
298 MMPLAYER_STREAMING_ERROR_BAD_TRANSPORT,
299 MMPLAYER_STREAMING_ERROR_DESTINATION_UNREACHABLE,
300 MMPLAYER_STREAMING_ERROR_INTERNAL_SERVER_ERROR,
301 MMPLAYER_STREAMING_ERROR_NOT_IMPLEMENTED,
302 MMPLAYER_STREAMING_ERROR_BAD_GATEWAY,
303 MMPLAYER_STREAMING_ERROR_SERVICE_UNAVAILABLE,
304 MMPLAYER_STREAMING_ERROR_GATEWAY_TIME_OUT ,
305 MMPLAYER_STREAMING_ERROR_RTSP_VERSION_NOT_SUPPORTED,
306 MMPLAYER_STREAMING_ERROR_OPTION_NOT_SUPPORTED,
310 MMPLAYER_SEEK_NONE = 0,
311 MMPLAYER_SEEK_IN_PROGRESS,
312 MMPLAYER_SEEK_COMPLETED, /* after getting async done but before posting seek complete */
313 } mmplayer_seek_state_e;
316 MMPLAYER_PATH_VOD = 0,
319 } mmplayer_path_type_e;
321 /* Video360 related enums. These are duplication from video360.h from
325 VIDEO360_MODE_UNKNOWN = -1,
326 VIDEO360_MODE_MONOSCOPIC = 0,
327 VIDEO360_MODE_STEREOSCOPIC_TOP_BOTTOM = 1,
328 VIDEO360_MODE_STEREOSCOPIC_LEFT_RIGHT = 2,
329 VIDEO360_MODE_STEREOSCOPIC_STEREO_MESH = 3,
330 VIDEO360_MODE_LAST_ITEM
331 } mmplayer_stereo_mode_e;
334 VIDEO360_PROJECTION_TYPE_UNKNOWN = -1,
335 VIDEO360_PROJECTION_TYPE_EQUIRECTANGULAR = 0,
336 VIDEO360_PROJECTION_TYPE_CUBEMAP = 1,
337 VIDEO360_PROJECTION_TYPE_MESH = 2,
338 VIDEO360_PROJECTION_TYPE_LAST_ITEM
339 } mmplayer_projection_type_e;
341 /* Spatial audio related enums. These are duplication from mm_file.h from
345 MMFILE_AMBISONIC_TYPE_UNKNOWN = 0,
346 MMFILE_AMBISONIC_TYPE_PERIPHONIC = 1, /**< To comply with Google's Spatial Audio RFC*/
347 MMFILE_AMBISONIC_TYPE_NON_PERIPHONIC = 2,
348 } mmfile_ambisonic_type_e;
351 MMFILE_AMBISONIC_FORMAT_UNKNOWN = 0,
352 MMFILE_AMBISONIC_FORMAT_AMBIX = 1, /**< AMBIX (Channel sequence: ACN, Normalization: SN3D) */
353 MMFILE_AMBISONIC_FORMAT_AMB = 2, /**< .AMB, Tetraproc (Channel sequence: FuMa, Normalization: FuMa) */
354 MMFILE_AMBISONIC_FORMAT_UA = 3, /**< Universal Ambisonics (Channel sequence: SID, Normalization: N3D) */
355 } mmfile_ambisonic_format_e;
358 MMFILE_AMBISONIC_ORDER_UNKNOWN = 0,
359 MMFILE_AMBISONIC_ORDER_FOA = 1, /**< First order Ambisonics */
360 MMFILE_AMBISONIC_ORDER_SOA = 2, /**< Second order Ambisonics */
361 MMFILE_AMBISONIC_ORDER_TOA = 3, /**< Third order Ambisonics */
362 } mmfile_ambisonic_order_e;
364 /*---------------------------------------------------------------------------
365 | GLOBAL DATA TYPE DEFINITIONS: |
366 ---------------------------------------------------------------------------*/
371 } mmplayer_gst_element_t;
374 GstTagList *tag_list;
375 mmplayer_gst_element_t *mainbin;
376 mmplayer_gst_element_t *audiobin;
377 mmplayer_gst_element_t *videobin;
378 mmplayer_gst_element_t *textbin;
379 } mmplayer_pipeline_info_t;
385 } mmplayer_sound_info_t;
391 } mmplayer_input_buffer_t;
395 mmplayer_input_buffer_t input_mem;
396 char uri[MM_MAX_URL_LEN];
397 char urgent[MM_MAX_FILENAME_LEN];
398 } mmplayer_parse_profile_t;
402 storage_state_e state;
404 char path[MM_MAX_URL_LEN];
405 } mmplayer_storage_info_t;
410 } mmplayer_pending_seek_t;
415 } mmplayer_signal_item_t;
419 bool video_zc; // video zero-copy
422 } mmplayer_setting_mode_t; /* FIXME: renaming */
425 GMainContext *global_default;
426 GMainContext *thread_default;
427 } mmplayer_context_info_t;
432 } mmplayer_uri_list_t;
439 } mmplayer_video_roi_t;
442 gint active_pad_index;
443 gint total_track_num;
446 gulong event_probe_id;
447 } mmplayer_selector_t;
452 gboolean stream_changed;
453 gboolean reconfigure;
455 GstClockTime start_time[MM_PLAYER_TRACK_TYPE_MAX]; /* updated once get SEGMENT event */
456 GstSegment segment[MM_PLAYER_TRACK_TYPE_MAX];
457 gboolean update_segment[MM_PLAYER_TRACK_TYPE_MAX];
459 } mmplayer_gapless_t;
465 bool is_little_endian;
466 guint64 channel_mask;
470 media_format_mimetype_e pcm_format;
471 } mmplayer_audio_stream_buff_t;
474 * @brief data of video_bo_list
475 * @details this will be used when the sw codec is running.
481 } mmplayer_video_bo_info_t;
491 stream_variant_t limit;
492 } mmplayer_adaptive_variant_info_t;
497 char *stitching_software;
498 char *projection_type_string;
499 char *stereo_mode_string;
500 mmplayer_projection_type_e projection_type;
501 mmplayer_stereo_mode_e stereo_mode;
503 int init_view_heading;
507 int full_pano_width_pixels;
508 int full_pano_height_pixels;
509 int cropped_area_image_width;
510 int cropped_area_image_height;
511 int cropped_area_left;
512 int cropped_area_top;
514 int ambisonic_format;
516 } mmplayer_spherical_metadata_t;
520 int state; // player current state
521 int prev_state; // player previous state
522 int pending_state; // player state which is going to now
523 int target_state; // player state which user want to go to
524 guint state_change_timeout;
532 GMutex playback_lock;
534 /* gapless play thread */
535 GThread *gapless_play_thread;
536 gboolean gapless_play_thread_exit;
537 GCond gapless_play_thread_cond;
538 GMutex gapless_play_thread_mutex;
539 mmplayer_gapless_t gapless;
542 GThread *capture_thread;
543 gboolean capture_thread_exit;
544 GCond capture_thread_cond;
545 GMutex capture_thread_mutex;
546 mmplayer_video_capture_t capture;
547 mmplayer_video_color_space_e video_cs;
548 MMVideoBuffer captured;
550 /* gst bus msg thread, create during realize */
551 GThread *bus_msg_thread;
552 gboolean bus_msg_thread_exit;
553 GCond bus_msg_thread_cond;
554 GMutex bus_msg_thread_mutex;
556 /* fakesink handling lock */
559 /* update tag lock */
560 GMutex update_tag_lock;
562 /* player attributes */
565 /* message callback */
566 MMMessageCallback msg_cb;
569 /* streaming player */
570 mmplayer_streaming_t *streamer;
572 /* gstreamer pipeline */
573 mmplayer_pipeline_info_t *pipeline;
576 GstPad *ghost_pad_for_videobin;
578 guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX];
579 guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX];
580 mm_player_media_stream_buffer_status_callback media_stream_buffer_status_cb[MM_PLAYER_STREAM_TYPE_MAX];
581 mm_player_media_stream_seek_data_callback media_stream_seek_data_cb[MM_PLAYER_STREAM_TYPE_MAX];
582 GMutex media_stream_cb_lock;
584 int video_num_buffers; /* total num of buffers in vcodec */
585 int video_extra_num_buffers; /* extra num of buffers in vcodec */
587 void *buffer_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
588 void *seek_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
590 /* video stream changed callback */
591 mm_player_stream_changed_callback video_stream_changed_cb;
592 void *video_stream_changed_cb_user_param;
594 /* audio stream changed callback */
595 mm_player_stream_changed_callback audio_stream_changed_cb;
596 void *audio_stream_changed_cb_user_param;
598 /* video stream callback */
599 mm_player_video_decoded_callback video_decoded_cb;
600 void *video_decoded_cb_user_param;
602 GMutex video_bo_mutex;
603 GList *video_bo_list; /* mmplayer_video_bo_info_t, bo list for decoded video data by sw codec */
605 bool video_stream_prerolled;
607 /* audio stream callback */
608 mm_player_audio_decoded_callback audio_decoded_cb;
609 void *audio_decoded_cb_user_param;
610 GList *audio_stream_buff_list; /* mmplayer_audio_stream_buff_t, buff list of extract pcm data */
611 mmplayer_audio_extract_opt_e audio_extract_opt;
613 /* video capture callback*/
614 gulong video_capture_cb_probe_id;
617 mmplayer_sound_info_t sound;
622 /* video stream caps parsed by demuxer */
623 GstCaps *v_stream_caps;
625 /* audio effect infomation */
626 mm_audio_effect_info_t audio_effect_info;
627 gboolean bypass_audio_effect;
629 /* content profile */
630 mmplayer_parse_profile_t profile;
631 mmplayer_storage_info_t storage_info[MMPLAYER_PATH_MAX];
633 /* streaming service type */
634 MMStreamingType streaming_type;
638 GList *audio_decoders; // list of linked audio name
639 gboolean no_more_pad;
640 gint num_dynamic_pad;
641 gboolean has_many_types;
643 /* progress callback timer */
644 /* FIXIT : since duplicated functionality with get_position
645 * this function will be deprecated after fixing all application
646 * which are using it.
648 guint progress_timer;
650 /* timer for sending delayed EOS */
653 /* last point that player is paused or seeking */
654 gint64 last_position;
659 /* data size of http streaming */
660 guint64 http_content_size;
663 gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
665 gboolean smooth_streaming;
667 gint videodec_linked;
668 gint audiodec_linked;
669 gint textsink_linked;
671 /* missing plugin during autoplugging */
672 missing_codec_e not_supported_codec;
674 /* unlinked audio/video mime type */
675 gchar *unlinked_video_mime;
676 gchar *unlinked_audio_mime;
677 gchar *unlinked_demuxer_mime;
679 /* found codec during autoplugging */
680 found_codec_e can_support_codec;
682 gboolean not_found_demuxer;
684 /* support seek even though player is not start */
685 mmplayer_pending_seek_t pending_seek;
686 mmplayer_seek_state_e seek_state;
688 /* prevent to post msg over and over */
691 /* list of sink elements */
692 GList *sink_elements;
694 /* signal notifiers */
695 GList *signals[MM_PLAYER_SIGNAL_TYPE_MAX];
698 GMutex bus_msg_q_lock;
699 mmplayer_context_info_t context;
700 mmplayer_uri_list_t uri_info;
702 gboolean is_sound_extraction;
704 gfloat playback_rate;
706 /* player state resumed by fast rewind */
707 gboolean resumed_by_rewind;
709 gboolean is_nv12_tiled;
711 /* resource manager for H/W resources */
712 mm_resource_manager_h resource_manager;
713 mm_resource_manager_res_h video_overlay_resource;
714 mm_resource_manager_res_h video_decoder_resource;
715 gboolean interrupted_by_resource;
717 gboolean is_subtitle_off;
718 gboolean is_external_subtitle_present;
719 gboolean is_external_subtitle_added_now;
720 gboolean pending_resume;
722 /* contents bitrate for buffering management */
723 guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
725 guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
726 guint total_maximum_bitrate;
728 /* prevent it from posting duplicatly*/
731 gboolean play_subtitle;
732 gboolean is_subtitle_force_drop; // set TRUE after bus_cb get EOS
734 /* adjust subtitle position store */
735 gint64 adjust_subtitle_pos;
736 GList *subtitle_language_list;
737 GCond subtitle_info_cond;
738 GMutex subtitle_info_mutex;
740 /* To store the current running audio pad index of demuxer */
741 gint demux_pad_index;
743 mmplayer_selector_t selector[MM_PLAYER_TRACK_TYPE_MAX];
745 guint internal_text_idx;
746 guint external_text_idx;
748 mmplayer_setting_mode_t set_mode;
750 /* initialize values */
753 /* store dump pad list */
756 /* whether a video has closed caption or not */
757 gboolean has_closed_caption;
760 /* audio stream caps parsed by demuxer or set by external demuxer */
761 GstCaps *a_stream_caps;
763 /* subtitle stream caps parsed by demuxer or set by external demuxer */
764 GstCaps *s_stream_caps;
766 /* es player using feed-data callback or calling app_src_push_buffer directly*/
767 gboolean es_player_push_mode;
769 /* tmb buffer manager for s/w codec tmb_bo */
772 mmplayer_adaptive_variant_info_t adaptive_info;
774 /* Video360 related stuff
776 gboolean is_360_feature_enabled;
777 gboolean is_content_spherical;
778 mmplayer_spherical_metadata_t video360_metadata;
779 gboolean is_openal_plugin_used;
780 /* User settable values */
781 gboolean is_video360_enabled;
782 float video360_yaw_radians;
783 float video360_pitch_radians;
785 int video360_horizontal_fov;
786 int video360_vertical_fov;
788 /* Video ROI area scale value */
789 mmplayer_video_roi_t video_roi;
791 /* build audio offload */
792 gboolean build_audio_offload;
793 guint audio_device_cb_id;
797 gchar *language_code;
800 } mmplayer_lang_info_t;
804 gulong probe_handle_id;
805 FILE *dump_element_file;
813 int valid_type; // validity type
814 int value_min; //<- set validity value range
816 } mmplayer_attrs_spec_t;
818 /*===========================================================================================
820 | GLOBAL FUNCTION PROTOTYPES |
822 ========================================================================================== */
827 int _mmplayer_create_player(MMHandleType hplayer);
828 int _mmplayer_destroy(MMHandleType hplayer);
829 int _mmplayer_realize(MMHandleType hplayer);
830 int _mmplayer_unrealize(MMHandleType hplayer);
831 int _mmplayer_get_state(MMHandleType hplayer, int *state);
832 int _mmplayer_set_volume(MMHandleType hplayer, float volume);
833 int _mmplayer_get_volume(MMHandleType hplayer, float *volume);
834 int _mmplayer_set_mute(MMHandleType hplayer, bool mute);
835 int _mmplayer_get_mute(MMHandleType hplayer, bool *mute);
836 int _mmplayer_start(MMHandleType hplayer);
837 int _mmplayer_stop(MMHandleType hplayer);
838 int _mmplayer_pause(MMHandleType hplayer);
839 int _mmplayer_abort_pause(MMHandleType hplayer);
840 int _mmplayer_resume(MMHandleType hplayer);
841 int _mmplayer_set_position(MMHandleType hplayer, gint64 pos);
842 int _mmplayer_get_duration(MMHandleType hplayer, gint64 *duration);
843 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int pos);
844 int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming);
845 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
846 int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
847 int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
848 int _mmplayer_set_video_decoded_cb(MMHandleType hplayer, mm_player_video_decoded_callback callback, void *user_param);
849 int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent);
850 int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int *silent);
851 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char *filepath);
852 int _mmplayer_get_buffer_position(MMHandleType hplayer, int *start_pos, int *end_pos);
853 int _mmplayer_update_video_param(mmplayer_t *player, char *param_name);
854 int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
855 int _mmplayer_audio_effect_custom_apply(mmplayer_t *player);
856 int _mmplayer_set_audio_decoded_cb(MMHandleType hplayer, mmplayer_audio_extract_opt_e opt, mm_player_audio_decoded_callback callback, void *user_param);
857 int _mmplayer_change_track_language(MMHandleType hplayer, mmplayer_track_type_e type, int index);
858 int _mmplayer_sync_subtitle_pipeline(mmplayer_t *player);
859 int _mmplayer_use_system_clock(MMHandleType hplayer);
860 int _mmplayer_set_uri(MMHandleType hplayer, const char *uri);
861 int _mmplayer_set_next_uri(MMHandleType hplayer, const char *uri, bool is_first_path);
862 int _mmplayer_get_next_uri(MMHandleType hplayer, char **uri);
863 int _mmplayer_has_closed_caption(MMHandleType hplayer, bool *exist);
864 void _mm_player_video_stream_internal_buffer_unref(void *buffer);
865 int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
866 int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num);
867 int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int id, int state);
868 int _mmplayer_video_stream_release_bo(mmplayer_t *player, void *bo);
869 int _mmplayer_get_adaptive_variant_info(MMHandleType hplayer, int *num, char **var_info);
870 int _mmplayer_set_max_adaptive_variant_limit(MMHandleType hplayer, int bandwidth, int width, int height);
871 int _mmplayer_get_max_adaptive_variant_limit(MMHandleType hplayer, int *bandwidth, int *width, int *height);
872 int _mmplayer_set_audio_only(MMHandleType hplayer, bool audio_only);
873 int _mmplayer_get_audio_only(MMHandleType hplayer, bool *paudio_only);
874 int _mmplayer_get_streaming_buffering_time(MMHandleType hplayer, int *prebuffer_ms, int *rebuffer_ms);
875 int _mmplayer_set_codec_type(MMHandleType hplayer, mmplayer_stream_type_e stream_type, mmplayer_video_codec_type_e codec_type);
876 int _mmplayer_set_replaygain_enabled(MMHandleType hplayer, bool enabled);
877 int _mmplayer_is_replaygain_enabled(MMHandleType hplayer, bool *enabled);
878 int _mmplayer_set_video_roi_area(MMHandleType hplayer, double scale_x, double scale_y, double scale_width, double scale_height);
879 int _mmplayer_get_video_roi_area(MMHandleType hplayer, double *scale_x, double *scale_y, double *scale_width, double *scale_height);
882 void _mmplayer_bus_msg_thread_destroy(MMHandleType hplayer);
883 void _mmplayer_set_state(mmplayer_t *player, int state);
884 int _mmplayer_check_state(mmplayer_t *player, mmplayer_command_state_e command);
885 gboolean _mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag);
886 void _mmplayer_cancel_eos_timer(mmplayer_t *player);
887 void _mmplayer_audio_stream_clear_buffer(mmplayer_t *player, gboolean send_all);
888 MMStreamingType _mmplayer_get_stream_service_type(mmplayer_t *player);
889 int _mmplayer_get_video_angle(mmplayer_t *player, int *display_angle, int *orientations);
890 gboolean _mmplayer_gst_remove_fakesink(mmplayer_t *player, mmplayer_gst_element_t *fakesink);
891 void _mmplayer_add_signal_connection(mmplayer_t *player, GObject *object, mmplayer_signal_type_e type, const gchar *signal, GCallback cb_funct, gpointer u_data);
892 void _mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data);
893 gint _mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data);
894 gboolean _mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps *caps);
895 void _mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data);
896 GstElement *_mmplayer_gst_make_decodebin(mmplayer_t *player);
897 int _mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket);
898 int _mmplayer_gst_element_link_bucket(GList *element_bucket);
899 void _mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data);
900 int _mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data);
906 #endif /* __MM_PLAYER_PRIV_H__ */