VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
item.c File Reference
Include dependency graph for item.c:

Data Structures

struct  item_type_entry

Macros

#define EPG_DEBUG

Functions

static int GuessType (const input_item_t *p_item)
void input_item_SetErrorWhenReading (input_item_t *p_i, bool b_error)
void input_item_SetPreparsed (input_item_t *p_i, bool b_preparsed)
void input_item_SetArtNotFound (input_item_t *p_i, bool b_not_found)
void input_item_SetArtFetched (input_item_t *p_i, bool b_art_fetched)
void input_item_SetMeta (input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz_val)
void input_item_CopyOptions (input_item_t *p_parent, input_item_t *p_child)
static void post_subitems (input_item_node_t *p_node)
void input_item_PostSubItem (input_item_t *p_parent, input_item_t *p_child)
 Add one subitem to this item.
bool input_item_HasErrorWhenReading (input_item_t *p_item)
bool input_item_MetaMatch (input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz)
char * input_item_GetMeta (input_item_t *p_i, vlc_meta_type_t meta_type)
char * input_item_GetTitleFbName (input_item_t *p_item)
char * input_item_GetName (input_item_t *p_item)
void input_item_SetName (input_item_t *p_item, const char *psz_name)
char * input_item_GetURI (input_item_t *p_i)
void input_item_SetURI (input_item_t *p_i, const char *psz_uri)
mtime_t input_item_GetDuration (input_item_t *p_i)
void input_item_SetDuration (input_item_t *p_i, mtime_t i_duration)
bool input_item_IsPreparsed (input_item_t *p_item)
bool input_item_IsArtFetched (input_item_t *p_item)
input_item_tinput_item_Hold (input_item_t *p_item)
 Holds an input item, i.e.
void input_item_Release (input_item_t *p_item)
 Releases an input item, i.e.
int input_item_AddOption (input_item_t *p_input, const char *psz_option, unsigned flags)
 This function allows to add an option to an existing input_item_t.
static info_category_tInputItemFindCat (input_item_t *p_item, int *pi_index, const char *psz_cat)
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.
static int InputItemVaAddInfo (input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, va_list args)
static int InputItemAddInfo (input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format,...)
int input_item_AddInfo (input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format,...)
int input_item_DelInfo (input_item_t *p_i, const char *psz_cat, const char *psz_name)
void input_item_ReplaceInfos (input_item_t *p_item, info_category_t *p_cat)
void input_item_MergeInfos (input_item_t *p_item, info_category_t *p_cat)
void input_item_SetEpg (input_item_t *p_item, const vlc_epg_t *p_update)
void input_item_SetEpgOffline (input_item_t *p_item)
input_item_tinput_item_NewExt (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 information.
input_item_tinput_item_NewWithType (const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned flags, mtime_t duration, int type)
 This function creates a new input_item_t with the provided information.
input_item_tinput_item_Copy (input_item_t *p_input)
 This function creates a new input_item_t as a copy of another.
static int typecmp (const void *key, const void *entry)
input_item_node_tinput_item_node_Create (input_item_t *p_input)
 Start adding multiple subitems.
static void RecursiveNodeDelete (input_item_node_t *p_node)
void input_item_node_Delete (input_item_node_t *p_node)
 Delete a node created with input_item_node_Create() and all its children.
input_item_node_tinput_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.
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.
void input_item_node_PostAndDelete (input_item_node_t *p_root)
 End adding multiple subitems.
void input_item_UpdateTracksInfo (input_item_t *item, const es_format_t *fmt)

Macro Definition Documentation

#define EPG_DEBUG

Function Documentation

static int GuessType ( const input_item_t p_item)
static
int input_item_AddInfo ( input_item_t p_i,
const char *  psz_cat,
const char *  psz_name,
const char *  psz_format,
  ... 
)
int input_item_AddOption ( input_item_t p_input,
const char *  psz_option,
unsigned  flags 
)
input_item_t* input_item_Copy ( input_item_t p_input)
void input_item_CopyOptions ( input_item_t p_parent,
input_item_t p_child 
)
int input_item_DelInfo ( input_item_t p_i,
const char *  psz_cat,
const char *  psz_name 
)
mtime_t input_item_GetDuration ( input_item_t p_i)
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.

Parameters
p_iThe input item to get info from
psz_catString representing the category for the info
psz_nameString representing the name of the desired info
Returns
A pointer to the string with the given info if found, or an empty string otherwise. The caller should free the returned pointer.

References info_category_FindInfo(), InputItemFindCat(), input_item_t::lock, info_t::psz_value, strdup(), vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by input_vaControl(), playlist_FindArtInCacheUsingItemUID(), and playlist_SaveArt().

char* input_item_GetMeta ( input_item_t p_i,
vlc_meta_type_t  meta_type 
)
char* input_item_GetName ( input_item_t p_item)
char* input_item_GetTitleFbName ( input_item_t p_item)
char* input_item_GetURI ( input_item_t p_i)
bool input_item_HasErrorWhenReading ( input_item_t p_item)
input_item_t* input_item_Hold ( input_item_t )

Holds an input item, i.e.

creates a new reference.

References item_owner, and input_item_owner::refs.

bool input_item_IsArtFetched ( input_item_t p_item)
bool input_item_IsPreparsed ( input_item_t p_item)
void input_item_MergeInfos ( input_item_t p_item,
info_category_t p_cat 
)
bool input_item_MetaMatch ( input_item_t p_i,
vlc_meta_type_t  meta_type,
const char *  psz 
)
input_item_t* input_item_NewExt ( 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 information.

Provided for convenience.

References input_item_NewWithType(), and ITEM_TYPE_UNKNOWN.

Referenced by playlist_AddExt(), playlist_Import(), and playlist_MLLoad().

input_item_t* input_item_NewWithType ( 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 
)
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.

References input_item_node_AppendNode(), and input_item_node_Create().

Referenced by input_item_PostSubItem().

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.

References input_item_node_t::i_children, INSERT_ELEM, input_item_node_t::p_parent, and input_item_node_t::pp_children.

Referenced by input_item_node_AppendItem().

input_item_node_t* input_item_node_Create ( input_item_t p_input)

Start adding multiple subitems.

Create a root node to hold a tree of subitems for given item

References input_item_node_t::i_children, input_item_node_t::p_item, input_item_node_t::p_parent, input_item_node_t::pp_children, and vlc_gc_incref.

Referenced by input_item_node_AppendItem(), and input_item_PostSubItem().

void input_item_node_Delete ( input_item_node_t p_node)
void input_item_node_PostAndDelete ( input_item_node_t p_node)

End adding multiple subitems.

Sends a vlc_InputItemSubItemTreeAdded event to notify that the item pointed to by the given root node has created new subitems that are pointed to by all the children of the node.

Also sends vlc_InputItemSubItemAdded event for every child under the given root node;

In the end deletes the node and all its children nodes.

References input_item_t::event_manager, input_item_node_Delete(), input_item_node_t::p_item, post_subitems(), vlc_event_t::type, vlc_event_send(), and vlc_InputItemSubItemTreeAdded.

Referenced by input_item_PostSubItem().

void input_item_PostSubItem ( input_item_t p_parent,
input_item_t p_child 
)

Add one subitem to this item.

This won't hold the item, but can tell to interested third parties Like the playlist, that there is a new sub item. With this design It is not the input item's responsability to keep all the ref of the input item children.

Sends a vlc_InputItemSubItemTreeAdded and a vlc_InputItemSubItemAdded event

References input_item_node_AppendItem(), input_item_node_Create(), and input_item_node_PostAndDelete().

void input_item_Release ( input_item_t )
void input_item_ReplaceInfos ( input_item_t p_item,
info_category_t p_cat 
)
void input_item_SetArtFetched ( input_item_t p_i,
bool  b_art_fetched 
)
void input_item_SetArtNotFound ( input_item_t p_i,
bool  b_not_found 
)
void input_item_SetDuration ( input_item_t p_i,
mtime_t  i_duration 
)
void input_item_SetEpg ( input_item_t p_item,
const vlc_epg_t p_update 
)
void input_item_SetEpgOffline ( input_item_t p_item)
void input_item_SetErrorWhenReading ( input_item_t p_i,
bool  b_error 
)
void input_item_SetMeta ( input_item_t p_i,
vlc_meta_type_t  meta_type,
const char *  psz_val 
)
void input_item_SetName ( input_item_t p_item,
const char *  psz_name 
)
void input_item_SetPreparsed ( input_item_t p_i,
bool  b_preparsed 
)
void input_item_SetURI ( input_item_t p_i,
const char *  psz_uri 
)
void input_item_UpdateTracksInfo ( input_item_t item,
const es_format_t fmt 
)
static int InputItemAddInfo ( input_item_t p_i,
const char *  psz_cat,
const char *  psz_name,
const char *  psz_format,
  ... 
)
static

References InputItemVaAddInfo().

Referenced by input_item_SetEpg().

static info_category_t* InputItemFindCat ( input_item_t p_item,
int *  pi_index,
const char *  psz_cat 
)
static
static int InputItemVaAddInfo ( input_item_t p_i,
const char *  psz_cat,
const char *  psz_name,
const char *  psz_format,
va_list  args 
)
static
static void post_subitems ( input_item_node_t p_node)
static
static void RecursiveNodeDelete ( input_item_node_t p_node)
static
static int typecmp ( const void *  key,
const void *  entry 
)
static

References item_type_entry::psz_scheme.

Referenced by GuessType().