VLC 4.0.0-dev
vlc_input_item.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_input_item.h: Core input item
3 *****************************************************************************
4 * Copyright (C) 1999-2009 VLC authors and VideoLAN
5 *
6 * Authors: Christophe Massiot <massiot@via.ecp.fr>
7 * Laurent Aimar <fenrir@via.ecp.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
23
24#ifndef VLC_INPUT_ITEM_H
25#define VLC_INPUT_ITEM_H 1
26
27/**
28 * \file
29 * This file defines functions, structures and enums for input items in vlc
30 */
31
32#include <vlc_meta.h>
33#include <vlc_epg.h>
34#include <vlc_events.h>
35#include <vlc_list.h>
36#include <vlc_threads.h>
37
38#include <string.h>
39
43struct info_t
45 char *psz_name; /**< Name of this info */
46 char *psz_value; /**< Value of the info */
47 struct vlc_list node;
48};
49
50#define info_foreach(info, cat) vlc_list_foreach(info, cat, node)
52struct info_category_t
54 char *psz_name; /**< Name of this category */
55 struct vlc_list infos; /**< Infos in the category */
56 struct vlc_list node; /**< node, to put this category in a list */
57};
58
59/**
60 * Returns true if the category is hidden
61 *
62 * Infos from hidden categories should not be displayed directly by UI modules.
63 */
64static inline bool info_category_IsHidden(info_category_t *cat)
66 return cat->psz_name[0] == '.';
67}
68
80 /* This one is not a real type but the number of input_item types. */
82};
84/**
85 * Describes an input and is used to spawn input_thread_t objects.
86 */
87struct input_item_t
89 char *psz_name; /**< text describing this item */
90 char *psz_uri; /**< mrl of this item */
92 int i_options; /**< Number of input options */
93 char **ppsz_options; /**< Array of input options */
94 uint8_t *optflagv; /**< Some flags of input options */
95 unsigned optflagc;
96 input_item_opaque_t *opaques; /**< List of opaque pointer values */
98 vlc_tick_t i_duration; /**< Duration in vlc ticks */
100
101 struct vlc_list categories; /**< List of categories */
103 int i_es; /**< Number of es format descriptions */
104 es_format_t **es; /**< Es formats */
106 input_stats_t *p_stats; /**< Statistics */
110 int i_epg; /**< Number of EPG entries */
111 vlc_epg_t **pp_epg; /**< EPG entries */
112 int64_t i_epg_time; /** EPG timedate as epoch time */
113 const vlc_epg_t *p_epg_table; /** running/selected program cur/next EPG table */
115 int i_slaves; /**< Number of slaves */
116 input_item_slave_t **pp_slaves; /**< Slave entries that will be loaded by
117 the input_thread */
118
121 vlc_mutex_t lock; /**< Lock for the item */
123 enum input_item_type_e i_type; /**< Type (file, disc, ... see input_item_type_e) */
124 bool b_net; /**< Net: always true for TYPE_STREAM, it
125 depends for others types */
126 bool b_error_when_reading;/**< Error When Reading */
128 int i_preparse_depth; /**< How many level of sub items can be preparsed:
129 -1: recursive, 0: none, >0: n levels */
130
131 bool b_preparse_interact; /**< Force interaction with the user when
132 preparsing.*/
133
134 void *libvlc_owner; /**< LibVLC private data, can only be set
135 before events are registered. */
136};
137
138#define INPUT_ITEM_URI_NOP "vlc://nop" /* dummy URI for node/directory items */
140/* placeholder duration for items with no known duration at time of creation
141 * it may remain the duration for items like a node/directory */
142#define INPUT_DURATION_UNSET VLC_TICK_INVALID
143#define INPUT_DURATION_INDEFINITE (-1) /* item with a known indefinite duration (live/continuous source) */
150};
152enum slave_type
155 SLAVE_TYPE_GENERIC, /* audio, video or subtitle not matched in SLAVE_SPU_EXTENSIONS */
157
165};
167/* Extensions must be in alphabetical order */
168#define MASTER_EXTENSIONS \
169 "asf", "avi", "divx", \
170 "f4v", "flv", "m1v", \
171 "m2v", "m4v", "mkv", \
172 "mov", "mp2", "mp2v", \
173 "mp4", "mp4v", "mpe", \
174 "mpeg", "mpeg1", "mpeg2", \
175 "mpeg4", "mpg", "mpv2", \
176 "mxf", "ogv", "ogx", \
177 "ps", "vro","webm", \
178 "wmv", "wtv"
179
180#define SLAVE_SPU_EXTENSIONS \
181 "aqt", "ass", "cdg", \
182 "dks", "idx", "jss", \
183 "mpl2", "mpsub", "pjs", \
184 "psb", "rt", "sami", "sbv", \
185 "scc", "smi", "srt", \
186 "ssa", "stl", "sub", \
187 "tt", "ttml", "usf", \
188 "vtt", "webvtt"
189
190#define SLAVE_AUDIO_EXTENSIONS \
191 "aac", "ac3", "dts", \
192 "dtshd", "eac3", "flac", \
193 "m4a", "mp3", "pcm" \
194
195struct input_item_slave
197 enum slave_type i_type; /**< Slave type (spu, audio) */
198 enum slave_priority i_priority; /**< Slave priority */
199 bool b_forced; /**< Slave should be selected */
200 char psz_uri[]; /**< Slave mrl */
202
209
210VLC_API void input_item_CopyOptions( input_item_t *p_child, input_item_t *p_parent );
211VLC_API void input_item_SetName( input_item_t *p_item, const char *psz_name );
212
213/**
214 * Start adding multiple subitems.
215 *
216 * Create a root node to hold a tree of subitems for given item
217 */
219
220/**
221 * Add a new child node to this parent node that will point to this subitem.
222 */
224
225/**
226 * Add an already created node to children of this parent node.
227 */
229
230/**
231 * Remove a node from its parent.
232 */
234 input_item_node_t *child );
235
236/**
237 * Delete a node created with input_item_node_Create() and all its children.
238 */
240
241/**
242 * Option flags
243 */
246 /* Allow VLC to trust the given option.
247 * By default options are untrusted */
250 /* Add the option, unless the same option
251 * is already present. */
254
255/**
256 * This function allows to add an option to an existing input_item_t.
257 */
258VLC_API int input_item_AddOption(input_item_t *, const char *, unsigned i_flags );
259/**
260 * This function add several options to an existing input_item_t.
261 */
262VLC_API int input_item_AddOptions(input_item_t *, int i_options,
263 const char *const *ppsz_options,
264 unsigned i_flags );
265VLC_API int input_item_AddOpaque(input_item_t *, const char *, void *);
266
268
269VLC_API bool input_item_slave_GetType(const char *, enum slave_type *);
270
272 enum slave_priority);
273#define input_item_slave_Delete(p_slave) free(p_slave)
275/**
276 * This function allows adding a slave to an existing input item.
277 * The slave is owned by the input item after this call.
278 */
280
281/* */
283VLC_API void input_item_SetMeta( input_item_t *, vlc_meta_type_t meta_type, const char *psz_val );
284VLC_API bool input_item_MetaMatch( input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz );
291VLC_API void input_item_SetURI( input_item_t * p_i, const char *psz_uri );
293VLC_API void input_item_SetDuration( input_item_t * p_i, vlc_tick_t i_duration );
296
297#define INPUT_META( name ) \
298static inline \
299void input_item_Set ## name (input_item_t *p_input, const char *val) \
300{ \
301 input_item_SetMeta (p_input, vlc_meta_ ## name, val); \
302} \
303static inline \
304char *input_item_Get ## name (input_item_t *p_input) \
305{ \
306 return input_item_GetMeta (p_input, vlc_meta_ ## name); \
307}
308
309INPUT_META(Title)
311INPUT_META(AlbumArtist)
313INPUT_META(Copyright)
315INPUT_META(TrackNumber)
316INPUT_META(Description)
321INPUT_META(Language)
322INPUT_META(NowPlaying)
323INPUT_META(ESNowPlaying)
324INPUT_META(Publisher)
325INPUT_META(EncodedBy)
326INPUT_META(ArtworkURL)
328INPUT_META(TrackTotal)
329INPUT_META(Director)
332INPUT_META(ShowName)
334INPUT_META(DiscNumber)
335INPUT_META(DiscTotal)
337#define input_item_SetTrackNum input_item_SetTrackNumber
338#define input_item_GetTrackNum input_item_GetTrackNumber
339#define input_item_SetArtURL input_item_SetArtworkURL
340#define input_item_GetArtURL input_item_GetArtworkURL
342VLC_API char * input_item_GetInfo( input_item_t *p_i, const char *psz_cat,const char *psz_name ) VLC_USED;
343VLC_API char * input_item_GetInfoLocked( input_item_t *p_i, const char *psz_cat,const char *psz_name );
344VLC_API int input_item_AddInfo( input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, ... ) VLC_FORMAT( 4, 5 );
345VLC_API int input_item_DelInfo( input_item_t *p_i, const char *psz_cat, const char *psz_name );
348
349#define input_item_AddStat(item, type, value) \
350 input_item_AddInfo(item, ".stat", type, "%" PRIu64, (uint64_t) value)
351
352/**
353 * This function creates a new input_item_t with the provided information.
354 *
355 * XXX You may also use input_item_New, as they need less arguments.
356 */
357VLC_API input_item_t * input_item_NewExt( const char *psz_uri,
358 const char *psz_name,
359 vlc_tick_t i_duration, enum input_item_type_e i_type,
360 enum input_item_net_type i_net ) VLC_USED;
361
362#define input_item_New( psz_uri, psz_name ) \
363 input_item_NewExt( psz_uri, psz_name, INPUT_DURATION_UNSET, ITEM_TYPE_UNKNOWN, ITEM_NET_UNKNOWN )
364
365#define input_item_NewCard( psz_uri, psz_name ) \
366 input_item_NewExt( psz_uri, psz_name, INPUT_DURATION_INDEFINITE, ITEM_TYPE_CARD, ITEM_LOCAL )
367
368#define input_item_NewDisc( psz_uri, psz_name, i_duration ) \
369 input_item_NewExt( psz_uri, psz_name, i_duration, ITEM_TYPE_DISC, ITEM_LOCAL )
370
371#define input_item_NewStream( psz_uri, psz_name, i_duration ) \
372 input_item_NewExt( psz_uri, psz_name, i_duration, ITEM_TYPE_STREAM, ITEM_NET )
373
374#define input_item_NewDirectory( psz_uri, psz_name, i_net ) \
375 input_item_NewExt( psz_uri, psz_name, INPUT_DURATION_UNSET, ITEM_TYPE_DIRECTORY, i_net )
376
377#define input_item_NewFile( psz_uri, psz_name, i_duration, i_net ) \
378 input_item_NewExt( psz_uri, psz_name, i_duration, ITEM_TYPE_FILE, i_net )
379
380/**
381 * This function creates a new input_item_t as a copy of another.
382 */
384
385/** Holds an input item, i.e. creates a new reference. */
387
388/** Releases an input item, i.e. decrements its reference counter. */
390
391/**
392 * Record prefix string.
393 * TODO make it configurable.
394 */
395#define INPUT_RECORD_PREFIX "vlc-record-%Y-%m-%d-%Hh%Mm%Ss-$ N-$ p"
397/**
398 * This function creates a sane filename path.
399 */
401 const char *psz_path, const char *psz_prefix,
402 const char *psz_extension ) VLC_USED;
403
404/**
405 * input item parser opaque structure
406 */
409/**
410 * input item parser callbacks
411 */
412typedef struct input_item_parser_cbs_t
414 /**
415 * Event received when the parser ends
416 *
417 * @note This callback is mandatory.
418 *
419 * @param item the parsed item
420 * @param status VLC_SUCCESS in case of success, an error otherwise
421 * @param userdata user data set by input_item_Parse()
422 */
423 void (*on_ended)(input_item_t *item, int status, void *userdata);
425 /**
426 * Event received when a new subtree is added
427 *
428 * @note This callback is optional.
429 *
430 * @param item the parsed item
431 * @param subtree sub items of the current item
432 * @param userdata user data set by input_item_Parse()
433 */
434 void (*on_subtree_added)(input_item_t *item, input_item_node_t *subtree, void *userdata);
437/**
438 * Parse an item asynchronously
439 *
440 * @note The parsing is done asynchronously. The user can call
441 * input_item_parser_id_Interrupt() before receiving the on_ended() event in
442 * order to interrupt it.
443 *
444 * @param item the item to parse
445 * @param parent the parent obj
446 * @param cbs callbacks to be notified of the end of the parsing
447 * @param userdata opaque data used by parser callbacks
448 *
449 * @return a parser instance or NULL in case of error, the parser needs to be
450 * released with input_item_parser_id_Release()
451 */
454 const input_item_parser_cbs_t *cbs, void *userdata) VLC_USED;
455
456/**
457 * Interrupts & cancels the parsing
458 *
459 * @note The parser still needs to be released with input_item_parser_id_Release
460 * afterward.
461 * @note Calling this function will cause the on_ended callback to be invoked.
462 *
463 * @param parser the parser to interrupt
464 */
465VLC_API void
467
468/**
469 * Release (and interrupt if needed) a parser
470 *
471 * @param parser the parser returned by input_item_Parse
472 */
473VLC_API void
475
491/* status of the on_preparse_ended() callback */
498};
500struct vlc_metadata_cbs {
501 void (*on_preparse_ended)(input_item_t *, enum input_item_preparse_status status, void *userdata);
502 void (*on_art_fetch_ended)(input_item_t *, bool fetched, void *userdata);
503 void (*on_subtree_added)(input_item_t *, input_item_node_t *subtree, void *userdata);
505
508 const struct vlc_metadata_cbs *cbs,
509 void *cbs_userdata,
510 int, void * );
512
513/******************
514 * Input stats
515 ******************/
516struct input_stats_t
518 /* Input */
519 int64_t i_read_packets;
523 /* Demux */
524 int64_t i_demux_read_packets;
530 /* Decoders */
531 int64_t i_decoded_audio;
534 /* Vout */
535 int64_t i_displayed_pictures;
539 /* Aout */
540 int64_t i_played_abuffers;
543
544/**
545 * Access pf_readdir helper struct
546 * \see vlc_readdir_helper_init()
547 * \see vlc_readdir_helper_additem()
548 * \see vlc_readdir_helper_finish()
549 */
553 void **pp_slaves;
554 size_t i_slaves;
555 void **pp_dirs;
556 size_t i_dirs;
562
563/**
564 * Init a vlc_readdir_helper struct
565 *
566 * \param p_rdh need to be cleaned with vlc_readdir_helper_finish()
567 * \param p_node node that will be used to add items
568 */
570 vlc_object_t *p_obj, input_item_node_t *p_node);
571#define vlc_readdir_helper_init(p_rdh, p_obj, p_node) \
572 vlc_readdir_helper_init(p_rdh, VLC_OBJECT(p_obj), p_node)
573
574/**
575 * Finish adding items to the node
576 *
577 * \param b_success if true, items of the node will be sorted.
578 */
579VLC_API void vlc_readdir_helper_finish(struct vlc_readdir_helper *p_rdh, bool b_success);
580
581/**
582 * Add a new input_item_t entry to the node of the vlc_readdir_helper struct.
583 *
584 * \param p_rdh previously inited vlc_readdir_helper struct
585 * \param psz_uri uri of the new item
586 * \param psz_flatpath flattened path of the new item. If not NULL, this
587 * function will create an input item for each sub folders (separated
588 * by '/') of psz_flatpath (so, this will un-flatten the folder
589 * hierarchy). Either psz_flatpath or psz_filename must be valid.
590 * \param psz_filename file name of the new item. If NULL, the file part of path
591 * will be used as a filename. Either psz_flatpath or psz_filename must
592 * be valid.
593 * \param i_type see \ref input_item_type_e
594 * \param i_net see \ref input_item_net_type
595 * \param[out] created_item if an input item is created. The item should not be
596 * released and is valid until vlc_readdir_helper_finish() is called.
597 * \param status VLC_SUCCESS in case of success, an error otherwise. Parsing
598 * should be aborted in case of error.
599 */
601 const char *psz_uri, const char *psz_flatpath,
602 const char *psz_filename,
603 int i_type, int i_net, input_item_t **created_item);
604
605#endif
#define VLC_USED
Definition: fourcc_gen.c:32
#define VLC_API
Definition: fourcc_gen.c:31
#define VLC_FORMAT(x, y)
String format function annotation.
Definition: vlc_common.h:204
int i_type
Definition: httpd.c:1282
Definition: vlc_es.h:630
Definition: vlc_input_item.h:54
struct vlc_list node
node, to put this category in a list
Definition: vlc_input_item.h:57
char * psz_name
Name of this category.
Definition: vlc_input_item.h:55
struct vlc_list infos
Infos in the category.
Definition: vlc_input_item.h:56
Definition: vlc_input_item.h:45
struct vlc_list node
Definition: vlc_input_item.h:48
char * psz_value
Value of the info.
Definition: vlc_input_item.h:47
char * psz_name
Name of this info.
Definition: vlc_input_item.h:46
Definition: vlc_input_item.h:205
int i_children
Definition: vlc_input_item.h:207
input_item_node_t ** pp_children
Definition: vlc_input_item.h:208
input_item_t * p_item
Definition: vlc_input_item.h:206
Definition: item.c:43
input item parser callbacks
Definition: vlc_input_item.h:414
void(* on_ended)(input_item_t *item, int status, void *userdata)
Event received when the parser ends.
Definition: vlc_input_item.h:424
void(* on_subtree_added)(input_item_t *item, input_item_node_t *subtree, void *userdata)
Event received when a new subtree is added.
Definition: vlc_input_item.h:435
Definition: item.c:1342
Definition: vlc_input_item.h:197
enum slave_priority i_priority
Slave priority.
Definition: vlc_input_item.h:199
bool b_forced
Slave should be selected.
Definition: vlc_input_item.h:200
char psz_uri[]
Slave mrl.
Definition: vlc_input_item.h:201
enum slave_type i_type
Slave type (spu, audio)
Definition: vlc_input_item.h:198
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:89
bool b_error_when_reading
Error When Reading.
Definition: vlc_input_item.h:127
int64_t i_epg_time
Definition: vlc_input_item.h:113
int i_preparse_depth
How many level of sub items can be preparsed: -1: recursive, 0: none, >0: n levels.
Definition: vlc_input_item.h:129
input_item_opaque_t * opaques
List of opaque pointer values.
Definition: vlc_input_item.h:97
input_item_slave_t ** pp_slaves
Slave entries that will be loaded by the input_thread.
Definition: vlc_input_item.h:117
int i_options
Number of input options.
Definition: vlc_input_item.h:93
int i_slaves
running/selected program cur/next EPG table
Definition: vlc_input_item.h:116
int i_epg
Number of EPG entries.
Definition: vlc_input_item.h:111
uint8_t * optflagv
Some flags of input options.
Definition: vlc_input_item.h:95
vlc_epg_t ** pp_epg
EPG entries.
Definition: vlc_input_item.h:112
int i_es
Number of es format descriptions.
Definition: vlc_input_item.h:104
void * libvlc_owner
LibVLC private data, can only be set before events are registered.
Definition: vlc_input_item.h:135
unsigned optflagc
Definition: vlc_input_item.h:96
vlc_mutex_t lock
Lock for the item.
Definition: vlc_input_item.h:122
vlc_tick_t i_duration
Duration in vlc ticks.
Definition: vlc_input_item.h:99
vlc_event_manager_t event_manager
Definition: vlc_input_item.h:120
enum input_item_type_e i_type
Type (file, disc, ... see input_item_type_e)
Definition: vlc_input_item.h:124
input_stats_t * p_stats
Statistics.
Definition: vlc_input_item.h:107
char * psz_uri
mrl of this item
Definition: vlc_input_item.h:91
const vlc_epg_t * p_epg_table
EPG timedate as epoch time.
Definition: vlc_input_item.h:114
struct vlc_list categories
List of categories.
Definition: vlc_input_item.h:102
es_format_t ** es
Es formats.
Definition: vlc_input_item.h:105
vlc_meta_t * p_meta
Definition: vlc_input_item.h:109
char ** ppsz_options
Array of input options.
Definition: vlc_input_item.h:94
char * psz_name
text describing this item
Definition: vlc_input_item.h:90
bool b_net
Net: always true for TYPE_STREAM, it depends for others types.
Definition: vlc_input_item.h:125
bool b_preparse_interact
Force interaction with the user when preparsing.
Definition: vlc_input_item.h:132
Definition: vlc_input_item.h:518
int64_t i_read_bytes
Definition: vlc_input_item.h:521
int64_t i_lost_pictures
Definition: vlc_input_item.h:538
int64_t i_demux_discontinuity
Definition: vlc_input_item.h:529
int64_t i_displayed_pictures
Definition: vlc_input_item.h:536
int64_t i_demux_corrupted
Definition: vlc_input_item.h:528
float f_input_bitrate
Definition: vlc_input_item.h:522
int64_t i_demux_read_packets
Definition: vlc_input_item.h:525
int64_t i_decoded_audio
Definition: vlc_input_item.h:532
int64_t i_demux_read_bytes
Definition: vlc_input_item.h:526
int64_t i_lost_abuffers
Definition: vlc_input_item.h:542
int64_t i_late_pictures
Definition: vlc_input_item.h:537
float f_demux_bitrate
Definition: vlc_input_item.h:527
int64_t i_decoded_video
Definition: vlc_input_item.h:533
int64_t i_read_packets
Definition: vlc_input_item.h:520
int64_t i_played_abuffers
Definition: vlc_input_item.h:541
Definition: vlc_objects.h:91
Definition: vlc_epg.h:52
Definition: vlc_events.h:119
Doubly-linked list node.
Definition: vlc_list.h:44
Definition: meta.c:40
Definition: vlc_input_item.h:501
void(* on_subtree_added)(input_item_t *, input_item_node_t *subtree, void *userdata)
Definition: vlc_input_item.h:504
void(* on_art_fetch_ended)(input_item_t *, bool fetched, void *userdata)
Definition: vlc_input_item.h:503
void(* on_preparse_ended)(input_item_t *, enum input_item_preparse_status status, void *userdata)
Definition: vlc_input_item.h:502
Mutex.
Definition: vlc_threads.h:195
VLC object common members.
Definition: vlc_objects.h:45
Access pf_readdir helper struct.
Definition: vlc_input_item.h:552
char * psz_ignored_exts
Definition: vlc_input_item.h:561
void ** pp_slaves
Definition: vlc_input_item.h:554
input_item_node_t * p_node
Definition: vlc_input_item.h:553
bool b_flatten
Definition: vlc_input_item.h:560
int i_sub_autodetect_fuzzy
Definition: vlc_input_item.h:558
bool b_show_hiddenfiles
Definition: vlc_input_item.h:559
size_t i_slaves
Definition: vlc_input_item.h:555
size_t i_dirs
Definition: vlc_input_item.h:557
void ** pp_dirs
Definition: vlc_input_item.h:556
const char * psz_name
Definition: text_style.c:33
This file is a collection of common definitions and types.
This file defines functions and structures for storing dvb epg information.
This file is the interface definition for events (implementation in src/misc/events....
int libvlc_MetadataRequest(libvlc_int_t *, input_item_t *, input_item_meta_request_option_t, const struct vlc_metadata_cbs *cbs, void *cbs_userdata, int, void *)
Requests extraction of the meta data for an input item (a.k.a.
Definition: libvlc.c:473
void input_item_node_AppendNode(input_item_node_t *p_parent, input_item_node_t *p_child)
Add an already created node to children of this parent node.
Definition: item.c:1277
void input_item_parser_id_Release(input_item_parser_id_t *parser)
Release (and interrupt if needed) a parser.
Definition: item.c:1410
char * input_item_CreateFilename(input_item_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension)
This function creates a sane filename path.
Definition: item.c:1321
void input_item_node_RemoveNode(input_item_node_t *parent, input_item_node_t *child)
Remove a node from its parent.
Definition: item.c:1285
#define INPUT_META(name)
Definition: vlc_input_item.h:298
void input_item_Release(input_item_t *)
Releases an input item, i.e.
Definition: item.c:447
input_item_t * input_item_Hold(input_item_t *)
Holds an input item, i.e.
Definition: item.c:439
slave_type
Definition: vlc_input_item.h:154
@ SLAVE_TYPE_GENERIC
Definition: vlc_input_item.h:156
@ SLAVE_TYPE_SPU
Definition: vlc_input_item.h:155
bool input_item_MetaMatch(input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz)
Definition: item.c:221
input_item_node_t * input_item_node_Create(input_item_t *p_input)
Start adding multiple subitems.
Definition: item.c:1230
void input_item_MergeInfos(input_item_t *, info_category_t *)
Definition: item.c:819
input_item_t * input_item_NewExt(const char *psz_uri, const char *psz_name, vlc_tick_t i_duration, enum input_item_type_e i_type, enum input_item_net_type i_net)
This function creates a new input_item_t with the provided information.
Definition: item.c:1031
int input_item_AddOpaque(input_item_t *, const char *, void *)
Definition: item.c:545
void input_item_SetName(input_item_t *p_item, const char *psz_name)
Definition: item.c:276
vlc_tick_t input_item_GetDuration(input_item_t *p_i)
Definition: item.c:364
void vlc_readdir_helper_finish(struct vlc_readdir_helper *p_rdh, bool b_success)
Finish adding items to the node.
Definition: item.c:1801
char * input_item_GetInfoLocked(input_item_t *p_i, const char *psz_cat, const char *psz_name)
Definition: item.c:702
input_item_t * input_item_Copy(input_item_t *)
This function creates a new input_item_t as a copy of another.
Definition: item.c:1088
input_item_preparse_status
Definition: vlc_input_item.h:494
@ ITEM_PREPARSE_FAILED
Definition: vlc_input_item.h:496
@ ITEM_PREPARSE_TIMEOUT
Definition: vlc_input_item.h:497
@ ITEM_PREPARSE_DONE
Definition: vlc_input_item.h:498
@ ITEM_PREPARSE_SKIPPED
Definition: vlc_input_item.h:495
#define vlc_readdir_helper_init(p_rdh, p_obj, p_node)
Definition: vlc_input_item.h:572
char * input_item_GetName(input_item_t *p_i)
Definition: item.c:267
const char * input_item_GetMetaLocked(input_item_t *, vlc_meta_type_t meta_type)
Definition: item.c:234
int input_item_AddInfo(input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format,...)
Definition: item.c:743
input_item_option_e
Option flags.
Definition: vlc_input_item.h:246
@ VLC_INPUT_OPTION_UNIQUE
Definition: vlc_input_item.h:253
@ VLC_INPUT_OPTION_TRUSTED
Definition: vlc_input_item.h:249
char * input_item_GetNowPlayingFb(input_item_t *p_item)
Definition: item.c:398
void input_item_SetURI(input_item_t *p_i, const char *psz_uri)
Definition: item.c:296
bool input_item_IsPreparsed(input_item_t *p_i)
Definition: item.c:410
int input_item_DelInfo(input_item_t *p_i, const char *psz_cat, const char *psz_name)
Definition: item.c:766
void libvlc_MetadataCancel(libvlc_int_t *, void *)
Cancels extraction of the meta data for an input item.
Definition: libvlc.c:499
void input_item_parser_id_Interrupt(input_item_parser_id_t *parser)
Interrupts & cancels the parsing.
Definition: item.c:1404
void input_item_SetMeta(input_item_t *, vlc_meta_type_t meta_type, const char *psz_val)
Definition: item.c:125
bool input_item_HasErrorWhenReading(input_item_t *)
Definition: item.c:210
char * input_item_GetInfo(input_item_t *p_i, const char *psz_cat, const char *psz_name)
Get a info item from a given category in a given input item.
Definition: item.c:689
char * input_item_GetURI(input_item_t *p_i)
Definition: item.c:286
struct input_item_parser_cbs_t input_item_parser_cbs_t
input item parser callbacks
void input_item_ApplyOptions(vlc_object_t *, input_item_t *)
Definition: item.c:564
input_item_net_type
Definition: vlc_input_item.h:147
@ ITEM_NET_UNKNOWN
Definition: vlc_input_item.h:148
@ ITEM_NET
Definition: vlc_input_item.h:149
@ ITEM_LOCAL
Definition: vlc_input_item.h:150
int input_item_AddOptions(input_item_t *, int i_options, const char *const *ppsz_options, unsigned i_flags)
This function add several options to an existing input_item_t.
Definition: item.c:535
bool input_item_IsArtFetched(input_item_t *p_i)
Definition: item.c:419
bool input_item_slave_GetType(const char *, enum slave_type *)
Definition: item.c:600
int vlc_readdir_helper_additem(struct vlc_readdir_helper *p_rdh, const char *psz_uri, const char *psz_flatpath, const char *psz_filename, int i_type, int i_net, input_item_t **created_item)
Add a new input_item_t entry to the node of the vlc_readdir_helper struct.
void input_item_SetDuration(input_item_t *p_i, vlc_tick_t i_duration)
Definition: item.c:378
int input_item_AddOption(input_item_t *, const char *, unsigned i_flags)
This function allows to add an option to an existing input_item_t.
Definition: item.c:494
void input_item_node_Delete(input_item_node_t *p_node)
Delete a node created with input_item_node_Create() and all its children.
Definition: item.c:1247
input_item_meta_request_option_t
Definition: vlc_input_item.h:478
@ META_REQUEST_OPTION_FETCH_LOCAL
Definition: vlc_input_item.h:485
@ META_REQUEST_OPTION_NONE
Definition: vlc_input_item.h:479
@ META_REQUEST_OPTION_SCOPE_ANY
Definition: vlc_input_item.h:482
@ META_REQUEST_OPTION_SCOPE_NETWORK
Definition: vlc_input_item.h:481
@ META_REQUEST_OPTION_SCOPE_FORCED
Definition: vlc_input_item.h:484
@ META_REQUEST_OPTION_FETCH_ANY
Definition: vlc_input_item.h:487
@ META_REQUEST_OPTION_DO_INTERACT
Definition: vlc_input_item.h:489
@ META_REQUEST_OPTION_SCOPE_LOCAL
Definition: vlc_input_item.h:480
@ META_REQUEST_OPTION_FETCH_NETWORK
Definition: vlc_input_item.h:486
slave_priority
Definition: vlc_input_item.h:160
@ SLAVE_PRIORITY_USER
Definition: vlc_input_item.h:165
@ SLAVE_PRIORITY_MATCH_LEFT
Definition: vlc_input_item.h:163
@ SLAVE_PRIORITY_MATCH_ALL
Definition: vlc_input_item.h:164
@ SLAVE_PRIORITY_MATCH_RIGHT
Definition: vlc_input_item.h:162
@ SLAVE_PRIORITY_MATCH_NONE
Definition: vlc_input_item.h:161
void input_item_ReplaceInfos(input_item_t *, info_category_t *)
Definition: item.c:801
char * input_item_GetMeta(input_item_t *p_i, vlc_meta_type_t meta_type)
Definition: item.c:242
static bool info_category_IsHidden(info_category_t *cat)
Returns true if the category is hidden.
Definition: vlc_input_item.h:65
input_item_node_t * input_item_node_AppendItem(input_item_node_t *p_node, input_item_t *p_item)
Add a new child node to this parent node that will point to this subitem.
Definition: item.c:1257
input_item_slave_t * input_item_slave_New(const char *, enum slave_type, enum slave_priority)
Definition: item.c:631
int input_item_AddSlave(input_item_t *, input_item_slave_t *)
This function allows adding a slave to an existing input item.
Definition: item.c:649
char * input_item_GetTitleFbName(input_item_t *p_i)
Definition: item.c:252
input_item_type_e
Definition: vlc_input_item.h:71
@ ITEM_TYPE_NODE
Definition: vlc_input_item.h:79
@ ITEM_TYPE_DISC
Definition: vlc_input_item.h:75
@ ITEM_TYPE_NUMBER
Definition: vlc_input_item.h:82
@ ITEM_TYPE_DIRECTORY
Definition: vlc_input_item.h:74
@ ITEM_TYPE_FILE
Definition: vlc_input_item.h:73
@ ITEM_TYPE_STREAM
Definition: vlc_input_item.h:77
@ ITEM_TYPE_UNKNOWN
Definition: vlc_input_item.h:72
@ ITEM_TYPE_PLAYLIST
Definition: vlc_input_item.h:78
@ ITEM_TYPE_CARD
Definition: vlc_input_item.h:76
void input_item_CopyOptions(input_item_t *p_child, input_item_t *p_parent)
Definition: item.c:137
input_item_parser_id_t * input_item_Parse(input_item_t *item, vlc_object_t *parent, const input_item_parser_cbs_t *cbs, void *userdata)
Parse an item asynchronously.
Definition: item.c:1380
This provides convenience helpers for linked lists.
This file defines functions and structures for stream meta-data in vlc.
vlc_meta_type_t
Definition: vlc_meta.h:34
Thread primitive declarations.
int64_t vlc_tick_t
High precision date or time interval.
Definition: vlc_tick.h:45