Go to the documentation of this file.
25 #ifndef _PLAYLIST_FETCHER_H
26 #define _PLAYLIST_FETCHER_H 1
static void vlc_dictionary_insert(vlc_dictionary_t *p_dict, const char *psz_key, void *p_value)
Definition: vlc_arrays.h:566
int playlist_FindArtInCacheUsingItemUID(input_item_t *p_item)
Definition: art.c:230
Structure containing information about the playlist.
Definition: vlc_playlist.h:151
No arg.
Definition: vlc_playlist.h:228
playlist_item_t * playlist_CurrentPlayingItem(playlist_t *p_playlist)
Definition: engine.c:484
struct background_worker * background_worker_New(void *owner, struct background_worker_config *conf)
Create a background-worker.
Definition: background_worker.c:184
int playlist_fetcher_Push(playlist_fetcher_t *fetcher, input_item_t *item, input_item_meta_request_option_t options, int preparse_status)
This function enqueues the provided item to be art fetched.
Definition: fetcher.c:450
playlist_t * playlist_Create(vlc_object_t *p_parent)
Create playlist.
Definition: engine.c:195
Definition: vlc_memstream.h:27
playlist_item_t * get_current_status_node(playlist_t *p_playlist)
Definition: engine.c:404
int playlist_SaveArt(vlc_object_t *obj, input_item_t *p_item, const void *data, size_t length, const char *psz_type)
Definition: art.c:267
void background_worker_RequestProbe(struct background_worker *worker)
Request the background-worker to probe the current task.
Definition: background_worker.c:250
#define var_SetAddress(o, n, p)
Definition: vlc_variables.h:260
vlc_mutex_t lock
dah big playlist global lock
Definition: playlist_internal.h:82
input_thread_t * playlist_CurrentInputLocked(playlist_t *p_playlist)
Get current playing input.
Definition: engine.c:369
playlist_item_t * playlist_NodeCreate(playlist_t *p_playlist, const char *psz_name, playlist_item_t *p_parent, int i_pos, int i_flags)
Create a playlist node.
Definition: tree.c:56
vlc_interrupt_t interrupt
Definition: fetcher.c:67
char * ptr
Definition: vlc_memstream.h:51
int error
Definition: vlc_memstream.h:66
playlist_item_array_t current
Items currently being played.
Definition: vlc_playlist.h:157
playlist item / node
Definition: vlc_playlist.h:126
void playlist_Lock(playlist_t *pl)
Locks the playlist.
Definition: control.c:35
static int InvokeModule(playlist_fetcher_t *fetcher, input_item_t *item, int scope, char const *type)
Definition: fetcher.c:145
#define VLC_VAR_DOINHERIT
Creation flag.
Definition: vlc_variables.h:69
#define VLC_THREAD_PRIORITY_LOW
Definition: vlc_threads.h:321
size_t length
Definition: vlc_memstream.h:52
#define PL_LOCK
Definition: vlc_playlist.h:216
Definition: vlc_arrays.h:386
playlist_item_t * get_current_status_item(playlist_t *p_playlist)
Accessor for status item and status nodes.
Definition: engine.c:397
#define PL_UNLOCK
Definition: vlc_playlist.h:217
static void vlc_dictionary_clear(vlc_dictionary_t *p_dict, void(*pf_free)(void *p_data, void *p_obj), void *p_obj)
Definition: vlc_arrays.h:407
static void FreeCacheEntry(void *data, void *obj)
Definition: fetcher.c:100
playlist_fetcher_t * playlist_fetcher_New(vlc_object_t *)
This function creates the fetcher object and thread.
Definition: fetcher.c:416
vlc_tick_t default_timeout
Default timeout for completing a task.
Definition: background_worker.h:44
struct background_worker * downloader
Definition: fetcher.c:64
static int RandomCallback(vlc_object_t *p_this, char const *psz_cmd, vlc_value_t oldval, vlc_value_t newval, void *a)
Definition: engine.c:44
playlist_item_t root
Definition: vlc_playlist.h:161
static int RateCallback(vlc_object_t *p_this, char const *psz_cmd, vlc_value_t oldval, vlc_value_t newval, void *p)
Definition: engine.c:115
#define PLAYLIST_DELETE_FORCE
delete node even if read-only
Definition: playlist_internal.h:143
int i_current_index
Index in current array.
Definition: vlc_playlist.h:158
No arg.
Definition: vlc_playlist.h:229
unsigned i_nb_played
Times played.
Definition: vlc_playlist.h:133
struct fetcher_request * req
Definition: fetcher.c:64
void vlc_renderer_item_release(vlc_renderer_item_t *p_item)
Releases a renderer item, i.e.
Definition: renderer_discovery.c:166
void * p_address
Definition: vlc_common.h:335
#define var_InheritBool(o, n)
Definition: vlc_variables.h:601
void ResetCurrentlyPlaying(playlist_t *p_playlist, playlist_item_t *p_cur)
Reset the currently playing playlist.
Definition: thread.c:143
#define VLC_VAR_BOOL
Definition: vlc_variables.h:49
playlist_item_t * p_item
Currently playing/active item.
Definition: playlist_internal.h:64
Definition: playlist_internal.h:46
void playlist_Deactivate(playlist_t *p_playlist)
Stops the playlist forever (but do not destroy it yet).
Definition: thread.c:65
int playlist_MLDump(playlist_t *p_playlist)
Definition: loadsave.c:177
int i_children
Number of children, -1 if not a node.
Definition: vlc_playlist.h:132
#define msg_Dbg(p_this,...)
Definition: vlc_messages.h:86
struct background_worker * network
Definition: fetcher.c:63
Definition: vlc_playlist.h:148
#define vlc_stream_NewURL(a, b)
Definition: vlc_stream.h:404
#define _(str)
Definition: vlc_fixups.h:371
void set_current_status_node(playlist_t *p_playlist, playlist_item_t *p_node)
Definition: engine.c:419
#define VLC_EGENERIC
Unspecified error.
Definition: vlc_common.h:354
#define VLC_VAR_ADDRESS
Definition: vlc_variables.h:53
#define ARRAY_SIZE(x)
Definition: vlc_arrays.h:162
int vlc_clone(vlc_thread_t *th, void *(*entry)(void *), void *data, int priority)
Creates and starts a new thread.
Definition: thread.c:263
#define VLC_VAR_INTEGER
Definition: vlc_variables.h:50
#define VLC_VAR_STRING
Definition: vlc_variables.h:51
static int CorksCallback(vlc_object_t *obj, char const *var, vlc_value_t old, vlc_value_t cur, void *dummy)
When there are one or more pending corks, playback should be paused.
Definition: engine.c:78
#define VLC_VAR_FLOAT
Definition: vlc_variables.h:52
Definition: background_worker.h:21
void vlc_cond_signal(vlc_cond_t *p_condvar)
Wakes up one thread waiting on a condition variable.
Definition: thread.c:256
#define ARRAY_RESET(array)
Definition: vlc_arrays.h:180
#define var_InheritString(o, n)
Definition: vlc_variables.h:639
input_resource_t * p_input_resource
input resources
Definition: playlist_internal.h:59
int asprintf(char **, const char *,...)
int preparse_status
Definition: fetcher.c:56
int64_t i_int
Definition: vlc_common.h:331
#define var_Create(a, b, c)
Definition: vlc_variables.h:121
int vlc_memstream_open(struct vlc_memstream *ms)
Definition: memstream.c:104
void playlist_Control(playlist_t *p_playlist, int query, int locked,...)
Do a playlist action.
Definition: control.c:139
void playlist_fetcher_Delete(playlist_fetcher_t *)
This function destroys the fetcher object and thread.
Definition: fetcher.c:472
#define var_GetFloat(a, b)
Definition: vlc_variables.h:657
#define vlc_object_hold(a)
Definition: vlc_objects.h:60
int playlist_ServicesDiscoveryAdd(playlist_t *playlist, const char *chain)
Add a service discovery module.
Definition: services_discovery.c:112
bool vlc_killed(void)
Checks if the interruption context was "killed".
Definition: interrupt.c:186
void ResyncCurrentIndex(playlist_t *p_playlist, playlist_item_t *p_cur)
Synchronise the current index of the playlist to match the index of the current item.
Definition: thread.c:117
vlc_http_cookie_jar_t * vlc_http_cookies_new(void)
Definition: httpcookies.c:272
#define VLC_VAR_VOID
Definition: vlc_variables.h:48
Audio output object.
Definition: vlc_aout.h:114
bool b_bool
Definition: vlc_common.h:332
vlc_renderer_item_t * p_renderer
Definition: playlist_internal.h:60
static int ReadAlbumCache(playlist_fetcher_t *fetcher, input_item_t *item)
Definition: fetcher.c:106
#define vlc_object_release(a)
Definition: vlc_objects.h:63
void vlc_interrupt_kill(vlc_interrupt_t *ctx)
Marks the interruption context as "killed".
Definition: interrupt.c:178
static void RequestHold(void *req_)
Definition: fetcher.c:330
struct playlist_private_t::@74 status
Definition: background_worker.c:37
void playlist_Destroy(playlist_t *p_playlist)
Destroy playlist.
Definition: engine.c:311
Internal module descriptor.
Definition: modules.h:79
static void SearchNetwork(playlist_fetcher_t *fetcher, struct fetcher_request *req)
Definition: fetcher.c:310
input_item_t * item
Definition: fetcher.c:54
#define ARRAY_INIT(array)
Definition: vlc_arrays.h:173
float f_float
Definition: vlc_common.h:333
Definition: vlc_playlist.h:148
void playlist_ServicesDiscoveryKillAll(playlist_t *p_playlist)
Definition: services_discovery.c:246
static void * vlc_dictionary_value_for_key(const vlc_dictionary_t *p_dict, const char *psz_key)
Definition: vlc_arrays.h:450
static int StartSearchNetwork(void *fetcher_, void *req_, void **out)
Definition: fetcher.c:399
int background_worker_Push(struct background_worker *worker, void *entity, void *id, int timeout)
Push an entity into the background-worker.
Definition: background_worker.c:208
#define var_Destroy(a, b)
Definition: vlc_variables.h:124
#define var_SetFloat(a, b, c)
Definition: vlc_variables.h:258
static int StartDownloader(void *fetcher_, void *req_, void **out)
Definition: fetcher.c:400
static void AddAlbumCache(playlist_fetcher_t *fetcher, input_item_t *item, bool overwrite)
Definition: fetcher.c:124
vlc_interrupt_t * vlc_interrupt_set(vlc_interrupt_t *newctx)
Sets the interruption context for the calling thread.
Definition: interrupt.c:99
#define VLC_VAR_ISCOMMAND
Definition: vlc_variables.h:64
Will children inherit flags the R/O flag ?
Definition: vlc_playlist.h:143
Thread handle.
Definition: vlc_threads.h:252
static int StartWorker(playlist_fetcher_t *fetcher, void(*pf_worker)(playlist_fetcher_t *, struct fetcher_request *), struct background_worker *bg, struct fetcher_request *req, void **handle)
Definition: fetcher.c:348
#define PL_ASSERT_LOCKED
Definition: vlc_playlist.h:218
void vlc_mutex_init(vlc_mutex_t *p_mutex)
Initializes a fast mutex.
Definition: thread.c:85
void vlc_interrupt_deinit(vlc_interrupt_t *ctx)
Deinitializes an interruption context.
Definition: interrupt.c:71
int playlist_FindArtInCache(input_item_t *p_item)
Definition: art.c:161
static void WorkerInit(playlist_fetcher_t *fetcher, struct background_worker **worker, int(*starter)(void *, void *, void **))
Definition: fetcher.c:402
stream_t definition
Definition: vlc_stream.h:46
#define var_GetInteger(a, b)
Definition: vlc_variables.h:655
vlc_object_t * owner
Definition: fetcher.c:67
Write-enabled ?
Definition: vlc_playlist.h:141
playlist_fetcher_t * fetcher
Definition: fetcher.c:65
input_thread_t * playlist_CurrentInput(playlist_t *p_playlist)
Get current playing input.
Definition: engine.c:382
static int StartSearchLocal(void *fetcher_, void *req_, void **out)
Definition: fetcher.c:398
static void * FetcherThread(void *handle)
Definition: fetcher.c:336
Definition: interrupt.h:30
ssize_t vlc_stream_Read(stream_t *s, void *buf, size_t len)
Reads data from a byte stream.
Definition: stream.c:453
static void VariablesInit(playlist_t *p_playlist)
Definition: engine.c:427
Definition: httpcookies.c:266
static int ProbeWorker(void *fetcher_, void *th_)
Definition: fetcher.c:376
void playlist_NodeDeleteExplicit(playlist_t *, playlist_item_t *, int flags)
Delete a node with explicit semantics.
Definition: tree.c:96
int i_id
Playlist item specific id.
Definition: vlc_playlist.h:135
static int CheckMeta(input_item_t *item)
Definition: fetcher.c:166
static int vlc_dictionary_has_key(const vlc_dictionary_t *p_dict, const char *psz_key)
Definition: vlc_arrays.h:434
vlc_dictionary_t album_cache
Definition: fetcher.c:66
#define likely(p)
Definition: vlc_common.h:113
static void SearchLocal(playlist_fetcher_t *fetcher, struct fetcher_request *req)
Definition: fetcher.c:292
The main vlc_object_t structure.
Definition: vlc_objects.h:39
#define VLC_ENOMEM
Not enough memory.
Definition: vlc_common.h:355
void background_worker_Delete(struct background_worker *worker)
Delete a background-worker.
Definition: background_worker.c:258
struct background_worker * worker
Definition: fetcher.c:63
void(* pf_worker)(playlist_fetcher_t *, struct fetcher_request *)
Definition: fetcher.c:61
#define VLC_UNUSED(x)
Definition: vlc_common.h:916
void set_current_status_item(playlist_t *p_playlist, playlist_item_t *p_item)
Definition: engine.c:411
vlc_mutex_t lock
Definition: fetcher.c:68
pthread_mutex_t vlc_mutex_t
Mutex.
Definition: vlc_threads.h:267
#define VLC_SUCCESS
No error.
Definition: vlc_common.h:353
static int SearchArt(playlist_fetcher_t *fetcher, input_item_t *item, int scope)
Definition: fetcher.c:186
vlc_cond_t signal
wakes up the playlist engine thread
Definition: playlist_internal.h:83
#define FREENULL(a)
Definition: vlc_common.h:770
atomic_bool active
Definition: fetcher.c:69
uint8_t i_flags
Flags.
Definition: vlc_playlist.h:136
#define vlc_custom_create(o, s, n)
Definition: libvlc.h:108
void vlc_http_cookies_destroy(vlc_http_cookie_jar_t *p_jar)
Definition: httpcookies.c:284
static int RateOffsetCallback(vlc_object_t *obj, char const *psz_cmd, vlc_value_t oldval, vlc_value_t newval, void *p_data)
Definition: engine.c:130
#define var_GetAddress(a, b)
Definition: vlc_variables.h:660
#define PLAYLIST_END
Definition: vlc_playlist.h:204
void playlist_Activate(playlist_t *)
Creates the main playlist thread.
Definition: thread.c:48
void vlc_cond_destroy(vlc_cond_t *p_condvar)
Deinitializes a condition variable.
Definition: thread.c:228
void vlc_cond_init(vlc_cond_t *p_condvar)
Initializes a condition variable.
Definition: thread.c:216
#define TAB_INIT(count, tab)
Definition: vlc_arrays.h:40
atomic_uint refs
Definition: fetcher.c:55
int playlist_Status(playlist_t *p_playlist)
Definition: engine.c:491
void vlc_mutex_destroy(vlc_mutex_t *p_mutex)
Deinitializes a mutex.
Definition: thread.c:110
int playlist_fetcher_Push(playlist_fetcher_t *, input_item_t *, input_item_meta_request_option_t, int)
This function enqueues the provided item to be art fetched.
Definition: fetcher.c:450
input_thread_t * p_input
the input thread associated with the current item
Definition: playlist_internal.h:57
playlist_fetcher_t * playlist_fetcher_New(vlc_object_t *owner)
This function creates the fetcher object and thread.
Definition: fetcher.c:416
size_t vlc_memstream_write(struct vlc_memstream *ms, const void *ptr, size_t len)
Definition: memstream.c:126
void vlc_mutex_unlock(vlc_mutex_t *p_mutex)
Releases a mutex.
Definition: thread.c:138
static void Downloader(playlist_fetcher_t *fetcher, struct fetcher_request *req)
Definition: fetcher.c:226
vlc_thread_t thread
Definition: fetcher.c:68
#define unlikely(p)
Definition: vlc_common.h:114
#define pl_priv(pl)
Definition: playlist_internal.h:103
#define var_AddCallback(a, b, c, d)
Definition: vlc_variables.h:164
playlist_item_t * p_playing
Definition: vlc_playlist.h:162
void playlist_fetcher_Delete(playlist_fetcher_t *fetcher)
This function destroys the fetcher object and thread.
Definition: fetcher.c:472
static void SetPreparsed(struct fetcher_request *req)
Definition: fetcher.c:217
static void CloseWorker(void *fetcher_, void *th_)
Definition: fetcher.c:382
int options
Definition: fetcher.c:57
#define var_SetChecked(o, n, t, v)
Definition: vlc_variables.h:139
static void vlc_dictionary_init(vlc_dictionary_t *p_dict, int i_size)
Definition: vlc_arrays.h:394
playlist_item_t ** pp_children
Children nodes/items.
Definition: vlc_playlist.h:130
playlist_item_t * p_media_library
Definition: vlc_playlist.h:163
Definition: vlc_playlist.h:148
int playlist_MLLoad(playlist_t *p_playlist)
Definition: loadsave.c:128
void playlist_Unlock(playlist_t *pl)
Unlocks the playlist.
Definition: control.c:40
char * strsep(char **, const char *)
void vlc_interrupt_init(vlc_interrupt_t *ctx)
Initializes an interruption context.
Definition: interrupt.c:51
#define VLC_OBJECT(x)
Type-safe vlc_object_t cast.
Definition: vlc_common.h:468
playlist_item_array_t items
Arrays of items.
Definition: vlc_playlist.h:155
#define module_unneed(a, b)
Definition: vlc_modules.h:49
static void RequestRelease(void *req_)
Definition: fetcher.c:319
VLC value structure.
Definition: vlc_common.h:329
struct background_worker * local
Definition: fetcher.c:62
static char * CreateCacheKey(input_item_t *item)
Definition: fetcher.c:72
static int SearchByScope(playlist_fetcher_t *fetcher, struct fetcher_request *req, int scope)
Definition: fetcher.c:192
static int VideoSplitterCallback(vlc_object_t *p_this, char const *psz_cmd, vlc_value_t oldval, vlc_value_t newval, void *p_data)
Definition: engine.c:167
void vlc_mutex_lock(vlc_mutex_t *p_mutex)
Acquires a mutex.
Definition: thread.c:123
Definition: vlc_playlist.h:208
int vlc_memstream_close(struct vlc_memstream *ms)
Definition: memstream.c:119
static int CheckArt(input_item_t *item)
Definition: fetcher.c:177
#define DEF_STARTER(name, worker)
Definition: fetcher.c:393
input_item_t * p_input
Linked input item.
Definition: vlc_playlist.h:128
void vlc_join(vlc_thread_t handle, void **result)
Waits for a thread to complete (if needed), then destroys it.
Definition: thread.c:270
#define module_need(a, b, c, d)
Definition: vlc_modules.h:47
void vlc_stream_Delete(stream_t *s)
Destroy a stream.
Definition: stream.c:120