21#ifndef VLC_LIBVLC_DOWNLOADER_H
22#define VLC_LIBVLC_DOWNLOADER_H 1
79#define LIBVLC_DOWNLOADER_CB_ERROR ((ptrdiff_t)-1)
82#define LIBVLC_DOWNLOADER_CB_CANCEL ((ptrdiff_t)-2)
122 const uint8_t *buf,
size_t len,
123 uint64_t position, uint64_t total);
size_t count
Definition core.c:403
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition libvlc.h:76
void libvlc_downloader_set_pause(libvlc_downloader_t *downloader, libvlc_downloader_task *task, bool paused)
Toggle pause/resume for the download.
size_t libvlc_downloader_cancel(libvlc_downloader_t *downloader, libvlc_downloader_task *task)
Cancel an ongoing download.
void libvlc_downloader_task_release(libvlc_downloader_task *task)
Release a downloader task handle.
libvlc_downloader_t * libvlc_downloader_new(libvlc_instance_t *inst, const struct libvlc_downloader_cfg *cfg)
Create a downloader instance.
struct libvlc_downloader_t libvlc_downloader_t
Definition libvlc_downloader.h:39
libvlc_downloader_status_t
Downloader status.
Definition libvlc_downloader.h:63
struct libvlc_downloader_task libvlc_downloader_task
Opaque handle of a downloader task.
Definition libvlc_downloader.h:57
libvlc_downloader_task * libvlc_downloader_task_new(libvlc_downloader_t *downloader, const libvlc_downloader_request_t *req, const struct libvlc_downloader_cbs *cbs, void *cbs_opaque)
Create a media download task.
int libvlc_downloader_submit(libvlc_downloader_t *downloader, libvlc_downloader_task *task)
Start a task created by libvlc_downloader_task_new().
void libvlc_downloader_destroy(libvlc_downloader_t *downloader)
Destroy a downloader and free resources.
libvlc_media_t * libvlc_downloader_task_get_media(libvlc_downloader_task *task)
Get the media associated with the downloader request handle.
@ libvlc_downloader_status_cancelled
download cancelled
Definition libvlc_downloader.h:73
@ libvlc_downloader_status_paused
download paused
Definition libvlc_downloader.h:69
@ libvlc_downloader_status_error
download error occurred
Definition libvlc_downloader.h:75
@ libvlc_downloader_status_finished
download finished
Definition libvlc_downloader.h:71
@ libvlc_downloader_status_running
active download in progress (not paused)
Definition libvlc_downloader.h:67
@ libvlc_downloader_status_pending
download pending
Definition libvlc_downloader.h:65
#define LIBVLC_API
Definition libvlc.h:42
LibVLC core external API.
Downloader callbacks.
Definition libvlc_downloader.h:88
ptrdiff_t(* on_buffer)(void *opaque, libvlc_downloader_task *task, const uint8_t *buf, size_t len, uint64_t position, uint64_t total)
Called when a buffer of data is read.
Definition libvlc_downloader.h:121
uint32_t version
Version of struct libvlc_downloader_cbs.
Definition libvlc_downloader.h:92
void(* on_state_update)(void *opaque, libvlc_downloader_task *task, libvlc_downloader_status_t status)
Called when the downloader state changes.
Definition libvlc_downloader.h:142
void(* on_slaves)(void *opaque, libvlc_downloader_task *task, libvlc_media_slave_t **slaves, size_t count)
Called when the parsed media has slaves.
Definition libvlc_downloader.h:175
void(* on_subitems)(void *opaque, libvlc_downloader_task *task, libvlc_media_list_t *subitems)
Called when subitems of the media are available.
Definition libvlc_downloader.h:158
struct defining downloader configuration
Definition libvlc_downloader.h:210
uint32_t version
Version of struct libvlc_downloader_cfg.
Definition libvlc_downloader.h:214
uint32_t max_parser_threads
The maximum number of threads used by the parser internally, 0 for default (1 thread).
Definition libvlc_downloader.h:223
struct defining a downloader request
Definition libvlc_downloader.h:183
libvlc_media_t * media
Media to download.
Definition libvlc_downloader.h:203
uint32_t version
Version of libvlc_downloader_request_t.
Definition libvlc_downloader.h:187