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

Data Structures

struct  playlist_fetcher_t

Functions

static void * Thread (void *)
playlist_fetcher_tplaylist_fetcher_New (vlc_object_t *parent)
 This function creates the fetcher object and thread.
void playlist_fetcher_Push (playlist_fetcher_t *p_fetcher, input_item_t *p_item)
 This function enqueues the provided item to be art fetched.
void playlist_fetcher_Delete (playlist_fetcher_t *p_fetcher)
 This function destroys the fetcher object and thread.
static int FindArt (playlist_fetcher_t *p_fetcher, input_item_t *p_item)
 This function locates the art associated to an input item.
static int DownloadArt (playlist_fetcher_t *p_fetcher, input_item_t *p_item)
 Download the art using the URL or an art downloaded This function should be called only if data is not already in cache.
static void FetchMeta (playlist_fetcher_t *p_fetcher, input_item_t *p_item)
 FetchMeta, run the "meta fetcher".

Function Documentation

static int DownloadArt ( playlist_fetcher_t p_fetcher,
input_item_t p_item 
)
static

Download the art using the URL or an art downloaded This function should be called only if data is not already in cache.

< No error

< No error

< Unspecified error

References input_item_GetArtURL, msg_Dbg, msg_Warn, playlist_fetcher_t::object, playlist_SaveArt(), realloc_or_free(), stream_Delete(), stream_Read(), stream_UrlNew, VLC_EGENERIC, and VLC_SUCCESS.

Referenced by Thread().

static void FetchMeta ( playlist_fetcher_t p_fetcher,
input_item_t p_item 
)
static

FetchMeta, run the "meta fetcher".

They are going to do network connections, and gather information upon the playing media. (even artwork).

References module_need, module_unneed, playlist_fetcher_t::object, demux_meta_t::p_demux, demux_meta_t::p_item, vlc_custom_create, and vlc_object_release.

Referenced by Thread().

static int FindArt ( playlist_fetcher_t p_fetcher,
input_item_t p_item 
)
static

This function locates the art associated to an input item.

Return codes: 0 : Art is in cache or is a local file 1 : Art found, need to download -X : Error/not found

< Unspecified error

< Unspecified error

< No error

< Unspecified error

< Unspecified error

References playlist_fetcher_t::albums, ARRAY_APPEND, playlist_album_t::b_found, FOREACH_ARRAY, FOREACH_END, input_item_GetAlbum(), input_item_GetArtist(), input_item_GetArtURL, input_item_GetName(), input_item_GetTitle(), input_item_SetArtURL, module_need, module_unneed, msg_Dbg, playlist_fetcher_t::object, art_finder_t::p_item, playlist_FindArtInCache(), playlist_FindArtInCacheUsingItemUID(), playlist_album_t::psz_album, playlist_album_t::psz_artist, playlist_album_t::psz_arturl, vlc_custom_create, VLC_EGENERIC, vlc_object_release, and VLC_SUCCESS.

Referenced by Thread().

void playlist_fetcher_Delete ( playlist_fetcher_t )
playlist_fetcher_t* playlist_fetcher_New ( vlc_object_t parent)
void playlist_fetcher_Push ( playlist_fetcher_t ,
input_item_t  
)

This function enqueues the provided item to be art fetched.

The input item is retained until the art fetching is done or until the fetcher object is destroyed.

References playlist_fetcher_t::b_live, playlist_fetcher_t::i_waiting, INSERT_ELEM, playlist_fetcher_t::lock, msg_Err, playlist_fetcher_t::object, playlist_fetcher_t::pp_waiting, Thread(), vlc_clone_detach(), vlc_gc_incref, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_THREAD_PRIORITY_LOW.

Referenced by Art(), and playlist_AskForArtEnqueue().

static void * Thread ( void *  p_data)
static