|
VLC 4.0.0-dev
|
libvlc_downloader_t is an abstract representation of a downloader More...
Files | |
| file | libvlc_downloader.h |
| LibVLC downloader API. | |
Data Structures | |
| struct | libvlc_downloader_cbs |
| Downloader callbacks. More... | |
| struct | libvlc_downloader_request_t |
| struct defining a downloader request More... | |
| struct | libvlc_downloader_cfg |
| struct defining downloader configuration More... | |
Macros | |
| #define | LIBVLC_DOWNLOADER_CB_ERROR ((ptrdiff_t)-1) |
| Sentinel return value to signal an error in the download (to be returned by on_buffer callback). | |
| #define | LIBVLC_DOWNLOADER_CB_CANCEL ((ptrdiff_t)-2) |
| Sentinel return value to cancel the download (to be returned by on_buffer callback). | |
Typedefs | |
| typedef struct libvlc_downloader_t | libvlc_downloader_t |
| typedef struct libvlc_downloader_request_t | libvlc_downloader_request_t |
| A downloader request object. | |
| typedef struct libvlc_downloader_task | libvlc_downloader_task |
| Opaque handle of a downloader task. | |
| typedef enum libvlc_downloader_status_t | libvlc_downloader_status_t |
| Downloader status. | |
Enumerations | |
| enum | libvlc_downloader_status_t { libvlc_downloader_status_pending , libvlc_downloader_status_running , libvlc_downloader_status_paused , libvlc_downloader_status_finished , libvlc_downloader_status_cancelled , libvlc_downloader_status_error } |
| Downloader status. More... | |
Functions | |
| libvlc_downloader_t * | libvlc_downloader_new (libvlc_instance_t *inst, const struct libvlc_downloader_cfg *cfg) |
| Create a downloader instance. | |
| 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. | |
| size_t | libvlc_downloader_cancel (libvlc_downloader_t *downloader, libvlc_downloader_task *task) |
| Cancel an ongoing download. | |
| void | libvlc_downloader_set_pause (libvlc_downloader_t *downloader, libvlc_downloader_task *task, bool paused) |
| Toggle pause/resume for the download. | |
| 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. | |
| void | libvlc_downloader_task_release (libvlc_downloader_task *task) |
| Release a downloader task handle. | |
libvlc_downloader_t is an abstract representation of a downloader
| #define LIBVLC_DOWNLOADER_CB_CANCEL ((ptrdiff_t)-2) |
Sentinel return value to cancel the download (to be returned by on_buffer callback).
| #define LIBVLC_DOWNLOADER_CB_ERROR ((ptrdiff_t)-1) |
Sentinel return value to signal an error in the download (to be returned by on_buffer callback).
| typedef struct libvlc_downloader_request_t libvlc_downloader_request_t |
A downloader request object.
| typedef enum libvlc_downloader_status_t libvlc_downloader_status_t |
Downloader status.
| typedef struct libvlc_downloader_t libvlc_downloader_t |
| typedef struct libvlc_downloader_task libvlc_downloader_task |
Opaque handle of a downloader task.
Identifies a task request submitted via libvlc_downloader_queue(). It can be passed to libvlc_downloader_cancel() to cancel that request, or to libvlc_downloader_set_pause() to pause/resume that request.
Downloader status.
| size_t libvlc_downloader_cancel | ( | libvlc_downloader_t * | downloader, |
| libvlc_downloader_task * | task ) |
Cancel an ongoing download.
| downloader | downloader instance |
| task | a downloader task returned by libvlc_downloader_queue(), or NULL to cancel all requests. |
References LIBVLC_API.
| void libvlc_downloader_destroy | ( | libvlc_downloader_t * | downloader | ) |
Destroy a downloader and free resources.
All pending, running and paused downloads are cancelled. Waits for all download threads to join.
| downloader | downloader instance |
References LIBVLC_API.
| libvlc_downloader_t * libvlc_downloader_new | ( | libvlc_instance_t * | inst, |
| const struct libvlc_downloader_cfg * | cfg ) |
Create a downloader instance.
Supports downloading files over a limited set of protocols: http(s), ftp, file, nfs, smb, sftp
The downloader must be released by calling libvlc_downloader_destroy() when it is no longer needed.
| inst | LibVLC instance |
| cfg | a pointer to a valid downloader configuration struct |
References LIBVLC_API.
| 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.
| downloader | downloader instance |
| req | a pointer to a valid request struct |
| cbs | a pointer to a valid callbacks struct. The pointed struct must be kept alive (and not modified) by the caller until libvlc_downloader_cbs.on_state_update() is called for the returned task handle with a terminal state (finished/cancelled/error). |
| cbs_opaque | opaque pointer for callbacks |
| void libvlc_downloader_set_pause | ( | libvlc_downloader_t * | downloader, |
| libvlc_downloader_task * | task, | ||
| bool | paused ) |
Toggle pause/resume for the download.
| downloader | downloader instance |
| task | a valid downloader task returned by libvlc_downloader_queue() |
| paused | true to pause, false to resume |
References LIBVLC_API.
| libvlc_media_t * libvlc_downloader_task_get_media | ( | libvlc_downloader_task * | task | ) |
Get the media associated with the downloader request handle.
| task | opaque handle returned by libvlc_downloader_queue() |
| void libvlc_downloader_task_release | ( | libvlc_downloader_task * | task | ) |
Release a downloader task handle.
| task | the downloader task handle |
References LIBVLC_API.