X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Finclude%2Fmm_player_priv.h;h=4d9df970b6fcb95176ecbaea35074aec0f79bd01;hb=6f697a1dac09947281a057e387ca2a5eb4e63a20;hp=216357a4db518ae8775120fee2e3ad3d9df99086;hpb=aee5fe5538b0a8b3420a5e94b6aaaebf4d0bd695;p=platform%2Fcore%2Fmultimedia%2Flibmm-player.git diff --git a/src/include/mm_player_priv.h b/src/include/mm_player_priv.h index 216357a..4d9df97 100644 --- a/src/include/mm_player_priv.h +++ b/src/include/mm_player_priv.h @@ -29,6 +29,7 @@ | | ========================================================================================== */ #include +#include #include #include #include @@ -39,12 +40,12 @@ #include #include #include "mm_player.h" -#include "mm_player_internal.h" #include "mm_player_audioeffect.h" #include "mm_message.h" #include "mm_player_ini.h" #include #include "mm_player_streaming.h" +#include "mm_player_attrs.h" /*=========================================================================================== | | @@ -58,7 +59,7 @@ #define MM_PLAYER_IMGB_MPLANE_MAX 4 #define MM_PLAYER_STREAM_COUNT_MAX 3 -#define MM_PLAYER_CAST(x_player) ((mm_player_t *)(x_player)) +#define MM_PLAYER_CAST(x_player) ((mmplayer_t *)(x_player)) /** * @x_player: MMHandleType of player * @@ -70,6 +71,8 @@ #define VIDEO360_MAX_ZOOM 10.0f +#define DEFAULT_NUM_OF_V_OUT_BUFFER 4 + /*--------------------------------------------------------------------------- | GLOBAL CONSTANT DEFINITIONS: | ---------------------------------------------------------------------------*/ @@ -101,7 +104,7 @@ enum content_attr_flag { ATTR_ALL = 0x0020, }; -enum MMPlayerSinkType { +enum mmplayer_sink_type { MMPLAYER_VIDEO_SINK = 0x01, MMPLAYER_AUDIO_SINK = 0x02, MMPLAYER_TEXT_SINK = 0x04, @@ -111,7 +114,7 @@ enum MMPlayerSinkType { /** * Enumerations of Player Uri type */ -enum MMPlayerUriType { +enum mmplayer_uri_type { MM_PLAYER_URI_TYPE_NONE, /**< Player URI type None */ MM_PLAYER_URI_TYPE_URL_RTSP, /**< Player URI type RTSP */ MM_PLAYER_URI_TYPE_URL_HTTP, /**< Player URI type HTTP */ @@ -127,18 +130,18 @@ enum MMPlayerUriType { MM_PLAYER_URI_TYPE_TEMP, /**< Player URI type Temp */ }; -typedef enum _MissingCodec { +typedef enum { MISSING_PLUGIN_NONE = 0x00, MISSING_PLUGIN_AUDIO = 0x01, MISSING_PLUGIN_VIDEO = 0x02 -} MissingCodec; +} missing_codec_e; -typedef enum _FoundCodec { +typedef enum { FOUND_PLUGIN_NONE = 0x00, FOUND_PLUGIN_AUDIO = 0x01, FOUND_PLUGIN_VIDEO = 0x02 -} FoundCodec; +} found_codec_e; /** * Enumeration of signal type @@ -151,10 +154,10 @@ typedef enum { MM_PLAYER_SIGNAL_TYPE_OTHERS, MM_PLAYER_SIGNAL_TYPE_ALL, MM_PLAYER_SIGNAL_TYPE_MAX = MM_PLAYER_SIGNAL_TYPE_ALL, -} MMPlayerSignalType; +} mmplayer_signal_type_e; /* main pipeline's element id */ -enum MainElementID { +typedef enum { MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */ MMPLAYER_M_SRC, MMPLAYER_M_2ND_SRC, /* 2nd Source Element for es buff src */ @@ -163,6 +166,7 @@ enum MainElementID { /* it could be a decodebin or could be a typefind. depends on player ini */ MMPLAYER_M_TYPEFIND, MMPLAYER_M_AUTOPLUG, + MMPLAYER_M_AUTOPLUG_PARSEBIN, MMPLAYER_M_AUTOPLUG_V_DEC, MMPLAYER_M_AUTOPLUG_A_DEC, @@ -173,7 +177,6 @@ enum MainElementID { /* streaming plugin */ MMPLAYER_M_MUXED_S_BUFFER, MMPLAYER_M_DEMUXED_S_BUFFER, - MMPLAYER_M_ID3DEMUX, MMPLAYER_M_ADAPTIVE_DEMUX, /* es buff src queue */ @@ -188,33 +191,43 @@ enum MainElementID { MMPLAYER_M_Q2, MMPLAYER_M_DEMUX, MMPLAYER_M_SUBPARSE, + MMPLAYER_M_V_PARSE, MMPLAYER_M_V_INPUT_SELECTOR, // video input_select MMPLAYER_M_A_INPUT_SELECTOR, // audio input_select MMPLAYER_M_T_INPUT_SELECTOR, // text input_select + MMPLAYER_M_V_CONCAT, // video concat + MMPLAYER_M_A_CONCAT, // audio concat + MMPLAYER_M_T_CONCAT, // text concat MMPLAYER_M_NUM -}; +} main_element_id_e; /* audio pipeline's element id */ -enum AudioElementID { +enum audio_element_id { MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */ MMPLAYER_A_CONV, MMPLAYER_A_VOL, MMPLAYER_A_FILTER, MMPLAYER_A_FILTER_SEC, - MMPLAYER_A_CAPS_DEFAULT, MMPLAYER_A_CONV_BFORMAT, MMPLAYER_A_CAPS_360, MMPLAYER_A_SINK, MMPLAYER_A_RESAMPLER, - MMPLAYER_A_DEINTERLEAVE, MMPLAYER_A_RGVOL, MMPLAYER_A_CONV_PITCH, MMPLAYER_A_PITCH, + MMPLAYER_A_TEE, + MMPLAYER_A_TEE_Q1, + MMPLAYER_A_TEE_Q2, + MMPLAYER_A_EXTRACT_CONV, + MMPLAYER_A_EXTRACT_RESAMPLER, + MMPLAYER_A_EXTRACT_CAPS, + MMPLAYER_A_EXTRACT_DEINTERLEAVE, + MMPLAYER_A_EXTRACT_SINK, MMPLAYER_A_NUM }; /* video pipeline's element id */ -enum VideoElementID { +enum video_element_id { MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */ MMPLAYER_V_CONV, MMPLAYER_V_CAPS, @@ -224,7 +237,7 @@ enum VideoElementID { }; /* text pipeline's element id */ -enum TextElementID { +enum text_element_id { MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */ MMPLAYER_T_QUEUE, MMPLAYER_T_VIDEO_QUEUE, @@ -235,14 +248,7 @@ enum TextElementID { MMPLAYER_T_NUM }; -/* midi main pipeline's element id */ -enum MidiElementID { - MMPLAYER_MIDI_PIPE, - MMPLAYER_MIDI_PLAYER, - MMPLAYER_MIDI_NUM -}; - -enum PlayerCommandState { +typedef enum { MMPLAYER_COMMAND_NONE, MMPLAYER_COMMAND_CREATE, MMPLAYER_COMMAND_DESTROY, @@ -253,13 +259,13 @@ enum PlayerCommandState { MMPLAYER_COMMAND_PAUSE, MMPLAYER_COMMAND_RESUME, MMPLAYER_COMMAND_NUM -}; +} mmplayer_command_state_e; -/* Note : StreamingSrcError is error enum for streaming source which post error message +/* Note : mmplayer_streaming_src_error is error enum for streaming source which post error message * using custom message made by itself. The enum value must start with zero, * because the streaming source(secrtspsrc) also does. */ -enum StreamingSrcError { +enum mmplayer_streaming_src_error { MMPLAYER_STREAMING_ERROR_NONE = 0, MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO, MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO, @@ -312,13 +318,13 @@ typedef enum { MMPLAYER_SEEK_NONE = 0, MMPLAYER_SEEK_IN_PROGRESS, MMPLAYER_SEEK_COMPLETED, /* after getting async done but before posting seek complete */ -} MMPlayerSeekState; +} mmplayer_seek_state_e; typedef enum { MMPLAYER_PATH_VOD = 0, MMPLAYER_PATH_TEXT, MMPLAYER_PATH_MAX -} MMPlayerPathType; +} mmplayer_path_type_e; /* Video360 related enums. These are duplication from video360.h from * gst-plugins-tizen. @@ -330,7 +336,7 @@ typedef enum { VIDEO360_MODE_STEREOSCOPIC_LEFT_RIGHT = 2, VIDEO360_MODE_STEREOSCOPIC_STEREO_MESH = 3, VIDEO360_MODE_LAST_ITEM -} mm_player_stereo_mode_e; +} mmplayer_stereo_mode_e; typedef enum { VIDEO360_PROJECTION_TYPE_UNKNOWN = -1, @@ -338,7 +344,7 @@ typedef enum { VIDEO360_PROJECTION_TYPE_CUBEMAP = 1, VIDEO360_PROJECTION_TYPE_MESH = 2, VIDEO360_PROJECTION_TYPE_LAST_ITEM -} mm_player_projection_type_e; +} mmplayer_projection_type_e; /* Spatial audio related enums. These are duplication from mm_file.h from * libmm-fileinfo. @@ -347,21 +353,28 @@ typedef enum { MMFILE_AMBISONIC_TYPE_UNKNOWN = 0, MMFILE_AMBISONIC_TYPE_PERIPHONIC = 1, /**< To comply with Google's Spatial Audio RFC*/ MMFILE_AMBISONIC_TYPE_NON_PERIPHONIC = 2, -} MMFILE_AMBISONIC_TYPE; +} mmfile_ambisonic_type_e; typedef enum { MMFILE_AMBISONIC_FORMAT_UNKNOWN = 0, MMFILE_AMBISONIC_FORMAT_AMBIX = 1, /**< AMBIX (Channel sequence: ACN, Normalization: SN3D) */ MMFILE_AMBISONIC_FORMAT_AMB = 2, /**< .AMB, Tetraproc (Channel sequence: FuMa, Normalization: FuMa) */ MMFILE_AMBISONIC_FORMAT_UA = 3, /**< Universal Ambisonics (Channel sequence: SID, Normalization: N3D) */ -} MMFILE_AMBISONIC_FORMAT; +} mmfile_ambisonic_format_e; typedef enum { MMFILE_AMBISONIC_ORDER_UNKNOWN = 0, MMFILE_AMBISONIC_ORDER_FOA = 1, /**< First order Ambisonics */ MMFILE_AMBISONIC_ORDER_SOA = 2, /**< Second order Ambisonics */ MMFILE_AMBISONIC_ORDER_TOA = 3, /**< Third order Ambisonics */ -} MMFILE_AMBISONIC_ORDER; +} mmfile_ambisonic_order_e; + +typedef enum { + MMPLAYER_RESOURCE_TYPE_VIDEO_DECODER, + MMPLAYER_RESOURCE_TYPE_VIDEO_OVERLAY, + MMPLAYER_RESOURCE_TYPE_AUDIO_OFFLOAD, + MMPLAYER_RESOURCE_TYPE_MAX, +} mmplayer_resource_type_e; /*--------------------------------------------------------------------------- | GLOBAL DATA TYPE DEFINITIONS: | @@ -370,86 +383,83 @@ typedef enum { typedef struct { int id; GstElement *gst; -} MMPlayerGstElement; +} mmplayer_gst_element_t; typedef struct { GstTagList *tag_list; - MMPlayerGstElement *mainbin; - MMPlayerGstElement *audiobin; - MMPlayerGstElement *videobin; - MMPlayerGstElement *textbin; -} MMPlayerGstPipelineInfo; + mmplayer_gst_element_t *mainbin; + mmplayer_gst_element_t *audiobin; + mmplayer_gst_element_t *videobin; + mmplayer_gst_element_t *textbin; +} mmplayer_pipeline_info_t; typedef struct { float volume; - int mute; - int bluetooth; /* enable/disable */ - int focus_id; + bool mute; bool rg_enable; -} MMPlayerSoundInfo; +} mmplayer_sound_info_t; typedef struct { char *buf; int len; int offset; -} MMPlayerInputBuffer; +} mmplayer_input_buffer_t; typedef struct { int uri_type; - MMPlayerInputBuffer input_mem; + mmplayer_input_buffer_t input_mem; char uri[MM_MAX_URL_LEN]; char urgent[MM_MAX_FILENAME_LEN]; -} MMPlayerParseProfile; +} mmplayer_parse_profile_t; typedef struct { storage_type_e type; storage_state_e state; int id; char path[MM_MAX_URL_LEN]; -} MMPlayerStorageInfo; +} mmplayer_storage_info_t; typedef struct { bool is_pending; gint64 pos; -} MMPlayerPendingSeek; +} mmplayer_pending_seek_t; typedef struct { GObject *obj; gulong sig; -} MMPlayerSignalItem; +} mmplayer_signal_item_t; typedef struct { bool rich_audio; - bool safety_volume; bool video_zc; // video zero-copy bool subtitle_off; - bool media_packet_video_stream; -} MMPlayerSetMode; + bool video_export; +} mmplayer_setting_mode_t; /* FIXME: renaming */ typedef struct { GMainContext *global_default; GMainContext *thread_default; -} MMPlayerGMainContext; +} mmplayer_context_info_t; typedef struct { gint uri_idx; GList *uri_list; -} MMPlayerUriList; +} mmplayer_uri_list_t; typedef struct { double scale_x; double scale_y; double scale_width; double scale_height; -} MMPlayerVideoROI; +} mmplayer_video_roi_t; typedef struct { - gint active_pad_index; + gint active_track_index; gint total_track_num; - GPtrArray *channels; - gulong block_id; - gulong event_probe_id; -} mm_player_selector_t; + GPtrArray *streams; + gulong block_id; /* FIXME: will be removed */ + gulong event_probe_id; /* FIXME: will be removed */ +} mmplayer_track_t; typedef struct { gboolean running; @@ -461,18 +471,17 @@ typedef struct { GstSegment segment[MM_PLAYER_TRACK_TYPE_MAX]; gboolean update_segment[MM_PLAYER_TRACK_TYPE_MAX]; -} mm_player_gapless_t; +} mmplayer_gapless_t; typedef struct { int channel; int bitrate; - int depth; - bool is_little_endian; guint64 channel_mask; void *pcm_data; int data_size; int buff_size; -} mm_player_audio_stream_buff_t; + media_format_mimetype_e pcm_format; +} mmplayer_audio_stream_buff_t; /** * @brief data of video_bo_list @@ -482,18 +491,25 @@ typedef struct { typedef struct { gboolean used; void *bo; -} mm_player_video_bo_info_t; +} mmplayer_video_bo_info_t; typedef struct { gint bandwidth; gint width; gint height; -} VariantData; +} stream_variant_t; typedef struct { GList *var_list; - VariantData limit; -} MMAdaptiveVariantInfo; + stream_variant_t limit; +} mmplayer_adaptive_variant_info_t; + +typedef struct { + GCond ticket_cond; + GMutex ticket_mutex; + guint ticket_queue_head; + guint ticket_queue_tail; +} mmplayer_ticket_lock_t; typedef struct { int is_spherical; @@ -501,8 +517,8 @@ typedef struct { char *stitching_software; char *projection_type_string; char *stereo_mode_string; - mm_player_projection_type_e projection_type; - mm_player_stereo_mode_e stereo_mode; + mmplayer_projection_type_e projection_type; + mmplayer_stereo_mode_e stereo_mode; int source_count; int init_view_heading; int init_view_pitch; @@ -517,7 +533,20 @@ typedef struct { int ambisonic_type; int ambisonic_format; int ambisonic_order; -} mm_player_spherical_metadata_t; +} mmplayer_spherical_metadata_t; + +typedef struct { + GModule *img_module; + GModule *imgp_module; + int (*create)(unsigned int, unsigned int, + int, const unsigned char *, size_t, void **); + void (*destroy)(void *); + int (*get)(void *, unsigned int *, unsigned int *, + int *, unsigned char **, size_t *); + void (*debug)(void *, const char *); + int (*rotate)(void *, int, void **); + int (*convert)(void *, int, void **); +} mm_img_util_interface_t; typedef struct { /* STATE */ @@ -532,24 +561,26 @@ typedef struct { int cmd; /* command lock */ - GMutex cmd_lock; - GMutex playback_lock; + mmplayer_ticket_lock_t *cmd_lock; + GMutex reconfigure_lock; + GCond reconfigure_cond; /* gapless play thread */ GThread *gapless_play_thread; gboolean gapless_play_thread_exit; GCond gapless_play_thread_cond; GMutex gapless_play_thread_mutex; - mm_player_gapless_t gapless; + mmplayer_gapless_t gapless; /* capture thread */ GThread *capture_thread; gboolean capture_thread_exit; GCond capture_thread_cond; GMutex capture_thread_mutex; - MMPlayerVideoCapture capture; - MMPlayerVideoColorspace video_cs; + mmplayer_video_capture_t capture; + mmplayer_video_color_space_e video_cs; MMVideoBuffer captured; + mm_img_util_interface_t *img_util; /* gst bus msg thread, create during realize */ GThread *bus_msg_thread; @@ -565,85 +596,75 @@ typedef struct { /* player attributes */ MMHandleType attrs; + mmplayer_attrs_spec_t *default_attrs; /* message callback */ MMMessageCallback msg_cb; void *msg_cb_param; /* streaming player */ - mm_player_streaming_t *streamer; + mmplayer_streaming_t *streamer; /* gstreamer pipeline */ - MMPlayerGstPipelineInfo *pipeline; + mmplayer_pipeline_info_t *pipeline; /* pad */ GstPad *ghost_pad_for_videobin; guint64 media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_MAX]; guint media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_MAX]; - mm_player_media_stream_buffer_status_callback media_stream_buffer_status_cb[MM_PLAYER_STREAM_TYPE_MAX]; - mm_player_media_stream_seek_data_callback media_stream_seek_data_cb[MM_PLAYER_STREAM_TYPE_MAX]; - GMutex media_stream_cb_lock; - - int video_num_buffers; /* total num of buffers in vcodec */ - int video_extra_num_buffers; /* extra num of buffers in vcodec */ - - void *buffer_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX]; - void *seek_cb_user_param[MM_PLAYER_STREAM_TYPE_MAX]; - - /* video stream changed callback */ - mm_player_stream_changed_callback video_stream_changed_cb; - void *video_stream_changed_cb_user_param; /* audio stream changed callback */ mm_player_stream_changed_callback audio_stream_changed_cb; void *audio_stream_changed_cb_user_param; /* video stream callback */ - mm_player_video_stream_callback video_stream_cb; - void *video_stream_cb_user_param; + mm_player_video_decoded_callback video_decoded_cb; + void *video_decoded_cb_user_param; GCond video_bo_cond; GMutex video_bo_mutex; - GList *video_bo_list; /* mm_player_video_bo_info_t, bo list for decoded video data by sw codec */ + GList *video_bo_list; /* mmplayer_video_bo_info_t, bo list for decoded video data by sw codec */ int video_bo_size; bool video_stream_prerolled; /* audio stream callback */ - mm_player_audio_stream_callback audio_stream_render_cb; - void *audio_stream_cb_user_param; - bool audio_stream_sink_sync; - GList *audio_stream_buff_list; /* mm_player_audio_stream_buff_t, buff list of extract pcm data */ + mm_player_audio_decoded_callback audio_decoded_cb; + void *audio_decoded_cb_user_param; + GList *audio_stream_buff_list; /* mmplayer_audio_stream_buff_t, buff list of extract pcm data */ + mmplayer_audio_extract_opt_e audio_extract_opt; /* video capture callback*/ gulong video_capture_cb_probe_id; /* sound info */ - MMPlayerSoundInfo sound; + mmplayer_sound_info_t sound; /* type string */ gchar *type; + GstCaps *type_caps; /* video stream caps parsed by demuxer */ GstCaps *v_stream_caps; - /* audio effect infomation */ - MMAudioEffectInfo audio_effect_info; + /* audio effect information */ + mm_audio_effect_info_t audio_effect_info; gboolean bypass_audio_effect; /* content profile */ - MMPlayerParseProfile profile; - MMPlayerStorageInfo storage_info[MMPLAYER_PATH_MAX]; + mmplayer_parse_profile_t profile; + mmplayer_storage_info_t storage_info[MMPLAYER_PATH_MAX]; /* streaming service type */ MMStreamingType streaming_type; /* autoplugging */ GList *factories; - GList *parsers; // list of linked parser name GList *audio_decoders; // list of linked audio name gboolean no_more_pad; gint num_dynamic_pad; gboolean has_many_types; + gboolean need_audio_dec_sorting; + gboolean need_video_dec_sorting; /* progress callback timer */ /* FIXIT : since duplicated functionality with get_position @@ -674,7 +695,7 @@ typedef struct { gint textsink_linked; /* missing plugin during autoplugging */ - MissingCodec not_supported_codec; + missing_codec_e not_supported_codec; /* unlinked audio/video mime type */ gchar *unlinked_video_mime; @@ -682,13 +703,13 @@ typedef struct { gchar *unlinked_demuxer_mime; /* found codec during autoplugging */ - FoundCodec can_support_codec; + found_codec_e can_support_codec; gboolean not_found_demuxer; /* support seek even though player is not start */ - MMPlayerPendingSeek pending_seek; - MMPlayerSeekState seek_state; + mmplayer_pending_seek_t pending_seek; + mmplayer_seek_state_e seek_state; /* prevent to post msg over and over */ gboolean msg_posted; @@ -696,13 +717,17 @@ typedef struct { /* list of sink elements */ GList *sink_elements; + /* for destroy bus thread */ + GMutex bus_watcher_mutex; + GCond bus_watcher_cond; + /* signal notifiers */ GList *signals[MM_PLAYER_SIGNAL_TYPE_MAX]; guint bus_watcher; GQueue *bus_msg_q; GMutex bus_msg_q_lock; - MMPlayerGMainContext context; - MMPlayerUriList uri_info; + mmplayer_context_info_t context; + mmplayer_uri_list_t uri_info; gboolean is_sound_extraction; @@ -715,8 +740,7 @@ typedef struct { /* resource manager for H/W resources */ mm_resource_manager_h resource_manager; - mm_resource_manager_res_h video_overlay_resource; - mm_resource_manager_res_h video_decoder_resource; + mm_resource_manager_res_h hw_resource[MMPLAYER_RESOURCE_TYPE_MAX]; gboolean interrupted_by_resource; gboolean is_subtitle_off; @@ -730,7 +754,7 @@ typedef struct { guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX]; guint total_maximum_bitrate; - /* prevent it from posting duplicatly*/ + /* prevent from posting duplicated BOS message */ gboolean sent_bos; gboolean play_subtitle; @@ -742,21 +766,19 @@ typedef struct { GCond subtitle_info_cond; GMutex subtitle_info_mutex; - /* To store the current multiwindow status */ - gboolean last_multiwin_status; - - /* To store the current running audio pad index of demuxer */ - gint demux_pad_index; + /* stream collection */ + GstStreamCollection *collection; + guint stream_notify_id; - mm_player_selector_t selector[MM_PLAYER_TRACK_TYPE_MAX]; + mmplayer_track_t track[MM_PLAYER_TRACK_TYPE_MAX]; guint internal_text_idx; guint external_text_idx; - MMPlayerSetMode set_mode; + mmplayer_setting_mode_t set_mode; /* initialize values */ - mm_player_ini_t ini; + mmplayer_ini_t ini; /* store dump pad list */ GList *dump_list; @@ -774,16 +796,16 @@ typedef struct { /* es player using feed-data callback or calling app_src_push_buffer directly*/ gboolean es_player_push_mode; - /* tmb buffer manager for s/w codec tmb_bo */ + /* tbm buffer manager for s/w codec tmb_bo */ tbm_bufmgr bufmgr; - MMAdaptiveVariantInfo adaptive_info; + mmplayer_adaptive_variant_info_t adaptive_info; /* Video360 related stuff * */ gboolean is_360_feature_enabled; gboolean is_content_spherical; - mm_player_spherical_metadata_t video360_metadata; + mmplayer_spherical_metadata_t video360_metadata; gboolean is_openal_plugin_used; /* User settable values */ gboolean is_video360_enabled; @@ -794,33 +816,26 @@ typedef struct { int video360_vertical_fov; /* Video ROI area scale value */ - MMPlayerVideoROI video_roi; + mmplayer_video_roi_t video_roi; /* build audio offload */ gboolean build_audio_offload; -} mm_player_t; + guint audio_device_cb_id; + + int client_pid; +} mmplayer_t; typedef struct { gchar *language_code; gchar *language_key; gboolean active; -} MMPlayerLangStruct; +} mmplayer_lang_info_t; typedef struct { GstPad *dump_pad; gulong probe_handle_id; FILE *dump_element_file; -} mm_player_dump_t; - -typedef struct { - char *name; - int value_type; - int flags; // r, w - void *default_value; - int valid_type; // validity type - int value_min; //<- set validity value range - int value_max; //-> -} MMPlayerAttrsSpec; +} mmplayer_dump_t; /*=========================================================================================== | | @@ -835,35 +850,33 @@ int _mmplayer_create_player(MMHandleType hplayer); int _mmplayer_destroy(MMHandleType hplayer); int _mmplayer_realize(MMHandleType hplayer); int _mmplayer_unrealize(MMHandleType hplayer); -int _mmplayer_get_state(MMHandleType hplayer, int *pstate); -int _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume); -int _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType *volume); -int _mmplayer_set_mute(MMHandleType hplayer, int mute); -int _mmplayer_get_mute(MMHandleType hplayer, int *pmute); +int _mmplayer_get_state(MMHandleType hplayer, int *state); +int _mmplayer_set_volume(MMHandleType hplayer, float volume); +int _mmplayer_get_volume(MMHandleType hplayer, float *volume); +int _mmplayer_set_mute(MMHandleType hplayer, bool mute); +int _mmplayer_get_mute(MMHandleType hplayer, bool *mute); int _mmplayer_start(MMHandleType hplayer); int _mmplayer_stop(MMHandleType hplayer); int _mmplayer_pause(MMHandleType hplayer); int _mmplayer_abort_pause(MMHandleType hplayer); int _mmplayer_resume(MMHandleType hplayer); int _mmplayer_set_position(MMHandleType hplayer, gint64 pos); -int _mmplayer_get_position(MMHandleType hplayer, gint64 *pos); int _mmplayer_get_duration(MMHandleType hplayer, gint64 *duration); -int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format, int pos); +int _mmplayer_adjust_subtitle_position(MMHandleType hplayer, int pos); int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming); int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param); -int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param); int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param); -int _mmplayer_set_videostream_cb(MMHandleType hplayer, mm_player_video_stream_callback callback, void *user_param); +int _mmplayer_set_video_decoded_cb(MMHandleType hplayer, mm_player_video_decoded_callback callback, void *user_param); int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent); int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int *silent); int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char *filepath); int _mmplayer_get_buffer_position(MMHandleType hplayer, int *start_pos, int *end_pos); -int _mmplayer_update_video_param(mm_player_t *player, char *param_name); -int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay); -int _mmplayer_audio_effect_custom_apply(mm_player_t *player); -int _mmplayer_set_audiostream_cb(MMHandleType hplayer, bool sync, mm_player_audio_stream_callback callback, void *user_param); -int _mmplayer_change_track_language(MMHandleType hplayer, MMPlayerTrackType type, int index); -int _mmplayer_sync_subtitle_pipeline(mm_player_t *player); +int _mmplayer_update_video_overlay_param(mmplayer_t *player, const char *param_name); +int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, int wl_surface_id); +int _mmplayer_audio_effect_custom_apply(mmplayer_t *player); +int _mmplayer_set_audio_decoded_cb(MMHandleType hplayer, mmplayer_audio_extract_opt_e opt, mm_player_audio_decoded_callback callback, void *user_param); +int _mmplayer_change_track_language(MMHandleType hplayer, mmplayer_track_type_e type, int index); +int _mmplayer_sync_subtitle_pipeline(mmplayer_t *player); int _mmplayer_use_system_clock(MMHandleType hplayer); int _mmplayer_set_uri(MMHandleType hplayer, const char *uri); int _mmplayer_set_next_uri(MMHandleType hplayer, const char *uri, bool is_first_path); @@ -871,43 +884,56 @@ int _mmplayer_get_next_uri(MMHandleType hplayer, char **uri); int _mmplayer_has_closed_caption(MMHandleType hplayer, bool *exist); void _mm_player_video_stream_internal_buffer_unref(void *buffer); int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout); -int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num); int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int id, int state); -int _mmplayer_video_stream_release_bo(mm_player_t *player, void *bo); +int _mmplayer_video_stream_release_bo(mmplayer_t *player, void *bo); int _mmplayer_get_adaptive_variant_info(MMHandleType hplayer, int *num, char **var_info); int _mmplayer_set_max_adaptive_variant_limit(MMHandleType hplayer, int bandwidth, int width, int height); int _mmplayer_get_max_adaptive_variant_limit(MMHandleType hplayer, int *bandwidth, int *width, int *height); int _mmplayer_set_audio_only(MMHandleType hplayer, bool audio_only); -int _mmplayer_get_audio_only(MMHandleType hplayer, bool *paudio_only); int _mmplayer_get_streaming_buffering_time(MMHandleType hplayer, int *prebuffer_ms, int *rebuffer_ms); -int _mmplayer_set_codec_type(MMHandleType hplayer, MMPlayerStreamType stream_type, MMPlayerVideoCodecType codec_type); +int _mmplayer_set_codec_type(MMHandleType hplayer, mmplayer_stream_type_e stream_type, mmplayer_codec_type_e codec_type); int _mmplayer_set_replaygain_enabled(MMHandleType hplayer, bool enabled); int _mmplayer_is_replaygain_enabled(MMHandleType hplayer, bool *enabled); int _mmplayer_set_video_roi_area(MMHandleType hplayer, double scale_x, double scale_y, double scale_width, double scale_height); int _mmplayer_get_video_roi_area(MMHandleType hplayer, double *scale_x, double *scale_y, double *scale_width, double *scale_height); +int _mmplayer_audio_offload_is_activated(MMHandleType hplayer, bool *activated); +int _mmplayer_is_audio_control_available(MMHandleType hplayer, mmplayer_audio_control_opt_e opt, bool *available); /* internal */ -void __mmplayer_bus_msg_thread_destroy(MMHandleType hplayer); - -void __mmplayer_set_state(mm_player_t *player, int state); -int __mmplayer_check_state(mm_player_t *player, enum PlayerCommandState command); -gboolean __mmplayer_update_content_attrs(mm_player_t *player, enum content_attr_flag flag); -void __mmplayer_cancel_eos_timer(mm_player_t *player); -void __mmplayer_audio_stream_clear_buffer(mm_player_t *player, gboolean send_all); -MMStreamingType __mmplayer_get_stream_service_type(mm_player_t *player); -int __mmplayer_get_video_angle(mm_player_t *player, int *display_angle, int *orientations); -gboolean __mmplayer_gst_remove_fakesink(mm_player_t *player, MMPlayerGstElement *fakesink); -void __mmplayer_add_signal_connection(mm_player_t *player, GObject *object, MMPlayerSignalType type, const gchar *signal, GCallback cb_funct, gpointer u_data); -void __mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data); -gint __mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data); -gboolean __mmplayer_gst_create_decoder(mm_player_t *player, GstPad *srcpad, const GstCaps *caps); -void __mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data); -GstElement *__mmplayer_gst_make_decodebin(mm_player_t *player); -int __mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket); -int __mmplayer_gst_element_link_bucket(GList *element_bucket); -void __mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data); -int __mmplayer_parse_profile(const char *uri, void *param, MMPlayerParseProfile *data); - +void _mmplayer_bus_msg_thread_destroy(MMHandleType hplayer); +void _mmplayer_bus_watcher_remove(MMHandleType hplayer); +void _mmplayer_watcher_removed_notify(gpointer data); +void _mmplayer_set_state(mmplayer_t *player, int state); +int _mmplayer_check_state(mmplayer_t *player, mmplayer_command_state_e command); +gboolean _mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag); +void _mmplayer_cancel_eos_timer(mmplayer_t *player); +void _mmplayer_audio_stream_clear_buffer(mmplayer_t *player, gboolean send_all); +MMStreamingType _mmplayer_get_stream_service_type(mmplayer_t *player); +int _mmplayer_get_video_angle(mmplayer_t *player, int *display_angle, int *orientations); +gboolean _mmplayer_gst_remove_fakesink(mmplayer_t *player, mmplayer_gst_element_t *fakesink); +void _mmplayer_add_signal_connection(mmplayer_t *player, GObject *object, mmplayer_signal_type_e type, const gchar *signal, GCallback cb_funct, gpointer u_data); +void _mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data); +gint _mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data); +GValueArray *_mmplayer_gst_decode_autoplug_sort(GstElement *bin, GstPad *pad, GstCaps *caps, GValueArray *factories, gpointer data); +gboolean _mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps *caps); +void _mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data); +GstElement *_mmplayer_gst_make_decodebin(mmplayer_t *player); +int _mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket); +int _mmplayer_gst_element_link_bucket(GList *element_bucket); +void _mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data); +int _mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data); +int _mmplayer_set_client_pid(MMHandleType hplayer, int pid); +void _mmplayer_set_reconfigure_state(mmplayer_t *player, gboolean state); +void _mmplayer_gst_decode_pad_removed(GstElement *elem, GstPad *new_pad, gpointer data); +void _mmplayer_gst_decode_no_more_pads(GstElement *elem, gpointer data); +void _mmplayer_gst_decode_drained(GstElement *bin, gpointer data); +void _mmplayer_gst_about_to_finish(GstElement *bin, gpointer data); +int _mmplayer_update_not_supported_codec_info(mmplayer_t *player, const gchar *factory_class, const gchar *mime); +void _mmplayer_gst_decode_unknown_type(GstElement *elem, GstPad *pad, GstCaps *caps, gpointer data); +gboolean _mmplayer_gst_decode_autoplug_continue(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer data); +void _mmplayer_pipeline_complete(GstElement *decodebin, gpointer data); +void _mmplayer_set_audio_attrs(mmplayer_t *player, GstCaps *caps); +int _mmplayer_acquire_hw_resource(mmplayer_t *player, mmplayer_resource_type_e type); #ifdef __cplusplus }