VLC 4.0.0-dev
fetcher.c File Reference
Include dependency graph for fetcher.c:

Data Structures

struct  input_fetcher_t
 
struct  task
 

Functions

static void RunDownloader (void *)
 
static void RunSearchLocal (void *)
 
static void RunSearchNetwork (void *)
 
static struct taskTaskNew (input_fetcher_t *fetcher, vlc_executor_t *executor, input_item_t *item, input_item_meta_request_option_t options, const input_fetcher_callbacks_t *cbs, void *userdata)
 
static void TaskDelete (struct task *task)
 
static void FetcherAddTask (input_fetcher_t *fetcher, struct task *task)
 
static void FetcherRemoveTask (input_fetcher_t *fetcher, struct task *task)
 
static int Submit (input_fetcher_t *fetcher, vlc_executor_t *executor, input_item_t *item, input_item_meta_request_option_t options, const input_fetcher_callbacks_t *cbs, void *userdata)
 
static char * CreateCacheKey (input_item_t *item)
 
static void FreeCacheEntry (void *data, void *obj)
 
static int ReadAlbumCache (input_fetcher_t *fetcher, input_item_t *item)
 
static void AddAlbumCache (input_fetcher_t *fetcher, input_item_t *item, bool overwrite)
 
static int InvokeModule (input_fetcher_t *fetcher, input_item_t *item, int scope, char const *type)
 
static int CheckMeta (input_item_t *item)
 
static int CheckArt (input_item_t *item)
 
static int SearchArt (input_fetcher_t *fetcher, input_item_t *item, int scope)
 
static int SearchByScope (struct task *task, int scope)
 
static void NotifyArtFetchEnded (struct task *task, bool fetched)
 
input_fetcher_tinput_fetcher_New (vlc_object_t *owner)
 This function creates the fetcher object and thread. More...
 
int input_fetcher_Push (input_fetcher_t *fetcher, input_item_t *item, input_item_meta_request_option_t options, const input_fetcher_callbacks_t *cbs, void *cbs_userdata)
 This function enqueues the provided item to be art fetched. More...
 
static void CancelAllTasks (input_fetcher_t *fetcher)
 
void input_fetcher_Delete (input_fetcher_t *fetcher)
 This function destroys the fetcher object and thread. More...
 

Function Documentation

◆ AddAlbumCache()

◆ CancelAllTasks()

◆ CheckArt()

◆ CheckMeta()

◆ CreateCacheKey()

static char * CreateCacheKey ( input_item_t item)
static

Simple concatenation of artist and album can lead to the same key for entities that should not have such. Imagine { dogs, tick } and { dog, stick }

References asprintf(), task::item, input_item_t::lock, input_item_t::p_meta, vlc_meta_Album, vlc_meta_Artist, vlc_meta_Date, vlc_meta_Get(), vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by AddAlbumCache(), and ReadAlbumCache().

◆ FetcherAddTask()

static void FetcherAddTask ( input_fetcher_t fetcher,
struct task task 
)
static

◆ FetcherRemoveTask()

static void FetcherRemoveTask ( input_fetcher_t fetcher,
struct task task 
)
static

◆ FreeCacheEntry()

static void FreeCacheEntry ( void *  data,
void *  obj 
)
static

References VLC_UNUSED.

Referenced by input_fetcher_Delete().

◆ input_fetcher_Delete()

void input_fetcher_Delete ( input_fetcher_t fetcher)

◆ input_fetcher_New()

◆ input_fetcher_Push()

int input_fetcher_Push ( input_fetcher_t fetcher,
input_item_t item,
input_item_meta_request_option_t  options,
const input_fetcher_callbacks_t cbs,
void *  cbs_userdata 
)

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 task::cbs, task::executor, input_fetcher_t::executor_local, input_fetcher_t::executor_network, task::fetcher, task::item, META_REQUEST_OPTION_FETCH_ANY, META_REQUEST_OPTION_FETCH_LOCAL, task::options, and Submit().

Referenced by Fetch().

◆ InvokeModule()

static int InvokeModule ( input_fetcher_t fetcher,
input_item_t item,
int  scope,
char const *  type 
)
static

◆ NotifyArtFetchEnded()

static void NotifyArtFetchEnded ( struct task task,
bool  fetched 
)
static

◆ ReadAlbumCache()

◆ RunDownloader()

◆ RunSearchLocal()

◆ RunSearchNetwork()

◆ SearchArt()

static int SearchArt ( input_fetcher_t fetcher,
input_item_t item,
int  scope 
)
static

◆ SearchByScope()

◆ Submit()

◆ TaskDelete()

static void TaskDelete ( struct task task)
static

◆ TaskNew()