| |
========================================================================================== */
#include <glib.h>
+#include <gmodule.h>
#include <gst/gst.h>
#include <mm_attrs.h>
#include <math.h>
#include "mm_player_ini.h"
#include <mm_resource_manager.h>
#include "mm_player_streaming.h"
+#include "mm_player_attrs.h"
/*===========================================================================================
| |
#define VIDEO360_MAX_ZOOM 10.0f
-#define DEFAULT_NUM_OF_V_OUT_BUFFER 3
+#define DEFAULT_NUM_OF_V_OUT_BUFFER 4
/*---------------------------------------------------------------------------
| GLOBAL CONSTANT DEFINITIONS: |
/* 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,
/* streaming plugin */
MMPLAYER_M_MUXED_S_BUFFER,
MMPLAYER_M_DEMUXED_S_BUFFER,
- MMPLAYER_M_ID3DEMUX,
MMPLAYER_M_ADAPTIVE_DEMUX,
/* es buff src queue */
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;
} 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;
-} mmplayer_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;
typedef struct {
int channel;
int bitrate;
- int depth;
- bool is_little_endian;
guint64 channel_mask;
void *pcm_data;
int data_size;
} 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;
int is_stitched;
char *stitching_software;
} 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 */
int state; // player current state
int prev_state; // player previous state
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;
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;
/* player attributes */
MMHandleType attrs;
+ mmplayer_attrs_spec_t *default_attrs;
/* message callback */
MMMessageCallback msg_cb;
/* type string */
gchar *type;
+ GstCaps *type_caps;
/* video stream caps parsed by demuxer */
GstCaps *v_stream_caps;
- /* audio effect infomation */
+ /* audio effect information */
mm_audio_effect_info_t audio_effect_info;
gboolean bypass_audio_effect;
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
/* 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;
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;
GCond subtitle_info_cond;
GMutex subtitle_info_mutex;
- /* To store the current running audio pad index of demuxer */
- gint demux_pad_index;
+ /* stream collection */
+ GstStreamCollection *collection;
+ guint stream_notify_id;
- mmplayer_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;
/* 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;
mmplayer_adaptive_variant_info_t adaptive_info;
FILE *dump_element_file;
} mmplayer_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; //->
-} mmplayer_attrs_spec_t;
-
/*===========================================================================================
| |
| GLOBAL FUNCTION PROTOTYPES |
int _mmplayer_resume(MMHandleType hplayer);
int _mmplayer_set_position(MMHandleType hplayer, gint64 pos);
int _mmplayer_get_duration(MMHandleType hplayer, gint64 *duration);
-int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, 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_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
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(mmplayer_t *player, char *param_name);
-int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
+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_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, mmplayer_stream_type_e stream_type, mmplayer_video_codec_type_e 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_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_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);
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
}