apply 'use decodebin' option
[platform/core/multimedia/libmm-player.git] / src / include / mm_player_ini.h
index 51bf8c0..ab4d4a9 100644 (file)
 #define MM_PLAYER_INI_DEFAULT_PATH     SYSCONFDIR"/multimedia/mmfw_player.ini" /* SYSCONFDIR is defined at .spec */
 #define MM_PLAYER_INI_DEFAULT_AUDIOEFFECT_PATH SYSCONFDIR"/multimedia/mmfw_player_audio_effect.ini" /* SYSCONFDIR is defined at .spec */
 
-#define PLAYER_INI_MAX_STRLEN  100
-#define PLAYER_INI_MAX_PARAM_STRLEN    256
+#define PLAYER_INI_MAX_STRLEN       100
+#define PLAYER_INI_MAX_PARAM_STRLEN 256
 
-#define PLAYER_INI_MAX_ELEMENT 10
+#define PLAYER_INI_MAX_ELEMENT      10
+#define PLAYER_INI_MAX_DEVICE_TYPE  10
+#define PLAYER_INI_MAX_SUPPORTED_MEDIA_FORMAT 10 /* @see MAX_SUPPORTED_MEDIA_FORMAT in player_private.h */
 
 /* NOTE : MMPlayer has no initalizing API for library itself
  * so we cannot decide when those ini values to be released.
  * before that time, we should be careful with size limitation
  * of each string item.
  */
-enum keyword_type
-{
-       KEYWORD_EXCLUDE,        // for element exclude keyworld
-       KEYWORD_DUMP            // for dump element keyworld
+enum keyword_type {
+       KEYWORD_EXCLUDE,    // for element exclude keyword
+       KEYWORD_DUMP,       // for dump element keyword
+       KEYWORD_UNSUPPORTED_CODEC, // for un-supported codec
+       KEYWORD_A_SW_CODEC, // for audio sw codec
+       KEYWORD_V_SW_CODEC, // for video sw codec
+       KEYWORD_A_OFFLOAD_DEVICE_TYPE,  // for audio device type which can support offload
+       KEYWORD_A_OFFLOAD_MEDIA_FORMAT, // supported media format for audio offload
+       KEYWORD_MEDIA_STREAM_IN_FORMAT, // supported media format for external media stream
 };
 
-typedef struct __mm_player_ini
-{
+typedef struct {
        /* general */
        gchar videosink_element_overlay[PLAYER_INI_MAX_STRLEN];
-       gchar videosink_element_evas[PLAYER_INI_MAX_STRLEN];
        gchar videosink_element_fake[PLAYER_INI_MAX_STRLEN];
-       gchar videosink_element_remote[PLAYER_INI_MAX_STRLEN];
-       gchar videosrc_element_remote[PLAYER_INI_MAX_STRLEN];
        gchar videoconverter_element[PLAYER_INI_MAX_STRLEN];
+       gchar videocodec_element_hw[PLAYER_INI_MAX_STRLEN];
+       gchar videocodec_element_sw[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
+       gchar videocodec_default_type[PLAYER_INI_MAX_STRLEN];
+       gchar audiocodec_element_hw[PLAYER_INI_MAX_STRLEN];
+       gchar audiocodec_element_sw[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
+       gchar audiocodec_default_type[PLAYER_INI_MAX_STRLEN];
        gchar audioresampler_element[PLAYER_INI_MAX_STRLEN];
        gchar audiosink_element[PLAYER_INI_MAX_STRLEN];
+       gchar audio_offload_sink_element[PLAYER_INI_MAX_STRLEN];
+       gchar audio_offload_device_type[PLAYER_INI_MAX_DEVICE_TYPE][PLAYER_INI_MAX_STRLEN];
+       gchar audio_offload_media_format[PLAYER_INI_MAX_SUPPORTED_MEDIA_FORMAT][PLAYER_INI_MAX_STRLEN];
+       gchar media_stream_input_format[PLAYER_INI_MAX_SUPPORTED_MEDIA_FORMAT][PLAYER_INI_MAX_STRLEN];
        gboolean skip_rescan;
        gboolean generate_dot;
        gboolean use_system_clock;
@@ -75,18 +88,23 @@ typedef struct __mm_player_ini
        gint localplayback_state_change_timeout;
        gint delay_before_repeat;
        gint eos_delay;
+       gboolean use_decodebin;
 
        gchar gst_param[5][PLAYER_INI_MAX_PARAM_STRLEN];
        gchar exclude_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
-       gboolean async_start;
+       gchar unsupported_codec_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
        gboolean disable_segtrap;
+       gint pcm_buffer_size;
+       gint num_of_video_bo;
+       gint video_bo_timeout;
+       gboolean support_audio_effect;
+       gboolean support_pcm_exporting;
+       gboolean support_pitch_control;
+       gboolean support_replaygain_control;
 
        /* http streaming */
        gchar httpsrc_element[PLAYER_INI_MAX_STRLEN];
-       gchar http_file_buffer_path[PLAYER_INI_MAX_STRLEN];
-       gdouble http_buffering_limit;
-       guint http_max_size_bytes;
-       gdouble http_buffering_time;
+       guint http_ring_buffer_size;
        gint http_timeout;
 
        /* audio effect */
@@ -113,129 +131,67 @@ typedef struct __mm_player_ini
        gchar dump_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
        gchar dump_element_path[PLAYER_INI_MAX_STRLEN];
        gboolean set_dump_element_flag;
-} mm_player_ini_t;
+} mmplayer_ini_t;
 
 /* default values if each values are not specified in inifile */
 /* general */
-#define DEFAULT_AUDIO_EFFECT_ELEMENT                   ""
-#define DEFAULT_USE_AUDIO_EFFECT_PRESET                        FALSE
-#define DEFAULT_AUDIO_EFFECT_PRESET_LIST               ""
-#define DEFAULT_AUDIO_EFFECT_PRESET_LIST_EARPHONE_ONLY ""
-#define DEFAULT_USE_AUDIO_EFFECT_CUSTOM                        FALSE
-#define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST               ""
-#define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST_EARPHONE_ONLY ""
-#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_NUM                0
-#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_WIDTH              ""
-#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_FREQ               ""
-#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MIN             0
-#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MAX             0
-#define DEFAULT_AUDIO_EFFECT_CUSTOM_EXT_NUM            0
-#define DEFAULT_USE_SINK_HANDLER                       TRUE
-#define DEFAULT_SKIP_RESCAN                            TRUE
-#define DEFAULT_GENERATE_DOT                           FALSE
-#define DEFAULT_USE_SYSTEM_CLOCK               TRUE
-#define DEFAULT_DELAY_BEFORE_REPEAT                    50 /* msec */
-#define DEFAULT_EOS_DELAY                              0 /* msec */
-#define DEFAULT_VIDEOSINK_OVERLAY                      "waylandsink"
-#define DEFAULT_VIDEOSINK_EVAS                         "evasimagesink"
-#define DEFAULT_VIDEOSINK_FAKE                         "fakesink"
-#define DEFAULT_VIDEOSINK_REMOTE                       "shmsink"
-#define DEFAULT_VIDEOSRC_REMOTE                                "shmsrc"
-#define DEFAULT_AUDIORESAMPLER                 "audioresample"
-#define DEFAULT_AUDIOSINK                              "pulsesink"
-#define DEFAULT_GST_PARAM                              ""
-#define DEFAULT_EXCLUDE_KEYWORD                                ""
-#define DEFAULT_ASYNC_START                            TRUE
-#define DEFAULT_DISABLE_SEGTRAP                                TRUE
-#define DEFAULT_VIDEO_CONVERTER                                ""
-#define DEFAULT_LIVE_STATE_CHANGE_TIMEOUT              30 /* sec */
-#define DEFAULT_LOCALPLAYBACK_STATE_CHANGE_TIMEOUT     10 /* sec */
+#define DEFAULT_EMPTY_VALUE                               ""
+#define DEFAULT_AUDIO_EFFECT_ELEMENT                      ""
+#define DEFAULT_USE_AUDIO_EFFECT_PRESET                   FALSE
+#define DEFAULT_AUDIO_EFFECT_PRESET_LIST                  ""
+#define DEFAULT_AUDIO_EFFECT_PRESET_LIST_EARPHONE_ONLY    ""
+#define DEFAULT_USE_AUDIO_EFFECT_CUSTOM                   FALSE
+#define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST                  ""
+#define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST_EARPHONE_ONLY    ""
+#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_NUM           0
+#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_WIDTH         ""
+#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_FREQ          ""
+#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MIN                0
+#define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MAX                0
+#define DEFAULT_AUDIO_EFFECT_CUSTOM_EXT_NUM               0
+#define DEFAULT_USE_SINK_HANDLER                          TRUE
+#define DEFAULT_SKIP_RESCAN                               TRUE
+#define DEFAULT_GENERATE_DOT                              FALSE
+#define DEFAULT_USE_SYSTEM_CLOCK                          TRUE
+#define DEFAULT_DELAY_BEFORE_REPEAT                       50 /* msec */
+#define DEFAULT_EOS_DELAY                                 0 /* msec */
+#define DEFAULT_VIDEOSINK_OVERLAY                         "tizenwlsink"
+#define DEFAULT_VIDEOSINK_EVAS                            "evasimagesink"
+#define DEFAULT_VIDEOSINK_FAKE                            "fakesink"
+#define DEFAULT_AUDIORESAMPLER                            "audioresample"
+#define DEFAULT_AUDIOSINK                                 "pulsesink"
+#define DEFAULT_A_OFFLOAD_DEVICE_TYPE                     ""
+#define DEFAULT_GST_PARAM                                 ""
+#define DEFAULT_EXCLUDE_KEYWORD                           ""
+#define DEFAULT_UNSUPPORTED_CODEC_KEYWORD                 ""
+#define DEFAULT_DISABLE_SEGTRAP                           TRUE
+#define DEFAULT_VIDEO_CONVERTER                           ""
+#define DEFAULT_LIVE_STATE_CHANGE_TIMEOUT                 30 /* sec */
+#define DEFAULT_LOCALPLAYBACK_STATE_CHANGE_TIMEOUT        10 /* sec */
+#define DEFAULT_PCM_BUFFER_SIZE                           51200 /* bytes */
+#define DEFAULT_NUM_OF_VIDEO_BO                           10
+#define DEFAULT_TIMEOUT_OF_VIDEO_BO                       10 /* sec */
+#define DEFAULT_AUDIO_OFFLOAD_SINK                        ""
+#define DEFAULT_SUPPORT_AUDIO_EFFECT                      FALSE /* with HW audio codec */
+#define DEFAULT_SUPPORT_PCM_EXPORTING                     FALSE /* with HW audio codec */
+#define DEFAULT_SUPPORT_PITCH_CONTROL                     FALSE /* with HW audio codec */
+#define DEFAULT_SUPPORT_REPLAYGAIN_CONTROL                FALSE /* with HW audio codec */
+#define DEFAULT_USE_DECODEBIN                             FALSE
+
 /* http streaming */
-#define DEFAULT_HTTPSRC                                "souphttpsrc"
-#define DEFAULT_HTTP_FILE_BUFFER_PATH          "/home/owner/content"
-#define DEFAULT_HTTP_BUFFERING_LIMIT   99.0            /* percent */
-#define DEFAULT_HTTP_MAX_SIZE_BYTES            1048576         /* bytes : 1 MBytes  */
-#define DEFAULT_HTTP_BUFFERING_TIME            1.2                     /* sec */
-#define DEFAULT_HTTP_TIMEOUT                   -1                      /* infinite retry */
+#define DEFAULT_HTTPSRC                                   "souphttpsrc"
+#define DEFAULT_HTTP_RING_BUFFER_SIZE                     (20*1024*1024) /* bytes : 20MBytes */
+#define DEFAULT_HTTP_TIMEOUT                              -1        /* infinite retry */
 
 /* dump buffer for debug */
-#define DEFAULT_DUMP_ELEMENT_KEYWORD                           ""
-#define DEFAULT_DUMP_ELEMENT_PATH                              "/tmp/"
-
-/* NOTE : following content should be same with above default values */
-/* FIXIT : need smarter way to generate default ini file. */
-/* FIXIT : finally, it should be an external file */
-#define MM_PLAYER_DEFAULT_INI \
-"\
-[general] \n\
-\n\
-disable segtrap = yes ; same effect with --gst-disable-segtrap \n\
-\n\
-; set default video sink but, it can be replaced with others selected by application\n\
-; 0:v4l2sink, 1:ximagesink, 2:xvimagesink, 3:fakesink 4:evasimagesink 5:glimagesink\n\
-videosink element = 2 \n\
-\n\
-video converter element = \n\
-\n\
-audiosink element = pulsesink \n\
-\n\
-; if yes. gstreamer will not update registry \n\
-skip rescan = yes \n\
-\n\
-delay before repeat = 50 ; msec\n\
-\n\
-; comma separated list of tocken which elemnts has it in it's name will not be used \n\
-element exclude keyword = \n\
-\n\
-async start = yes \n\
-\n\
-; parameters for initializing gstreamer \n\
-gstparam1 = --gst-debug=2\n\
-gstparam2 = \n\
-gstparam3 = \n\
-gstparam4 = \n\
-gstparam5 = \n\
-\n\
-; generating dot file representing pipeline state \n\
-; export GST_DEBUG_DUMP_DOT_DIR=/tmp/\n\
-generate dot = no \n\
-\n\
-; parameter is for only video to be determined \n\
-; which clock will be used \n\
-; if yes, system clock will be used \n\
-; apart from this, audiosink is clock provider for audio \n\
-use system clock = yes \n\
-\n\
-; allowed timeout for changing pipeline state \n\
-live state change timeout = 30 ; sec \n\
-localplayback state change timeout = 4 ; sec \n\
-\n\
-; delay in msec for sending EOS \n\
-eos delay = 150 ; msec \n\
-\n\
-\n\
-[http streaming] \n\
-\n\
-httppsrc element = souphttpsrc \n\
-\n\
-; if set, use file or not use memory for buffering\n\
-http file buffer path = /opt/usr/media\n\
-\n\
-http buffering limit = 99 ; percent\n\
-\n\
-http max size bytes = 1048576 ; bytes\n\
-\n\
-http buffering time = 1.2 \n\
-\n\
-http timeout = -1 ; infinite retry \n\
-\n\
-"
+#define DEFAULT_DUMP_ELEMENT_KEYWORD                      ""
+#define DEFAULT_DUMP_ELEMENT_PATH                         "/tmp/"
 
 int
-mm_player_ini_load(mm_player_ini_t* ini);
+mm_player_ini_load(mmplayer_ini_t *ini);
 
 int
-mm_player_audio_effect_ini_load(mm_player_ini_t* ini);
+mm_player_audio_effect_ini_load(mmplayer_ini_t *ini);
 
 #ifdef __cplusplus
        }