VLC 4.0.0-dev
|
Files | |
file | vlc_preparser.h |
VLC Preparser API. | |
Macros | |
#define | VLC_PREPARSER_REQ_ID_INVALID 0 |
Typedefs | |
typedef struct vlc_preparser_t | vlc_preparser_t |
Preparser opaque structure. | |
typedef size_t | vlc_preparser_req_id |
typedef enum input_item_meta_request_option_t | input_item_meta_request_option_t |
Enumerations | |
enum | input_item_meta_request_option_t { META_REQUEST_OPTION_NONE = 0x00 , META_REQUEST_OPTION_PARSE = 0x01 , META_REQUEST_OPTION_FETCH_LOCAL = 0x02 , META_REQUEST_OPTION_FETCH_NETWORK = 0x04 , META_REQUEST_OPTION_FETCH_ANY , META_REQUEST_OPTION_DO_INTERACT = 0x08 , META_REQUEST_OPTION_PARSE_SUBITEMS = 0x10 } |
Functions | |
vlc_preparser_t * | vlc_preparser_New (vlc_object_t *obj, unsigned max_threads, vlc_tick_t default_timeout, input_item_meta_request_option_t request_type) |
This function creates the preparser object and thread. | |
vlc_preparser_req_id | vlc_preparser_Push (vlc_preparser_t *preparser, input_item_t *item, input_item_meta_request_option_t option, const input_item_parser_cbs_t *cbs, void *cbs_userdata) |
This function enqueues the provided item to be preparsed or fetched. | |
size_t | vlc_preparser_Cancel (vlc_preparser_t *preparser, vlc_preparser_req_id id) |
This function cancel all preparsing requests for a given id. | |
void | vlc_preparser_Delete (vlc_preparser_t *preparser) |
This function destroys the preparser object and thread. | |
void | vlc_preparser_Deactivate (vlc_preparser_t *preparser) |
This function deactivates the preparser. | |
void | vlc_preparser_SetTimeout (vlc_preparser_t *preparser, vlc_tick_t timeout) |
Do not use, libVLC only fonction, will be removed soon. | |
#define VLC_PREPARSER_REQ_ID_INVALID 0 |
typedef size_t vlc_preparser_req_id |
typedef struct vlc_preparser_t vlc_preparser_t |
Preparser opaque structure.
The preparser object will retrieve the meta data of any given input item in an asynchronous way. It will also issue art fetching requests.
size_t vlc_preparser_Cancel | ( | vlc_preparser_t * | preparser, |
vlc_preparser_req_id | id | ||
) |
This function cancel all preparsing requests for a given id.
preparser | the preparser object |
id | unique id returned by vlc_preparser_Push(), VLC_PREPARSER_REQ_ID_INVALID to cancels all tasks |
References count, vlc_preparser_t::executor, task::id, Interrupt(), vlc_preparser_t::lock, task::node, NotifyPreparseEnded(), task::preparser, task::runnable, vlc_preparser_t::submitted_tasks, TaskDelete(), vlc_executor_Cancel(), vlc_list_foreach, vlc_list_remove(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_PREPARSER_REQ_ID_INVALID.
Referenced by vlc_preparser_Deactivate(), and vlc_preparser_Delete().
void vlc_preparser_Deactivate | ( | vlc_preparser_t * | preparser | ) |
This function deactivates the preparser.
All pending requests will be removed, and it will block until the currently running entity has finished (if any).
preparser | the preparser object |
References vlc_preparser_t::deactivated, task::preparser, and vlc_preparser_Cancel().
Referenced by vlc_playlist_Delete().
void vlc_preparser_Delete | ( | vlc_preparser_t * | preparser | ) |
This function destroys the preparser object and thread.
preparser | the preparser object All pending input items will be released. |
References vlc_preparser_t::executor, vlc_preparser_t::fetcher, input_fetcher_Delete(), task::preparser, vlc_executor_Delete(), and vlc_preparser_Cancel().
Referenced by vlc_playlist_Delete(), and vlc_playlist_New().
vlc_preparser_t * vlc_preparser_New | ( | vlc_object_t * | obj, |
unsigned | max_threads, | ||
vlc_tick_t | default_timeout, | ||
input_item_meta_request_option_t | request_type | ||
) |
This function creates the preparser object and thread.
obj | the parent object |
max_threads | the maximum number of threads used to parse, must be >= 1 |
default_timeout | default timeout of the preparser, 0 for no limits. |
request_type | a combination of META_REQUEST_OPTION_PARSE, META_REQUEST_OPTION_FETCH_LOCAL and META_REQUEST_OPTION_FETCH_NETWORK, it is used to setup the executors for each domain. |
References vlc_preparser_t::current_id, vlc_preparser_t::deactivated, vlc_preparser_t::default_timeout, vlc_preparser_t::executor, vlc_preparser_t::fetcher, input_fetcher_New(), vlc_preparser_t::lock, META_REQUEST_OPTION_FETCH_ANY, META_REQUEST_OPTION_PARSE, vlc_preparser_t::owner, task::preparser, vlc_preparser_t::submitted_tasks, unlikely, vlc_executor_Delete(), vlc_executor_New(), vlc_list_init(), and vlc_mutex_init().
Referenced by vlc_playlist_New().
vlc_preparser_req_id vlc_preparser_Push | ( | vlc_preparser_t * | preparser, |
input_item_t * | item, | ||
input_item_meta_request_option_t | option, | ||
const input_item_parser_cbs_t * | cbs, | ||
void * | cbs_userdata | ||
) |
This function enqueues the provided item to be preparsed or fetched.
The input item is retained until the preparsing is done or until the preparser object is deleted.
preparser | the preparser object |
item | a valid item to preparse |
option | preparse flag, cf input_item_meta_request_option_t |
cbs | callback to listen to events (can't be NULL) |
cbs_userdata | opaque pointer used by the callbacks |
id | unique id provided by the caller. This is can be used to cancel the request with vlc_preparser_Cancel() |
References task::cbs, vlc_preparser_t::deactivated, vlc_preparser_t::default_timeout, vlc_preparser_t::executor, Fetch(), vlc_preparser_t::fetcher, task::id, task::item, vlc_preparser_t::lock, META_REQUEST_OPTION_FETCH_ANY, META_REQUEST_OPTION_PARSE, task::preparser, PreparserAddTask(), PreparserGetNextTaskIdLocked(), task::runnable, TaskNew(), vlc_executor_Submit(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by vlc_media_tree_Preparse(), and vlc_playlist_AutoPreparse().
void vlc_preparser_SetTimeout | ( | vlc_preparser_t * | preparser, |
vlc_tick_t | timeout | ||
) |
Do not use, libVLC only fonction, will be removed soon.
References vlc_preparser_t::default_timeout, task::preparser, and task::timeout.