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"
47 #include "mm_player_attrs.h"
49 /*===========================================================================================
51 | GLOBAL DEFINITIONS AND DECLARATIONS FOR MODULE |
53 ========================================================================================== */
55 /*---------------------------------------------------------------------------
57 ---------------------------------------------------------------------------*/
58 #define MM_PLAYER_IMGB_MPLANE_MAX 4
59 #define MM_PLAYER_STREAM_COUNT_MAX 3
61 #define MM_PLAYER_CAST(x_player) ((mmplayer_t *)(x_player))
63 * @x_player: MMHandleType of player
65 * Get the attributes handle of this player.
67 #define MM_PLAYER_GET_ATTRS(x_player) (MM_PLAYER_CAST(x_player)->attrs)
69 #define MM_MAX_STRING_LENGTH 4000 /* have to be less than MUSE_MSG_MAX_LENGTH */
71 #define VIDEO360_MAX_ZOOM 10.0f
73 #define DEFAULT_NUM_OF_V_OUT_BUFFER 4
75 /*---------------------------------------------------------------------------
76 | GLOBAL CONSTANT DEFINITIONS: |
77 ---------------------------------------------------------------------------*/
79 AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */
80 AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */
81 AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */
85 TAG_AUDIO_CODEC = 0x0001,
86 TAG_VIDEO_CODEC = 0x0002,
91 TAG_COPYRIGHT = 0x0040,
93 TAG_DESCRIPTION = 0x0100,
94 TAG_TRACK_NUMBER = 0x0200
97 enum content_attr_flag {
98 ATTR_MISSING_ONLY = 0x0001,
99 ATTR_DURATION = 0x0002,
102 ATTR_BITRATE = 0x0010,
106 enum mmplayer_sink_type {
107 MMPLAYER_VIDEO_SINK = 0x01,
108 MMPLAYER_AUDIO_SINK = 0x02,
109 MMPLAYER_TEXT_SINK = 0x04,
110 MMPLAYER_SINK_ALL = 0x07,
114 * Enumerations of Player Uri type
116 enum mmplayer_uri_type {
117 MM_PLAYER_URI_TYPE_NONE, /**< Player URI type None */
118 MM_PLAYER_URI_TYPE_URL_RTSP, /**< Player URI type RTSP */
119 MM_PLAYER_URI_TYPE_URL_HTTP, /**< Player URI type HTTP */
120 MM_PLAYER_URI_TYPE_URL_MMS, /**< Player URI type MMS */
121 MM_PLAYER_URI_TYPE_MEM, /**< Player URI type Mem */
122 MM_PLAYER_URI_TYPE_FILE, /**< Player URI type File */
123 MM_PLAYER_URI_TYPE_URL, /**< Player URI type URL */
124 MM_PLAYER_URI_TYPE_MS_BUFF, /**< Player URI type Media Stream Buffer */
125 MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */
126 MM_PLAYER_URI_TYPE_SS, /**< Player URI type Smooth streaming */
127 MM_PLAYER_URI_TYPE_DASH, /**< Player URI type Mpeg Dash */
128 MM_PLAYER_URI_TYPE_NO_PERMISSION, /**< Player URI type No Permission */
129 MM_PLAYER_URI_TYPE_TEMP, /**< Player URI type Temp */
133 MISSING_PLUGIN_NONE = 0x00,
134 MISSING_PLUGIN_AUDIO = 0x01,
135 MISSING_PLUGIN_VIDEO = 0x02
140 FOUND_PLUGIN_NONE = 0x00,
141 FOUND_PLUGIN_AUDIO = 0x01,
142 FOUND_PLUGIN_VIDEO = 0x02
146 * Enumeration of signal type
149 MM_PLAYER_SIGNAL_TYPE_AUTOPLUG = 0,
150 MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
151 MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
152 MM_PLAYER_SIGNAL_TYPE_TEXTBIN,
153 MM_PLAYER_SIGNAL_TYPE_OTHERS,
154 MM_PLAYER_SIGNAL_TYPE_ALL,
155 MM_PLAYER_SIGNAL_TYPE_MAX = MM_PLAYER_SIGNAL_TYPE_ALL,
156 } mmplayer_signal_type_e;
158 /* main pipeline's element id */
160 MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
162 MMPLAYER_M_2ND_SRC, /* 2nd Source Element for es buff src */
165 /* it could be a decodebin or could be a typefind. depends on player ini */
168 MMPLAYER_M_AUTOPLUG_PARSEBIN,
170 MMPLAYER_M_AUTOPLUG_V_DEC,
171 MMPLAYER_M_AUTOPLUG_A_DEC,
173 /*fakesink will hold whole pipeline state. */
174 MMPLAYER_M_SRC_FAKESINK,
176 /* streaming plugin */
177 MMPLAYER_M_MUXED_S_BUFFER,
178 MMPLAYER_M_DEMUXED_S_BUFFER,
180 MMPLAYER_M_ADAPTIVE_DEMUX,
182 /* es buff src queue */
187 /* FIXIT : if there's really no usage for following IDs. remove it */
194 MMPLAYER_M_V_INPUT_SELECTOR, // video input_select
195 MMPLAYER_M_A_INPUT_SELECTOR, // audio input_select
196 MMPLAYER_M_T_INPUT_SELECTOR, // text input_select
197 MMPLAYER_M_V_CONCAT, // video concat
198 MMPLAYER_M_A_CONCAT, // audio concat
199 MMPLAYER_M_T_CONCAT, // text concat
203 /* audio pipeline's element id */
204 enum audio_element_id {
205 MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */
209 MMPLAYER_A_FILTER_SEC,
210 MMPLAYER_A_CONV_BFORMAT,
213 MMPLAYER_A_RESAMPLER,
215 MMPLAYER_A_CONV_PITCH,
220 MMPLAYER_A_EXTRACT_CONV,
221 MMPLAYER_A_EXTRACT_RESAMPLER,
222 MMPLAYER_A_EXTRACT_CAPS,
223 MMPLAYER_A_EXTRACT_DEINTERLEAVE,
224 MMPLAYER_A_EXTRACT_SINK,
228 /* video pipeline's element id */
229 enum video_element_id {
230 MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
238 /* text pipeline's element id */
239 enum text_element_id {
240 MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
242 MMPLAYER_T_VIDEO_QUEUE,
243 MMPLAYER_T_VIDEO_CONVERTER,
245 MMPLAYER_T_FAKE_SINK,
251 MMPLAYER_COMMAND_NONE,
252 MMPLAYER_COMMAND_CREATE,
253 MMPLAYER_COMMAND_DESTROY,
254 MMPLAYER_COMMAND_UNREALIZE,
255 MMPLAYER_COMMAND_START,
256 MMPLAYER_COMMAND_REALIZE,
257 MMPLAYER_COMMAND_STOP,
258 MMPLAYER_COMMAND_PAUSE,
259 MMPLAYER_COMMAND_RESUME,
261 } mmplayer_command_state_e;
263 /* Note : mmplayer_streaming_src_error is error enum for streaming source which post error message
264 * using custom message made by itself. The enum value must start with zero,
265 * because the streaming source(secrtspsrc) also does.
267 enum mmplayer_streaming_src_error {
268 MMPLAYER_STREAMING_ERROR_NONE = 0,
269 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
270 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
271 MMPLAYER_STREAMING_ERROR_CONNECTION_FAIL,
272 MMPLAYER_STREAMING_ERROR_DNS_FAIL,
273 MMPLAYER_STREAMING_ERROR_SERVER_DISCONNECTED,
274 MMPLAYER_STREAMING_ERROR_BAD_SERVER,
275 MMPLAYER_STREAMING_ERROR_INVALID_PROTOCOL,
276 MMPLAYER_STREAMING_ERROR_INVALID_URL,
277 MMPLAYER_STREAMING_ERROR_UNEXPECTED_MSG,
278 MMPLAYER_STREAMING_ERROR_OUT_OF_MEMORIES,
279 MMPLAYER_STREAMING_ERROR_RTSP_TIMEOUT,
280 MMPLAYER_STREAMING_ERROR_BAD_REQUEST,
281 MMPLAYER_STREAMING_ERROR_NOT_AUTHORIZED,
282 MMPLAYER_STREAMING_ERROR_PAYMENT_REQUIRED,
283 MMPLAYER_STREAMING_ERROR_FORBIDDEN,
284 MMPLAYER_STREAMING_ERROR_CONTENT_NOT_FOUND,
285 MMPLAYER_STREAMING_ERROR_METHOD_NOT_ALLOWED,
286 MMPLAYER_STREAMING_ERROR_NOT_ACCEPTABLE,
287 MMPLAYER_STREAMING_ERROR_PROXY_AUTHENTICATION_REQUIRED,
288 MMPLAYER_STREAMING_ERROR_SERVER_TIMEOUT,
289 MMPLAYER_STREAMING_ERROR_GONE,
290 MMPLAYER_STREAMING_ERROR_LENGTH_REQUIRED,
291 MMPLAYER_STREAMING_ERROR_PRECONDITION_FAILED,
292 MMPLAYER_STREAMING_ERROR_REQUEST_ENTITY_TOO_LARGE,
293 MMPLAYER_STREAMING_ERROR_REQUEST_URI_TOO_LARGE,
294 MMPLAYER_STREAMING_ERROR_UNSUPPORTED_MEDIA_TYPE,
295 MMPLAYER_STREAMING_ERROR_PARAMETER_NOT_UNDERSTOOD,
296 MMPLAYER_STREAMING_ERROR_CONFERENCE_NOT_FOUND,
297 MMPLAYER_STREAMING_ERROR_NOT_ENOUGH_BANDWIDTH,
298 MMPLAYER_STREAMING_ERROR_NO_SESSION_ID,
299 MMPLAYER_STREAMING_ERROR_METHOD_NOT_VALID_IN_THIS_STATE,
300 MMPLAYER_STREAMING_ERROR_HEADER_FIELD_NOT_VALID_FOR_SOURCE,
301 MMPLAYER_STREAMING_ERROR_INVALID_RANGE,
302 MMPLAYER_STREAMING_ERROR_PARAMETER_IS_READONLY,
303 MMPLAYER_STREAMING_ERROR_AGGREGATE_OP_NOT_ALLOWED,
304 MMPLAYER_STREAMING_ERROR_ONLY_AGGREGATE_OP_ALLOWED,
305 MMPLAYER_STREAMING_ERROR_BAD_TRANSPORT,
306 MMPLAYER_STREAMING_ERROR_DESTINATION_UNREACHABLE,
307 MMPLAYER_STREAMING_ERROR_INTERNAL_SERVER_ERROR,
308 MMPLAYER_STREAMING_ERROR_NOT_IMPLEMENTED,
309 MMPLAYER_STREAMING_ERROR_BAD_GATEWAY,
310 MMPLAYER_STREAMING_ERROR_SERVICE_UNAVAILABLE,
311 MMPLAYER_STREAMING_ERROR_GATEWAY_TIME_OUT ,
312 MMPLAYER_STREAMING_ERROR_RTSP_VERSION_NOT_SUPPORTED,
313 MMPLAYER_STREAMING_ERROR_OPTION_NOT_SUPPORTED,
317 MMPLAYER_SEEK_NONE = 0,
318 MMPLAYER_SEEK_IN_PROGRESS,
319 MMPLAYER_SEEK_COMPLETED, /* after getting async done but before posting seek complete */
320 } mmplayer_seek_state_e;
323 MMPLAYER_PATH_VOD = 0,
326 } mmplayer_path_type_e;
328 /* Video360 related enums. These are duplication from video360.h from
332 VIDEO360_MODE_UNKNOWN = -1,
333 VIDEO360_MODE_MONOSCOPIC = 0,
334 VIDEO360_MODE_STEREOSCOPIC_TOP_BOTTOM = 1,
335 VIDEO360_MODE_STEREOSCOPIC_LEFT_RIGHT = 2,
336 VIDEO360_MODE_STEREOSCOPIC_STEREO_MESH = 3,
337 VIDEO360_MODE_LAST_ITEM
338 } mmplayer_stereo_mode_e;
341 VIDEO360_PROJECTION_TYPE_UNKNOWN = -1,
342 VIDEO360_PROJECTION_TYPE_EQUIRECTANGULAR = 0,
343 VIDEO360_PROJECTION_TYPE_CUBEMAP = 1,
344 VIDEO360_PROJECTION_TYPE_MESH = 2,
345 VIDEO360_PROJECTION_TYPE_LAST_ITEM
346 } mmplayer_projection_type_e;
348 /* Spatial audio related enums. These are duplication from mm_file.h from
352 MMFILE_AMBISONIC_TYPE_UNKNOWN = 0,
353 MMFILE_AMBISONIC_TYPE_PERIPHONIC = 1, /**< To comply with Google's Spatial Audio RFC*/
354 MMFILE_AMBISONIC_TYPE_NON_PERIPHONIC = 2,
355 } mmfile_ambisonic_type_e;
358 MMFILE_AMBISONIC_FORMAT_UNKNOWN = 0,
359 MMFILE_AMBISONIC_FORMAT_AMBIX = 1, /**< AMBIX (Channel sequence: ACN, Normalization: SN3D) */
360 MMFILE_AMBISONIC_FORMAT_AMB = 2, /**< .AMB, Tetraproc (Channel sequence: FuMa, Normalization: FuMa) */
361 MMFILE_AMBISONIC_FORMAT_UA = 3, /**< Universal Ambisonics (Channel sequence: SID, Normalization: N3D) */
362 } mmfile_ambisonic_format_e;
365 MMFILE_AMBISONIC_ORDER_UNKNOWN = 0,
366 MMFILE_AMBISONIC_ORDER_FOA = 1, /**< First order Ambisonics */
367 MMFILE_AMBISONIC_ORDER_SOA = 2, /**< Second order Ambisonics */
368 MMFILE_AMBISONIC_ORDER_TOA = 3, /**< Third order Ambisonics */
369 } mmfile_ambisonic_order_e;
372 MMPLAYER_RESOURCE_TYPE_VIDEO_DECODER,
373 MMPLAYER_RESOURCE_TYPE_VIDEO_OVERLAY,
374 MMPLAYER_RESOURCE_TYPE_AUDIO_OFFLOAD,
375 MMPLAYER_RESOURCE_TYPE_MAX,
376 } mmplayer_resource_type_e;
378 /*---------------------------------------------------------------------------
379 | GLOBAL DATA TYPE DEFINITIONS: |
380 ---------------------------------------------------------------------------*/
385 } mmplayer_gst_element_t;
388 GstTagList *tag_list;
389 mmplayer_gst_element_t *mainbin;
390 mmplayer_gst_element_t *audiobin;
391 mmplayer_gst_element_t *videobin;
392 mmplayer_gst_element_t *textbin;
393 } mmplayer_pipeline_info_t;
399 } mmplayer_sound_info_t;
405 } mmplayer_input_buffer_t;
409 mmplayer_input_buffer_t input_mem;
410 char uri[MM_MAX_URL_LEN];
411 char urgent[MM_MAX_FILENAME_LEN];
412 } mmplayer_parse_profile_t;
416 storage_state_e state;
418 char path[MM_MAX_URL_LEN];
419 } mmplayer_storage_info_t;
424 } mmplayer_pending_seek_t;
429 } mmplayer_signal_item_t;
433 bool video_zc; // video zero-copy
436 } mmplayer_setting_mode_t; /* FIXME: renaming */
439 GMainContext *global_default;
440 GMainContext *thread_default;
441 } mmplayer_context_info_t;
446 } mmplayer_uri_list_t;
453 } mmplayer_video_roi_t;
456 gint active_track_index;
457 gint total_track_num;
459 gulong block_id; /* FIXME: will be removed */
460 gulong event_probe_id; /* FIXME: will be removed */
466 gboolean stream_changed;
467 gboolean reconfigure;
469 GstClockTime start_time[MM_PLAYER_TRACK_TYPE_MAX]; /* updated once get SEGMENT event */
470 GstSegment segment[MM_PLAYER_TRACK_TYPE_MAX];
471 gboolean update_segment[MM_PLAYER_TRACK_TYPE_MAX];
473 } mmplayer_gapless_t;
478 guint64 channel_mask;
482 media_format_mimetype_e pcm_format;
483 } mmplayer_audio_stream_buff_t;
486 * @brief data of video_bo_list
487 * @details this will be used when the sw codec is running.
493 } mmplayer_video_bo_info_t;
503 stream_variant_t limit;
504 } mmplayer_adaptive_variant_info_t;
509 char *stitching_software;
510 char *projection_type_string;
511 char *stereo_mode_string;
512 mmplayer_projection_type_e projection_type;
513 mmplayer_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 } mmplayer_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 reconfigure_lock;
545 GCond reconfigure_cond;
547 /* gapless play thread */
548 GThread *gapless_play_thread;
549 gboolean gapless_play_thread_exit;
550 GCond gapless_play_thread_cond;
551 GMutex gapless_play_thread_mutex;
552 mmplayer_gapless_t gapless;
555 GThread *capture_thread;
556 gboolean capture_thread_exit;
557 GCond capture_thread_cond;
558 GMutex capture_thread_mutex;
559 mmplayer_video_capture_t capture;
560 mmplayer_video_color_space_e video_cs;
561 MMVideoBuffer captured;
563 /* gst bus msg thread, create during realize */
564 GThread *bus_msg_thread;
565 gboolean bus_msg_thread_exit;
566 GCond bus_msg_thread_cond;
567 GMutex bus_msg_thread_mutex;
569 /* fakesink handling lock */
572 /* update tag lock */
573 GMutex update_tag_lock;
575 /* player attributes */
577 mmplayer_attrs_spec_t *default_attrs;
579 /* message callback */
580 MMMessageCallback msg_cb;
583 /* streaming player */
584 mmplayer_streaming_t *streamer;
586 /* gstreamer pipeline */
587 mmplayer_pipeline_info_t *pipeline;
590 GstPad *ghost_pad_for_videobin;
592 guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX];
593 guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX];
595 /* audio stream changed callback */
596 mm_player_stream_changed_callback audio_stream_changed_cb;
597 void *audio_stream_changed_cb_user_param;
599 /* video stream callback */
600 mm_player_video_decoded_callback video_decoded_cb;
601 void *video_decoded_cb_user_param;
603 GMutex video_bo_mutex;
604 GList *video_bo_list; /* mmplayer_video_bo_info_t, bo list for decoded video data by sw codec */
606 bool video_stream_prerolled;
608 /* audio stream callback */
609 mm_player_audio_decoded_callback audio_decoded_cb;
610 void *audio_decoded_cb_user_param;
611 GList *audio_stream_buff_list; /* mmplayer_audio_stream_buff_t, buff list of extract pcm data */
612 mmplayer_audio_extract_opt_e audio_extract_opt;
614 /* video capture callback*/
615 gulong video_capture_cb_probe_id;
618 mmplayer_sound_info_t sound;
624 /* video stream caps parsed by demuxer */
625 GstCaps *v_stream_caps;
627 /* audio effect infomation */
628 mm_audio_effect_info_t audio_effect_info;
629 gboolean bypass_audio_effect;
631 /* content profile */
632 mmplayer_parse_profile_t profile;
633 mmplayer_storage_info_t storage_info[MMPLAYER_PATH_MAX];
635 /* streaming service type */
636 MMStreamingType streaming_type;
640 GList *audio_decoders; // list of linked audio name
641 gboolean no_more_pad;
642 gint num_dynamic_pad;
643 gboolean has_many_types;
644 gboolean need_audio_dec_sorting;
645 gboolean need_video_dec_sorting;
647 /* progress callback timer */
648 /* FIXIT : since duplicated functionality with get_position
649 * this function will be deprecated after fixing all application
650 * which are using it.
652 guint progress_timer;
654 /* timer for sending delayed EOS */
657 /* last point that player is paused or seeking */
658 gint64 last_position;
663 /* data size of http streaming */
664 guint64 http_content_size;
667 gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
669 gboolean smooth_streaming;
671 gint videodec_linked;
672 gint audiodec_linked;
673 gint textsink_linked;
675 /* missing plugin during autoplugging */
676 missing_codec_e not_supported_codec;
678 /* unlinked audio/video mime type */
679 gchar *unlinked_video_mime;
680 gchar *unlinked_audio_mime;
681 gchar *unlinked_demuxer_mime;
683 /* found codec during autoplugging */
684 found_codec_e can_support_codec;
686 gboolean not_found_demuxer;
688 /* support seek even though player is not start */
689 mmplayer_pending_seek_t pending_seek;
690 mmplayer_seek_state_e seek_state;
692 /* prevent to post msg over and over */
695 /* list of sink elements */
696 GList *sink_elements;
698 /* for destroy bus thread */
699 GMutex bus_watcher_mutex;
700 GCond bus_watcher_cond;
702 /* signal notifiers */
703 GList *signals[MM_PLAYER_SIGNAL_TYPE_MAX];
706 GMutex bus_msg_q_lock;
707 mmplayer_context_info_t context;
708 mmplayer_uri_list_t uri_info;
710 gboolean is_sound_extraction;
712 gfloat playback_rate;
714 /* player state resumed by fast rewind */
715 gboolean resumed_by_rewind;
717 gboolean is_nv12_tiled;
719 /* resource manager for H/W resources */
720 mm_resource_manager_h resource_manager;
721 mm_resource_manager_res_h hw_resource[MMPLAYER_RESOURCE_TYPE_MAX];
722 gboolean interrupted_by_resource;
724 gboolean is_subtitle_off;
725 gboolean is_external_subtitle_present;
726 gboolean is_external_subtitle_added_now;
727 gboolean pending_resume;
729 /* contents bitrate for buffering management */
730 guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
732 guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
733 guint total_maximum_bitrate;
735 /* prevent it from posting duplicatly*/
738 gboolean play_subtitle;
739 gboolean is_subtitle_force_drop; // set TRUE after bus_cb get EOS
741 /* adjust subtitle position store */
742 gint64 adjust_subtitle_pos;
743 GList *subtitle_language_list;
744 GCond subtitle_info_cond;
745 GMutex subtitle_info_mutex;
747 /* stream collection */
748 GstStreamCollection *collection;
749 guint stream_notify_id;
751 mmplayer_track_t track[MM_PLAYER_TRACK_TYPE_MAX];
753 guint internal_text_idx;
754 guint external_text_idx;
756 mmplayer_setting_mode_t set_mode;
758 /* initialize values */
761 /* store dump pad list */
764 /* whether a video has closed caption or not */
765 gboolean has_closed_caption;
768 /* audio stream caps parsed by demuxer or set by external demuxer */
769 GstCaps *a_stream_caps;
771 /* subtitle stream caps parsed by demuxer or set by external demuxer */
772 GstCaps *s_stream_caps;
774 /* es player using feed-data callback or calling app_src_push_buffer directly*/
775 gboolean es_player_push_mode;
777 /* tmb buffer manager for s/w codec tmb_bo */
780 mmplayer_adaptive_variant_info_t adaptive_info;
782 /* Video360 related stuff
784 gboolean is_360_feature_enabled;
785 gboolean is_content_spherical;
786 mmplayer_spherical_metadata_t video360_metadata;
787 gboolean is_openal_plugin_used;
788 /* User settable values */
789 gboolean is_video360_enabled;
790 float video360_yaw_radians;
791 float video360_pitch_radians;
793 int video360_horizontal_fov;
794 int video360_vertical_fov;
796 /* Video ROI area scale value */
797 mmplayer_video_roi_t video_roi;
799 /* build audio offload */
800 gboolean build_audio_offload;
801 guint audio_device_cb_id;
807 gchar *language_code;
810 } mmplayer_lang_info_t;
814 gulong probe_handle_id;
815 FILE *dump_element_file;
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_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
847 int _mmplayer_set_video_decoded_cb(MMHandleType hplayer, mm_player_video_decoded_callback callback, void *user_param);
848 int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent);
849 int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int *silent);
850 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char *filepath);
851 int _mmplayer_get_buffer_position(MMHandleType hplayer, int *start_pos, int *end_pos);
852 int _mmplayer_update_video_overlay_param(mmplayer_t *player, const char *param_name);
853 int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, int wl_surface_id);
854 int _mmplayer_audio_effect_custom_apply(mmplayer_t *player);
855 int _mmplayer_set_audio_decoded_cb(MMHandleType hplayer, mmplayer_audio_extract_opt_e opt, mm_player_audio_decoded_callback callback, void *user_param);
856 int _mmplayer_change_track_language(MMHandleType hplayer, mmplayer_track_type_e type, int index);
857 int _mmplayer_sync_subtitle_pipeline(mmplayer_t *player);
858 int _mmplayer_use_system_clock(MMHandleType hplayer);
859 int _mmplayer_set_uri(MMHandleType hplayer, const char *uri);
860 int _mmplayer_set_next_uri(MMHandleType hplayer, const char *uri, bool is_first_path);
861 int _mmplayer_get_next_uri(MMHandleType hplayer, char **uri);
862 int _mmplayer_has_closed_caption(MMHandleType hplayer, bool *exist);
863 void _mm_player_video_stream_internal_buffer_unref(void *buffer);
864 int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
865 int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int id, int state);
866 int _mmplayer_video_stream_release_bo(mmplayer_t *player, void *bo);
867 int _mmplayer_get_adaptive_variant_info(MMHandleType hplayer, int *num, char **var_info);
868 int _mmplayer_set_max_adaptive_variant_limit(MMHandleType hplayer, int bandwidth, int width, int height);
869 int _mmplayer_get_max_adaptive_variant_limit(MMHandleType hplayer, int *bandwidth, int *width, int *height);
870 int _mmplayer_set_audio_only(MMHandleType hplayer, bool audio_only);
871 int _mmplayer_get_audio_only(MMHandleType hplayer, bool *paudio_only);
872 int _mmplayer_get_streaming_buffering_time(MMHandleType hplayer, int *prebuffer_ms, int *rebuffer_ms);
873 int _mmplayer_set_codec_type(MMHandleType hplayer, mmplayer_stream_type_e stream_type, mmplayer_codec_type_e codec_type);
874 int _mmplayer_set_replaygain_enabled(MMHandleType hplayer, bool enabled);
875 int _mmplayer_is_replaygain_enabled(MMHandleType hplayer, bool *enabled);
876 int _mmplayer_set_video_roi_area(MMHandleType hplayer, double scale_x, double scale_y, double scale_width, double scale_height);
877 int _mmplayer_get_video_roi_area(MMHandleType hplayer, double *scale_x, double *scale_y, double *scale_width, double *scale_height);
878 int _mmplayer_audio_offload_is_activated(MMHandleType hplayer, bool *activated);
879 int _mmplayer_is_audio_control_available(MMHandleType hplayer, mmplayer_audio_control_opt_e opt, bool *available);
882 void _mmplayer_bus_msg_thread_destroy(MMHandleType hplayer);
883 void _mmplayer_bus_watcher_remove(MMHandleType hplayer);
884 void _mmplayer_watcher_removed_notify(gpointer data);
885 void _mmplayer_set_state(mmplayer_t *player, int state);
886 int _mmplayer_check_state(mmplayer_t *player, mmplayer_command_state_e command);
887 gboolean _mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag);
888 void _mmplayer_cancel_eos_timer(mmplayer_t *player);
889 void _mmplayer_audio_stream_clear_buffer(mmplayer_t *player, gboolean send_all);
890 MMStreamingType _mmplayer_get_stream_service_type(mmplayer_t *player);
891 int _mmplayer_get_video_angle(mmplayer_t *player, int *display_angle, int *orientations);
892 gboolean _mmplayer_gst_remove_fakesink(mmplayer_t *player, mmplayer_gst_element_t *fakesink);
893 void _mmplayer_add_signal_connection(mmplayer_t *player, GObject *object, mmplayer_signal_type_e type, const gchar *signal, GCallback cb_funct, gpointer u_data);
894 void _mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data);
895 gint _mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data);
896 GValueArray *_mmplayer_gst_decode_autoplug_sort(GstElement *bin, GstPad *pad, GstCaps *caps, GValueArray *factories, gpointer data);
897 gboolean _mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps *caps);
898 void _mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data);
899 GstElement *_mmplayer_gst_make_decodebin(mmplayer_t *player);
900 int _mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket);
901 int _mmplayer_gst_element_link_bucket(GList *element_bucket);
902 void _mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data);
903 int _mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data);
904 int _mmplayer_set_client_pid(MMHandleType hplayer, int pid);
905 void _mmplayer_set_reconfigure_state(mmplayer_t *player, gboolean state);
906 void _mmplayer_gst_decode_pad_removed(GstElement *elem, GstPad *new_pad, gpointer data);
907 void _mmplayer_gst_decode_no_more_pads(GstElement *elem, gpointer data);
908 void _mmplayer_gst_decode_drained(GstElement *bin, gpointer data);
909 void _mmplayer_gst_about_to_finish(GstElement *bin, gpointer data);
910 void _mmplayer_gst_decode_unknown_type(GstElement *elem, GstPad *pad, GstCaps *caps, gpointer data);
911 gboolean _mmplayer_gst_decode_autoplug_continue(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer data);
912 void _mmplayer_pipeline_complete(GstElement *decodebin, gpointer data);
913 void _mmplayer_set_audio_attrs(mmplayer_t *player, GstCaps *caps);
914 int _mmplayer_acquire_hw_resource(mmplayer_t *player, mmplayer_resource_type_e type);
920 #endif /* __MM_PLAYER_PRIV_H__ */