21#ifndef VLC_LIBVLC_DOWNLOADER_H
22#define VLC_LIBVLC_DOWNLOADER_H 1
78#define LIBVLC_DOWNLOADER_CB_ERROR ((ptrdiff_t)-1)
81#define LIBVLC_DOWNLOADER_CB_CANCEL ((ptrdiff_t)-2)
121 const uint8_t *buf,
size_t len,
122 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:62
struct libvlc_downloader_task libvlc_downloader_task
Opaque handle of a downloader task.
Definition libvlc_downloader.h:56
libvlc_downloader_task * libvlc_downloader_queue(libvlc_downloader_t *downloader, const libvlc_downloader_request_t *req, const struct libvlc_downloader_cbs *cbs, void *cbs_opaque)
Download a media asynchronously.
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:72
@ libvlc_downloader_status_paused
download paused
Definition libvlc_downloader.h:68
@ libvlc_downloader_status_error
download error occurred
Definition libvlc_downloader.h:74
@ libvlc_downloader_status_finished
download finished
Definition libvlc_downloader.h:70
@ libvlc_downloader_status_running
active download in progress (not paused)
Definition libvlc_downloader.h:66
@ libvlc_downloader_status_pending
download pending
Definition libvlc_downloader.h:64
#define LIBVLC_API
Definition libvlc.h:42
LibVLC core external API.
Downloader callbacks.
Definition libvlc_downloader.h:87
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:120
uint32_t version
Version of struct libvlc_downloader_cbs.
Definition libvlc_downloader.h:91
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:141
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:168
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:154
struct defining downloader configuration
Definition libvlc_downloader.h:202
uint32_t version
Version of struct libvlc_downloader_cfg.
Definition libvlc_downloader.h:206
uint32_t max_parser_threads
The maximum number of threads used by the parser internally, 0 for default (1 thread).
Definition libvlc_downloader.h:215
struct defining a downloader request
Definition libvlc_downloader.h:176
libvlc_media_t * media
Media to download.
Definition libvlc_downloader.h:195
uint32_t version
Version of libvlc_downloader_request_t.
Definition libvlc_downloader.h:180