| |
========================================================================================== */
#include <glib.h>
+#include <gmodule.h>
#include <gst/gst.h>
#include <mm_attrs.h>
#include <math.h>
/* 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;
} 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;
+ mmplayer_ticket_lock_t *cmd_lock;
GMutex reconfigure_lock;
GCond reconfigure_cond;
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;
/* 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;
/* 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;
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;
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_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_codec_type_e codec_type);
int _mmplayer_set_replaygain_enabled(MMHandleType hplayer, bool enabled);
/* 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);
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);
+void _mmplayer_gst_element_added(GstBin *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_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
}