[0.6.270] fix crash during gapless playback
[platform/core/multimedia/libmm-player.git] / src / include / mm_player_priv.h
index 1f321f1..4d9df97 100644 (file)
@@ -29,6 +29,7 @@
 |                                                                                                                                                                              |
 ========================================================================================== */
 #include <glib.h>
+#include <gmodule.h>
 #include <gst/gst.h>
 #include <mm_attrs.h>
 #include <math.h>
@@ -176,7 +177,6 @@ typedef enum {
        /* streaming plugin */
        MMPLAYER_M_MUXED_S_BUFFER,
        MMPLAYER_M_DEMUXED_S_BUFFER,
-       MMPLAYER_M_ID3DEMUX,
        MMPLAYER_M_ADAPTIVE_DEMUX,
 
        /* es buff src queue */
@@ -191,9 +191,13 @@ typedef enum {
        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;
 
@@ -501,6 +505,13 @@ typedef struct {
 } 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;
@@ -525,6 +536,19 @@ typedef struct {
 } 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
@@ -537,7 +561,7 @@ typedef struct {
        int cmd;
 
        /* command lock */
-       GMutex cmd_lock;
+       mmplayer_ticket_lock_t *cmd_lock;
        GMutex reconfigure_lock;
        GCond reconfigure_cond;
 
@@ -556,6 +580,7 @@ typedef struct {
        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;
@@ -616,11 +641,12 @@ typedef struct {
 
        /* 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;
 
@@ -728,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;
@@ -770,7 +796,7 @@ 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;
 
        mmplayer_adaptive_variant_info_t adaptive_info;
@@ -836,7 +862,7 @@ int _mmplayer_abort_pause(MMHandleType hplayer);
 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);
@@ -864,7 +890,6 @@ int _mmplayer_get_adaptive_variant_info(MMHandleType hplayer, int *num, char **v
 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);
@@ -902,6 +927,8 @@ 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);