VLC 4.0.0-dev
|
Files | |
file | vlc_preparser.h |
VLC Preparser API. | |
Typedefs | |
typedef struct vlc_preparser_t | vlc_preparser_t |
Preparser opaque structure. More... | |
Functions | |
vlc_preparser_t * | vlc_preparser_New (vlc_object_t *obj) |
This function creates the preparser object and thread. More... | |
int | vlc_preparser_Push (vlc_preparser_t *preparser, input_item_t *item, input_item_meta_request_option_t option, const struct vlc_metadata_cbs *cbs, void *cbs_userdata, int timeout, void *id) |
This function enqueues the provided item to be preparsed or fetched. More... | |
void | vlc_preparser_Cancel (vlc_preparser_t *preparser, void *id) |
This function cancel all preparsing requests for a given id. More... | |
void | vlc_preparser_Delete (vlc_preparser_t *preparser) |
This function destroys the preparser object and thread. More... | |
void | vlc_preparser_Deactivate (vlc_preparser_t *preparser) |
This function deactivates the preparser. More... | |
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.
void vlc_preparser_Cancel | ( | vlc_preparser_t * | preparser, |
void * | id | ||
) |
This function cancel all preparsing requests for a given id.
preparser | the preparser object |
id | unique id given to vlc_preparser_Push() |
References 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(), and vlc_mutex_unlock().
Referenced by libvlc_MetadataCancel(), 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 libvlc_InternalCleanup().
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 libvlc_InternalCleanup().
vlc_preparser_t * vlc_preparser_New | ( | vlc_object_t * | obj | ) |
This function creates the preparser object and thread.
obj | the parent object |
References vlc_preparser_t::deactivated, vlc_preparser_t::default_timeout, vlc_preparser_t::executor, vlc_preparser_t::fetcher, input_fetcher_New(), vlc_preparser_t::lock, msg_Warn, vlc_preparser_t::owner, task::preparser, vlc_preparser_t::submitted_tasks, unlikely, var_InheritInteger(), vlc_executor_New(), vlc_list_init(), vlc_mutex_init(), and VLC_TICK_FROM_MS.
Referenced by libvlc_InternalInit().
int vlc_preparser_Push | ( | vlc_preparser_t * | preparser, |
input_item_t * | item, | ||
input_item_meta_request_option_t | option, | ||
const struct vlc_metadata_cbs * | cbs, | ||
void * | cbs_userdata, | ||
int | timeout, | ||
void * | id | ||
) |
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 |
timeout | maximum time allowed to preparse the item. If -1, the default "preparse-timeout" option will be used as a timeout. If 0, it will wait indefinitely. If > 0, the timeout will be used (in milliseconds). |
id | unique id provided by the caller. This is can be used to cancel the request with vlc_preparser_Cancel() |
References input_item_t::b_net, input_item_t::b_preparse_interact, task::cbs, vlc_preparser_t::deactivated, vlc_preparser_t::default_timeout, vlc_preparser_t::executor, input_item_t::i_type, i_type, task::item, ITEM_PREPARSE_SKIPPED, ITEM_TYPE_DIRECTORY, ITEM_TYPE_FILE, ITEM_TYPE_NODE, ITEM_TYPE_PLAYLIST, input_item_t::lock, META_REQUEST_OPTION_DO_INTERACT, META_REQUEST_OPTION_FETCH_ANY, META_REQUEST_OPTION_SCOPE_FORCED, META_REQUEST_OPTION_SCOPE_NETWORK, task::preparser, PreparserAddTask(), task::runnable, TaskNew(), task::timeout, VLC_EGENERIC, VLC_ENOMEM, vlc_executor_Submit(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_SUCCESS, and VLC_TICK_FROM_MS.
Referenced by vlc_MetadataRequest().