]> git.sesse.net Git - vlc/blobdiff - include/vlc_input_item.h
Make volume-change a void rather than a boolean
[vlc] / include / vlc_input_item.h
index bfacb54aa27e73cae316b973459ac44605b57166..6cea7d9bce5f63582038c7585557b67b52eb024e 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include <vlc_meta.h>
+#include <vlc_epg.h>
 
 #include <string.h>
 
@@ -57,17 +58,14 @@ struct input_item_t
 
     char       *psz_name;            /**< text describing this item */
     char       *psz_uri;             /**< mrl of this item */
-    bool       b_fixed_name;        /**< Can the interface change the name ?*/
 
     int        i_options;            /**< Number of input options */
     char       **ppsz_options;       /**< Array of input options */
     uint8_t    *optflagv;            /**< Some flags of input options */
     unsigned   optflagc;
 
-    mtime_t    i_duration;           /**< Duration in milliseconds*/
+    mtime_t    i_duration;           /**< Duration in microseconds */
 
-    uint8_t    i_type;               /**< Type (file, disc, ...) */
-    bool b_prefers_tree;             /**< Do we prefer being displayed as tree*/
 
     int        i_categories;         /**< Number of info categories */
     info_category_t **pp_categories; /**< Pointer to the first info category */
@@ -78,25 +76,36 @@ struct input_item_t
     input_stats_t *p_stats;          /**< Statistics */
     int           i_nb_played;       /**< Number of times played */
 
-    bool          b_error_when_reading;       /**< Error When Reading */
-
     vlc_meta_t *p_meta;
 
+    int         i_epg;               /**< Number of EPG entries */
+    vlc_epg_t   **pp_epg;            /**< EPG entries */
+
     vlc_event_manager_t event_manager;
 
     vlc_mutex_t lock;                 /**< Lock for the item */
+
+    uint8_t     i_type;              /**< Type (file, disc, ... see input_item_type_e) */
+    bool        b_prefers_tree;      /**< Do we prefer being displayed as tree*/
+    bool        b_fixed_name;        /**< Can the interface change the name ?*/
+    bool        b_error_when_reading;/**< Error When Reading */
 };
 
-#define ITEM_TYPE_UNKNOWN       0
-#define ITEM_TYPE_FILE          1
-#define ITEM_TYPE_DIRECTORY     2
-#define ITEM_TYPE_DISC          3
-#define ITEM_TYPE_CDDA          4
-#define ITEM_TYPE_CARD          5
-#define ITEM_TYPE_NET           6
-#define ITEM_TYPE_PLAYLIST      7
-#define ITEM_TYPE_NODE          8
-#define ITEM_TYPE_NUMBER        9
+enum input_item_type_e
+{
+    ITEM_TYPE_UNKNOWN,
+    ITEM_TYPE_FILE,
+    ITEM_TYPE_DIRECTORY,
+    ITEM_TYPE_DISC,
+    ITEM_TYPE_CDDA,
+    ITEM_TYPE_CARD,
+    ITEM_TYPE_NET,
+    ITEM_TYPE_PLAYLIST,
+    ITEM_TYPE_NODE,
+
+    /* This one is not a real type but the number of input_item types. */
+    ITEM_TYPE_NUMBER
+};
 
 VLC_EXPORT( void, input_item_CopyOptions, ( input_item_t *p_parent, input_item_t *p_child ) );
 VLC_EXPORT( void, input_item_SetName, ( input_item_t *p_item, const char *psz_name ) );
@@ -113,7 +122,12 @@ VLC_EXPORT( void, input_item_AddSubItem, ( input_item_t *p_parent, input_item_t
  */
 enum input_item_option_e
 {
+    /* Allow VLC to trust the given option.
+     * By default options are untrusted */
     VLC_INPUT_OPTION_TRUSTED = 0x2,
+
+    /* Change the value associated to an option if already present, otherwise
+     * add the option */
     VLC_INPUT_OPTION_UNIQUE  = 0x100,
 };
 
@@ -128,6 +142,7 @@ VLC_EXPORT( void, input_item_SetMeta, ( input_item_t *, vlc_meta_type_t meta_typ
 VLC_EXPORT( bool, input_item_MetaMatch, ( input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz ) );
 VLC_EXPORT( char *, input_item_GetMeta, ( input_item_t *p_i, vlc_meta_type_t meta_type ) );
 VLC_EXPORT( char *, input_item_GetName, ( input_item_t * p_i ) );
+VLC_EXPORT( char *, input_item_GetTitleFbName, ( input_item_t * p_i ) );
 VLC_EXPORT( char *, input_item_GetURI, ( input_item_t * p_i ) );
 VLC_EXPORT( void,   input_item_SetURI, ( input_item_t * p_i, const char *psz_uri ));
 VLC_EXPORT(mtime_t, input_item_GetDuration, ( input_item_t * p_i ) );
@@ -177,9 +192,66 @@ VLC_EXPORT( char *, input_item_GetInfo, ( input_item_t *p_i, const char *psz_cat
 VLC_EXPORT( int, input_item_AddInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, ... ) LIBVLC_FORMAT( 4, 5 ) );
 VLC_EXPORT( int, input_item_DelInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name ) );
 
-#define input_item_New( a,b,c ) input_item_NewExt( a, b, c, 0, NULL, -1 )
-#define input_item_NewExt(a,b,c,d,e,f) __input_item_NewExt( VLC_OBJECT(a),b,c,d,e,f)
-VLC_EXPORT( input_item_t *, __input_item_NewExt, (vlc_object_t *, const char *, const char*, int, const char *const *, mtime_t i_duration )  );
-VLC_EXPORT( input_item_t *, input_item_NewWithType, ( vlc_object_t *, const char *, const char *e, int, const char *const *, mtime_t i_duration, int ) );
+/**
+ * This function creates a new input_item_t with the provided informations.
+ *
+ * XXX You may also use input_item_New or input_item_NewExt as they need
+ * less arguments.
+ */
+VLC_EXPORT( input_item_t *, input_item_NewWithType, ( vlc_object_t *, const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned i_option_flags, mtime_t i_duration, int i_type ) );
+
+/**
+ * This function creates a new input_item_t with the provided informations.
+ *
+ * Provided for convenience.
+ */
+#define input_item_NewExt(a,b,c,d,e,f,g) __input_item_NewExt( VLC_OBJECT(a),b,c,d,e,f,g)
+VLC_EXPORT( input_item_t *, __input_item_NewExt, (vlc_object_t *, const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned i_option_flags, mtime_t i_duration ) );
+
+/**
+ * This function creates a new input_item_t with the provided informations.
+ *
+ * Provided for convenience.
+ */
+#define input_item_New( a,b,c ) input_item_NewExt( a, b, c, 0, NULL, 0, -1 )
+
+/******************
+ * Input stats
+ ******************/
+struct input_stats_t
+{
+    vlc_mutex_t         lock;
+
+    /* Input */
+    int i_read_packets;
+    int i_read_bytes;
+    float f_input_bitrate;
+    float f_average_input_bitrate;
+
+    /* Demux */
+    int i_demux_read_packets;
+    int i_demux_read_bytes;
+    float f_demux_bitrate;
+    float f_average_demux_bitrate;
+    int i_demux_corrupted;
+    int i_demux_discontinuity;
+
+    /* Decoders */
+    int i_decoded_audio;
+    int i_decoded_video;
+
+    /* Vout */
+    int i_displayed_pictures;
+    int i_lost_pictures;
+
+    /* Sout */
+    int i_sent_packets;
+    int i_sent_bytes;
+    float f_send_bitrate;
+
+    /* Aout */
+    int i_played_abuffers;
+    int i_lost_abuffers;
+};
 
 #endif