VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Preparser:

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_tvlc_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.
 

Detailed Description

Macro Definition Documentation

◆ VLC_PREPARSER_REQ_ID_INVALID

#define VLC_PREPARSER_REQ_ID_INVALID   0

Typedef Documentation

◆ input_item_meta_request_option_t

◆ vlc_preparser_req_id

typedef size_t vlc_preparser_req_id

◆ 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.

Enumeration Type Documentation

◆ input_item_meta_request_option_t

Enumerator
META_REQUEST_OPTION_NONE 
META_REQUEST_OPTION_PARSE 
META_REQUEST_OPTION_FETCH_LOCAL 
META_REQUEST_OPTION_FETCH_NETWORK 
META_REQUEST_OPTION_FETCH_ANY 
META_REQUEST_OPTION_DO_INTERACT 
META_REQUEST_OPTION_PARSE_SUBITEMS 

Function Documentation

◆ vlc_preparser_Cancel()

size_t vlc_preparser_Cancel ( vlc_preparser_t preparser,
vlc_preparser_req_id  id 
)

This function cancel all preparsing requests for a given id.

Parameters
preparserthe preparser object
idunique id returned by vlc_preparser_Push(), VLC_PREPARSER_REQ_ID_INVALID to cancels all tasks
Returns
number of tasks cancelled

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().

◆ vlc_preparser_Deactivate()

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).

Parameters
preparserthe preparser object

References vlc_preparser_t::deactivated, task::preparser, and vlc_preparser_Cancel().

Referenced by vlc_playlist_Delete().

◆ vlc_preparser_Delete()

void vlc_preparser_Delete ( vlc_preparser_t preparser)

This function destroys the preparser object and thread.

Parameters
preparserthe 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_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.

Parameters
objthe parent object
max_threadsthe maximum number of threads used to parse, must be >= 1
default_timeoutdefault timeout of the preparser, 0 for no limits.
request_typea 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.
Returns
a valid preparser object or NULL in case of error

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_Push()

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.

Parameters
preparserthe preparser object
itema valid item to preparse
optionpreparse flag, cf input_item_meta_request_option_t
cbscallback to listen to events (can't be NULL)
cbs_userdataopaque pointer used by the callbacks
idunique id provided by the caller. This is can be used to cancel the request with vlc_preparser_Cancel()
Returns
VLC_PREPARSER_REQ_ID_INVALID in case of error, or a valid id if the item was scheduled for preparsing. If this returns an error, the on_preparse_ended will not be invoked

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().

◆ vlc_preparser_SetTimeout()

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.