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;
365 MMPLAYER_RESOURCE_TYPE_VIDEO_DECODER,
366 MMPLAYER_RESOURCE_TYPE_VIDEO_OVERLAY,
367 /* FIXME: need to add MMPLAYER_RESOURCE_TYPE_AUDIO_OFFLOAD */
368 MMPLAYER_RESOURCE_TYPE_MAX,
369 } mmplayer_resource_type_e;
371 /*---------------------------------------------------------------------------
372 | GLOBAL DATA TYPE DEFINITIONS: |
373 ---------------------------------------------------------------------------*/
378 } mmplayer_gst_element_t;
381 GstTagList *tag_list;
382 mmplayer_gst_element_t *mainbin;
383 mmplayer_gst_element_t *audiobin;
384 mmplayer_gst_element_t *videobin;
385 mmplayer_gst_element_t *textbin;
386 } mmplayer_pipeline_info_t;
392 } mmplayer_sound_info_t;
398 } mmplayer_input_buffer_t;
402 mmplayer_input_buffer_t input_mem;
403 char uri[MM_MAX_URL_LEN];
404 char urgent[MM_MAX_FILENAME_LEN];
405 } mmplayer_parse_profile_t;
409 storage_state_e state;
411 char path[MM_MAX_URL_LEN];
412 } mmplayer_storage_info_t;
417 } mmplayer_pending_seek_t;
422 } mmplayer_signal_item_t;
426 bool video_zc; // video zero-copy
429 } mmplayer_setting_mode_t; /* FIXME: renaming */
432 GMainContext *global_default;
433 GMainContext *thread_default;
434 } mmplayer_context_info_t;
439 } mmplayer_uri_list_t;
446 } mmplayer_video_roi_t;
449 gint active_pad_index;
450 gint total_track_num;
453 gulong event_probe_id;
454 } mmplayer_selector_t;
459 gboolean stream_changed;
460 gboolean reconfigure;
462 GstClockTime start_time[MM_PLAYER_TRACK_TYPE_MAX]; /* updated once get SEGMENT event */
463 GstSegment segment[MM_PLAYER_TRACK_TYPE_MAX];
464 gboolean update_segment[MM_PLAYER_TRACK_TYPE_MAX];
466 } mmplayer_gapless_t;
472 bool is_little_endian;
473 guint64 channel_mask;
477 media_format_mimetype_e pcm_format;
478 } mmplayer_audio_stream_buff_t;
481 * @brief data of video_bo_list
482 * @details this will be used when the sw codec is running.
488 } mmplayer_video_bo_info_t;
498 stream_variant_t limit;
499 } mmplayer_adaptive_variant_info_t;
504 char *stitching_software;
505 char *projection_type_string;
506 char *stereo_mode_string;
507 mmplayer_projection_type_e projection_type;
508 mmplayer_stereo_mode_e stereo_mode;
510 int init_view_heading;
514 int full_pano_width_pixels;
515 int full_pano_height_pixels;
516 int cropped_area_image_width;
517 int cropped_area_image_height;
518 int cropped_area_left;
519 int cropped_area_top;
521 int ambisonic_format;
523 } mmplayer_spherical_metadata_t;
527 int state; // player current state
528 int prev_state; // player previous state
529 int pending_state; // player state which is going to now
530 int target_state; // player state which user want to go to
531 guint state_change_timeout;
539 GMutex playback_lock;
541 /* gapless play thread */
542 GThread *gapless_play_thread;
543 gboolean gapless_play_thread_exit;
544 GCond gapless_play_thread_cond;
545 GMutex gapless_play_thread_mutex;
546 mmplayer_gapless_t gapless;
549 GThread *capture_thread;
550 gboolean capture_thread_exit;
551 GCond capture_thread_cond;
552 GMutex capture_thread_mutex;
553 mmplayer_video_capture_t capture;
554 mmplayer_video_color_space_e video_cs;
555 MMVideoBuffer captured;
557 /* gst bus msg thread, create during realize */
558 GThread *bus_msg_thread;
559 gboolean bus_msg_thread_exit;
560 GCond bus_msg_thread_cond;
561 GMutex bus_msg_thread_mutex;
563 /* fakesink handling lock */
566 /* update tag lock */
567 GMutex update_tag_lock;
569 /* player attributes */
572 /* message callback */
573 MMMessageCallback msg_cb;
576 /* streaming player */
577 mmplayer_streaming_t *streamer;
579 /* gstreamer pipeline */
580 mmplayer_pipeline_info_t *pipeline;
583 GstPad *ghost_pad_for_videobin;
585 guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX];
586 guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX];
587 mm_player_media_stream_buffer_status_callback media_stream_buffer_status_cb[MM_PLAYER_STREAM_TYPE_MAX];
588 mm_player_media_stream_seek_data_callback media_stream_seek_data_cb[MM_PLAYER_STREAM_TYPE_MAX];
589 GMutex media_stream_cb_lock;
591 int video_num_buffers; /* total num of buffers in vcodec */
592 int video_extra_num_buffers; /* extra num of buffers in vcodec */
594 void *buffer_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
595 void *seek_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX];
597 /* video stream changed callback */
598 mm_player_stream_changed_callback video_stream_changed_cb;
599 void *video_stream_changed_cb_user_param;
601 /* audio stream changed callback */
602 mm_player_stream_changed_callback audio_stream_changed_cb;
603 void *audio_stream_changed_cb_user_param;
605 /* video stream callback */
606 mm_player_video_decoded_callback video_decoded_cb;
607 void *video_decoded_cb_user_param;
609 GMutex video_bo_mutex;
610 GList *video_bo_list; /* mmplayer_video_bo_info_t, bo list for decoded video data by sw codec */
612 bool video_stream_prerolled;
614 /* audio stream callback */
615 mm_player_audio_decoded_callback audio_decoded_cb;
616 void *audio_decoded_cb_user_param;
617 GList *audio_stream_buff_list; /* mmplayer_audio_stream_buff_t, buff list of extract pcm data */
618 mmplayer_audio_extract_opt_e audio_extract_opt;
620 /* video capture callback*/
621 gulong video_capture_cb_probe_id;
624 mmplayer_sound_info_t sound;
629 /* video stream caps parsed by demuxer */
630 GstCaps *v_stream_caps;
632 /* audio effect infomation */
633 mm_audio_effect_info_t audio_effect_info;
634 gboolean bypass_audio_effect;
636 /* content profile */
637 mmplayer_parse_profile_t profile;
638 mmplayer_storage_info_t storage_info[MMPLAYER_PATH_MAX];
640 /* streaming service type */
641 MMStreamingType streaming_type;
645 GList *audio_decoders; // list of linked audio name
646 gboolean no_more_pad;
647 gint num_dynamic_pad;
648 gboolean has_many_types;
650 /* progress callback timer */
651 /* FIXIT : since duplicated functionality with get_position
652 * this function will be deprecated after fixing all application
653 * which are using it.
655 guint progress_timer;
657 /* timer for sending delayed EOS */
660 /* last point that player is paused or seeking */
661 gint64 last_position;
666 /* data size of http streaming */
667 guint64 http_content_size;
670 gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
672 gboolean smooth_streaming;
674 gint videodec_linked;
675 gint audiodec_linked;
676 gint textsink_linked;
678 /* missing plugin during autoplugging */
679 missing_codec_e not_supported_codec;
681 /* unlinked audio/video mime type */
682 gchar *unlinked_video_mime;
683 gchar *unlinked_audio_mime;
684 gchar *unlinked_demuxer_mime;
686 /* found codec during autoplugging */
687 found_codec_e can_support_codec;
689 gboolean not_found_demuxer;
691 /* support seek even though player is not start */
692 mmplayer_pending_seek_t pending_seek;
693 mmplayer_seek_state_e seek_state;
695 /* prevent to post msg over and over */
698 /* list of sink elements */
699 GList *sink_elements;
701 /* signal notifiers */
702 GList *signals[MM_PLAYER_SIGNAL_TYPE_MAX];
705 GMutex bus_msg_q_lock;
706 mmplayer_context_info_t context;
707 mmplayer_uri_list_t uri_info;
709 gboolean is_sound_extraction;
711 gfloat playback_rate;
713 /* player state resumed by fast rewind */
714 gboolean resumed_by_rewind;
716 gboolean is_nv12_tiled;
718 /* resource manager for H/W resources */
719 mm_resource_manager_h resource_manager;
720 mm_resource_manager_res_h hw_resource[MMPLAYER_RESOURCE_TYPE_MAX];
721 gboolean interrupted_by_resource;
723 gboolean is_subtitle_off;
724 gboolean is_external_subtitle_present;
725 gboolean is_external_subtitle_added_now;
726 gboolean pending_resume;
728 /* contents bitrate for buffering management */
729 guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
731 guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
732 guint total_maximum_bitrate;
734 /* prevent it from posting duplicatly*/
737 gboolean play_subtitle;
738 gboolean is_subtitle_force_drop; // set TRUE after bus_cb get EOS
740 /* adjust subtitle position store */
741 gint64 adjust_subtitle_pos;
742 GList *subtitle_language_list;
743 GCond subtitle_info_cond;
744 GMutex subtitle_info_mutex;
746 /* To store the current running audio pad index of demuxer */
747 gint demux_pad_index;
749 mmplayer_selector_t selector[MM_PLAYER_TRACK_TYPE_MAX];
751 guint internal_text_idx;
752 guint external_text_idx;
754 mmplayer_setting_mode_t set_mode;
756 /* initialize values */
759 /* store dump pad list */
762 /* whether a video has closed caption or not */
763 gboolean has_closed_caption;
766 /* audio stream caps parsed by demuxer or set by external demuxer */
767 GstCaps *a_stream_caps;
769 /* subtitle stream caps parsed by demuxer or set by external demuxer */
770 GstCaps *s_stream_caps;
772 /* es player using feed-data callback or calling app_src_push_buffer directly*/
773 gboolean es_player_push_mode;
775 /* tmb buffer manager for s/w codec tmb_bo */
778 mmplayer_adaptive_variant_info_t adaptive_info;
780 /* Video360 related stuff
782 gboolean is_360_feature_enabled;
783 gboolean is_content_spherical;
784 mmplayer_spherical_metadata_t video360_metadata;
785 gboolean is_openal_plugin_used;
786 /* User settable values */
787 gboolean is_video360_enabled;
788 float video360_yaw_radians;
789 float video360_pitch_radians;
791 int video360_horizontal_fov;
792 int video360_vertical_fov;
794 /* Video ROI area scale value */
795 mmplayer_video_roi_t video_roi;
797 /* build audio offload */
798 gboolean build_audio_offload;
799 guint audio_device_cb_id;
803 gchar *language_code;
806 } mmplayer_lang_info_t;
810 gulong probe_handle_id;
811 FILE *dump_element_file;
819 int valid_type; // validity type
820 int value_min; //<- set validity value range
822 } mmplayer_attrs_spec_t;
824 /*===========================================================================================
826 | GLOBAL FUNCTION PROTOTYPES |
828 ========================================================================================== */
833 int _mmplayer_create_player(MMHandleType hplayer);
834 int _mmplayer_destroy(MMHandleType hplayer);
835 int _mmplayer_realize(MMHandleType hplayer);
836 int _mmplayer_unrealize(MMHandleType hplayer);
837 int _mmplayer_get_state(MMHandleType hplayer, int *state);
838 int _mmplayer_set_volume(MMHandleType hplayer, float volume);
839 int _mmplayer_get_volume(MMHandleType hplayer, float *volume);
840 int _mmplayer_set_mute(MMHandleType hplayer, bool mute);
841 int _mmplayer_get_mute(MMHandleType hplayer, bool *mute);
842 int _mmplayer_start(MMHandleType hplayer);
843 int _mmplayer_stop(MMHandleType hplayer);
844 int _mmplayer_pause(MMHandleType hplayer);
845 int _mmplayer_abort_pause(MMHandleType hplayer);
846 int _mmplayer_resume(MMHandleType hplayer);
847 int _mmplayer_set_position(MMHandleType hplayer, gint64 pos);
848 int _mmplayer_get_duration(MMHandleType hplayer, gint64 *duration);
849 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int pos);
850 int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming);
851 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
852 int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
853 int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
854 int _mmplayer_set_video_decoded_cb(MMHandleType hplayer, mm_player_video_decoded_callback callback, void *user_param);
855 int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent);
856 int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int *silent);
857 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char *filepath);
858 int _mmplayer_get_buffer_position(MMHandleType hplayer, int *start_pos, int *end_pos);
859 int _mmplayer_update_video_param(mmplayer_t *player, char *param_name);
860 int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
861 int _mmplayer_audio_effect_custom_apply(mmplayer_t *player);
862 int _mmplayer_set_audio_decoded_cb(MMHandleType hplayer, mmplayer_audio_extract_opt_e opt, mm_player_audio_decoded_callback callback, void *user_param);
863 int _mmplayer_change_track_language(MMHandleType hplayer, mmplayer_track_type_e type, int index);
864 int _mmplayer_sync_subtitle_pipeline(mmplayer_t *player);
865 int _mmplayer_use_system_clock(MMHandleType hplayer);
866 int _mmplayer_set_uri(MMHandleType hplayer, const char *uri);
867 int _mmplayer_set_next_uri(MMHandleType hplayer, const char *uri, bool is_first_path);
868 int _mmplayer_get_next_uri(MMHandleType hplayer, char **uri);
869 int _mmplayer_has_closed_caption(MMHandleType hplayer, bool *exist);
870 void _mm_player_video_stream_internal_buffer_unref(void *buffer);
871 int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
872 int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num);
873 int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int id, int state);
874 int _mmplayer_video_stream_release_bo(mmplayer_t *player, void *bo);
875 int _mmplayer_get_adaptive_variant_info(MMHandleType hplayer, int *num, char **var_info);
876 int _mmplayer_set_max_adaptive_variant_limit(MMHandleType hplayer, int bandwidth, int width, int height);
877 int _mmplayer_get_max_adaptive_variant_limit(MMHandleType hplayer, int *bandwidth, int *width, int *height);
878 int _mmplayer_set_audio_only(MMHandleType hplayer, bool audio_only);
879 int _mmplayer_get_audio_only(MMHandleType hplayer, bool *paudio_only);
880 int _mmplayer_get_streaming_buffering_time(MMHandleType hplayer, int *prebuffer_ms, int *rebuffer_ms);
881 int _mmplayer_set_codec_type(MMHandleType hplayer, mmplayer_stream_type_e stream_type, mmplayer_video_codec_type_e codec_type);
882 int _mmplayer_set_replaygain_enabled(MMHandleType hplayer, bool enabled);
883 int _mmplayer_is_replaygain_enabled(MMHandleType hplayer, bool *enabled);
884 int _mmplayer_set_video_roi_area(MMHandleType hplayer, double scale_x, double scale_y, double scale_width, double scale_height);
885 int _mmplayer_get_video_roi_area(MMHandleType hplayer, double *scale_x, double *scale_y, double *scale_width, double *scale_height);
888 void _mmplayer_bus_msg_thread_destroy(MMHandleType hplayer);
889 void _mmplayer_set_state(mmplayer_t *player, int state);
890 int _mmplayer_check_state(mmplayer_t *player, mmplayer_command_state_e command);
891 gboolean _mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag);
892 void _mmplayer_cancel_eos_timer(mmplayer_t *player);
893 void _mmplayer_audio_stream_clear_buffer(mmplayer_t *player, gboolean send_all);
894 MMStreamingType _mmplayer_get_stream_service_type(mmplayer_t *player);
895 int _mmplayer_get_video_angle(mmplayer_t *player, int *display_angle, int *orientations);
896 gboolean _mmplayer_gst_remove_fakesink(mmplayer_t *player, mmplayer_gst_element_t *fakesink);
897 void _mmplayer_add_signal_connection(mmplayer_t *player, GObject *object, mmplayer_signal_type_e type, const gchar *signal, GCallback cb_funct, gpointer u_data);
898 void _mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data);
899 gint _mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data);
900 gboolean _mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps *caps);
901 void _mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data);
902 GstElement *_mmplayer_gst_make_decodebin(mmplayer_t *player);
903 int _mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket);
904 int _mmplayer_gst_element_link_bucket(GList *element_bucket);
905 void _mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data);
906 int _mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data);
912 #endif /* __MM_PLAYER_PRIV_H__ */