00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef VLC__INPUT_ITEM_H
00026 #define VLC__INPUT_ITEM_H 1
00027
00028
00029
00030
00031
00032
00033 #include <vlc_meta.h>
00034 #include <vlc_epg.h>
00035
00036 #include <string.h>
00037
00038
00039
00040
00041 struct info_t
00042 {
00043 char *psz_name;
00044 char *psz_value;
00045 };
00046
00047 struct info_category_t
00048 {
00049 char *psz_name;
00050 int i_infos;
00051 struct info_t **pp_infos;
00052 };
00053
00054 struct input_item_t
00055 {
00056 VLC_GC_MEMBERS
00057 int i_id;
00058
00059 char *psz_name;
00060 char *psz_uri;
00061 bool b_fixed_name;
00062
00063 int i_options;
00064 char **ppsz_options;
00065 uint8_t *optflagv;
00066 unsigned optflagc;
00067
00068 mtime_t i_duration;
00069
00070 uint8_t i_type;
00071 bool b_prefers_tree;
00072
00073 int i_categories;
00074 info_category_t **pp_categories;
00075
00076 int i_es;
00077 es_format_t **es;
00078
00079 input_stats_t *p_stats;
00080 int i_nb_played;
00081
00082 bool b_error_when_reading;
00083
00084 vlc_meta_t *p_meta;
00085
00086 int i_epg;
00087 vlc_epg_t **pp_epg;
00088
00089 vlc_event_manager_t event_manager;
00090
00091 vlc_mutex_t lock;
00092 };
00093
00094 enum input_item_type_e
00095 {
00096 ITEM_TYPE_UNKNOWN,
00097 ITEM_TYPE_FILE,
00098 ITEM_TYPE_DIRECTORY,
00099 ITEM_TYPE_DISC,
00100 ITEM_TYPE_CDDA,
00101 ITEM_TYPE_CARD,
00102 ITEM_TYPE_NET,
00103 ITEM_TYPE_PLAYLIST,
00104 ITEM_TYPE_NODE,
00105
00106
00107 ITEM_TYPE_NUMBER
00108 };
00109
00110 VLC_EXPORT( void, input_item_CopyOptions, ( input_item_t *p_parent, input_item_t *p_child ) );
00111 VLC_EXPORT( void, input_item_SetName, ( input_item_t *p_item, const char *psz_name ) );
00112
00113
00114
00115
00116
00117 VLC_EXPORT( void, input_item_AddSubItem, ( input_item_t *p_parent, input_item_t *p_child ) );
00118
00119
00120
00121
00122
00123 enum input_item_option_e
00124 {
00125
00126
00127 VLC_INPUT_OPTION_TRUSTED = 0x2,
00128
00129
00130
00131 VLC_INPUT_OPTION_UNIQUE = 0x100,
00132 };
00133
00134
00135
00136
00137 VLC_EXPORT( int, input_item_AddOption, (input_item_t *, const char *, unsigned i_flags ) );
00138
00139
00140 VLC_EXPORT( bool, input_item_HasErrorWhenReading, ( input_item_t * ) );
00141 VLC_EXPORT( void, input_item_SetMeta, ( input_item_t *, vlc_meta_type_t meta_type, const char *psz_val ));
00142 VLC_EXPORT( bool, input_item_MetaMatch, ( input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz ) );
00143 VLC_EXPORT( char *, input_item_GetMeta, ( input_item_t *p_i, vlc_meta_type_t meta_type ) );
00144 VLC_EXPORT( char *, input_item_GetName, ( input_item_t * p_i ) );
00145 VLC_EXPORT( char *, input_item_GetTitleFbName, ( input_item_t * p_i ) );
00146 VLC_EXPORT( char *, input_item_GetURI, ( input_item_t * p_i ) );
00147 VLC_EXPORT( void, input_item_SetURI, ( input_item_t * p_i, const char *psz_uri ));
00148 VLC_EXPORT(mtime_t, input_item_GetDuration, ( input_item_t * p_i ) );
00149 VLC_EXPORT( void, input_item_SetDuration, ( input_item_t * p_i, mtime_t i_duration ));
00150 VLC_EXPORT( bool, input_item_IsPreparsed, ( input_item_t *p_i ));
00151 VLC_EXPORT( bool, input_item_IsArtFetched, ( input_item_t *p_i ));
00152
00153
00154 #define input_item_SetTitle( item, b ) input_item_SetMeta( item, vlc_meta_Title, b )
00155 #define input_item_SetArtist( item, b ) input_item_SetMeta( item, vlc_meta_Artist, b )
00156 #define input_item_SetGenre( item, b ) input_item_SetMeta( item, vlc_meta_Genre, b )
00157 #define input_item_SetCopyright( item, b ) input_item_SetMeta( item, vlc_meta_Copyright, b )
00158 #define input_item_SetAlbum( item, b ) input_item_SetMeta( item, vlc_meta_Album, b )
00159 #define input_item_SetTrackNum( item, b ) input_item_SetMeta( item, vlc_meta_TrackNumber, b )
00160 #define input_item_SetDescription( item, b ) input_item_SetMeta( item, vlc_meta_Description, b )
00161 #define input_item_SetRating( item, b ) input_item_SetMeta( item, vlc_meta_Rating, b )
00162 #define input_item_SetDate( item, b ) input_item_SetMeta( item, vlc_meta_Date, b )
00163 #define input_item_SetSetting( item, b ) input_item_SetMeta( item, vlc_meta_Setting, b )
00164 #define input_item_SetURL( item, b ) input_item_SetMeta( item, vlc_meta_URL, b )
00165 #define input_item_SetLanguage( item, b ) input_item_SetMeta( item, vlc_meta_Language, b )
00166 #define input_item_SetNowPlaying( item, b ) input_item_SetMeta( item, vlc_meta_NowPlaying, b )
00167 #define input_item_SetPublisher( item, b ) input_item_SetMeta( item, vlc_meta_Publisher, b )
00168 #define input_item_SetEncodedBy( item, b ) input_item_SetMeta( item, vlc_meta_EncodedBy, b )
00169 #define input_item_SetArtURL( item, b ) input_item_SetMeta( item, vlc_meta_ArtworkURL, b )
00170 #define input_item_SetTrackID( item, b ) input_item_SetMeta( item, vlc_meta_TrackID, b )
00171
00172 #define input_item_GetTitle( item ) input_item_GetMeta( item, vlc_meta_Title )
00173 #define input_item_GetArtist( item ) input_item_GetMeta( item, vlc_meta_Artist )
00174 #define input_item_GetGenre( item ) input_item_GetMeta( item, vlc_meta_Genre )
00175 #define input_item_GetCopyright( item ) input_item_GetMeta( item, vlc_meta_Copyright )
00176 #define input_item_GetAlbum( item ) input_item_GetMeta( item, vlc_meta_Album )
00177 #define input_item_GetTrackNum( item ) input_item_GetMeta( item, vlc_meta_TrackNumber )
00178 #define input_item_GetDescription( item ) input_item_GetMeta( item, vlc_meta_Description )
00179 #define input_item_GetRating( item ) input_item_GetMeta( item, vlc_meta_Rating )
00180 #define input_item_GetDate( item ) input_item_GetMeta( item, vlc_meta_Date )
00181 #define input_item_GetGetting( item ) input_item_GetMeta( item, vlc_meta_Getting )
00182 #define input_item_GetURL( item ) input_item_GetMeta( item, vlc_meta_URL )
00183 #define input_item_GetLanguage( item ) input_item_GetMeta( item, vlc_meta_Language )
00184 #define input_item_GetNowPlaying( item ) input_item_GetMeta( item, vlc_meta_NowPlaying )
00185 #define input_item_GetPublisher( item ) input_item_GetMeta( item, vlc_meta_Publisher )
00186 #define input_item_GetEncodedBy( item ) input_item_GetMeta( item, vlc_meta_EncodedBy )
00187 #define input_item_GetArtURL( item ) input_item_GetMeta( item, vlc_meta_ArtworkURL )
00188 #define input_item_GetTrackID( item ) input_item_GetMeta( item, vlc_meta_TrackID )
00189 #define input_item_GetSetting( item ) input_item_GetMeta( item, vlc_meta_Setting )
00190
00191 VLC_EXPORT( char *, input_item_GetInfo, ( input_item_t *p_i, const char *psz_cat,const char *psz_name ) );
00192 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 ) );
00193 VLC_EXPORT( int, input_item_DelInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name ) );
00194
00195
00196
00197
00198
00199
00200
00201 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 ) );
00202
00203
00204
00205
00206
00207
00208 #define input_item_NewExt(a,b,c,d,e,f,g) __input_item_NewExt( VLC_OBJECT(a),b,c,d,e,f,g)
00209 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 ) );
00210
00211
00212
00213
00214
00215
00216 #define input_item_New( a,b,c ) input_item_NewExt( a, b, c, 0, NULL, 0, -1 )
00217
00218
00219
00220
00221 struct input_stats_t
00222 {
00223 vlc_mutex_t lock;
00224
00225
00226 int i_read_packets;
00227 int i_read_bytes;
00228 float f_input_bitrate;
00229 float f_average_input_bitrate;
00230
00231
00232 int i_demux_read_packets;
00233 int i_demux_read_bytes;
00234 float f_demux_bitrate;
00235 float f_average_demux_bitrate;
00236 int i_demux_corrupted;
00237 int i_demux_discontinuity;
00238
00239
00240 int i_decoded_audio;
00241 int i_decoded_video;
00242
00243
00244 int i_displayed_pictures;
00245 int i_lost_pictures;
00246
00247
00248 int i_sent_packets;
00249 int i_sent_bytes;
00250 float f_send_bitrate;
00251
00252
00253 int i_played_abuffers;
00254 int i_lost_abuffers;
00255 };
00256
00257 #endif