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

Files

file  vlc_preparser.h
 VLC Preparser API.
 

Data Structures

struct  vlc_thumbnailer_cbs
 Preparser thumbnailer callbacks. More...
 
struct  vlc_thumbnailer_arg
 Thumbnailer argument. More...
 
struct  vlc_preparser_cfg
 Preparser creation configuration. More...
 

Macros

#define VLC_PREPARSER_REQ_ID_INVALID   0
 
#define VLC_PREPARSER_TYPE_PARSE   0x01
 
#define VLC_PREPARSER_TYPE_FETCHMETA_LOCAL   0x02
 
#define VLC_PREPARSER_TYPE_FETCHMETA_NET   0x04
 
#define VLC_PREPARSER_TYPE_THUMBNAIL   0x08
 
#define VLC_PREPARSER_TYPE_FETCHMETA_ALL    (VLC_PREPARSER_TYPE_FETCHMETA_LOCAL|VLC_PREPARSER_TYPE_FETCHMETA_NET)
 
#define VLC_PREPARSER_OPTION_INTERACT   0x1000
 
#define VLC_PREPARSER_OPTION_SUBITEMS   0x2000
 

Typedefs

typedef struct vlc_preparser_t vlc_preparser_t
 Preparser opaque structure.
 
typedef size_t vlc_preparser_req_id
 

Functions

vlc_preparser_tvlc_preparser_New (vlc_object_t *obj, const struct vlc_preparser_cfg *cfg)
 This function creates the preparser object and thread.
 
vlc_preparser_req_id vlc_preparser_Push (vlc_preparser_t *preparser, input_item_t *item, int type_option, const input_item_parser_cbs_t *cbs, void *cbs_userdata)
 This function enqueues the provided item to be preparsed or fetched.
 
vlc_preparser_req_id vlc_preparser_GenerateThumbnail (vlc_preparser_t *preparser, input_item_t *item, const struct vlc_thumbnailer_arg *arg, const struct vlc_thumbnailer_cbs *cbs, void *cbs_userdata)
 This function enqueues the provided item for generating a thumbnail.
 
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_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_OPTION_INTERACT

#define VLC_PREPARSER_OPTION_INTERACT   0x1000

◆ VLC_PREPARSER_OPTION_SUBITEMS

#define VLC_PREPARSER_OPTION_SUBITEMS   0x2000

◆ VLC_PREPARSER_REQ_ID_INVALID

#define VLC_PREPARSER_REQ_ID_INVALID   0

◆ VLC_PREPARSER_TYPE_FETCHMETA_ALL

#define VLC_PREPARSER_TYPE_FETCHMETA_ALL    (VLC_PREPARSER_TYPE_FETCHMETA_LOCAL|VLC_PREPARSER_TYPE_FETCHMETA_NET)

◆ VLC_PREPARSER_TYPE_FETCHMETA_LOCAL

#define VLC_PREPARSER_TYPE_FETCHMETA_LOCAL   0x02

◆ VLC_PREPARSER_TYPE_FETCHMETA_NET

#define VLC_PREPARSER_TYPE_FETCHMETA_NET   0x04

◆ VLC_PREPARSER_TYPE_PARSE

#define VLC_PREPARSER_TYPE_PARSE   0x01

◆ VLC_PREPARSER_TYPE_THUMBNAIL

#define VLC_PREPARSER_TYPE_THUMBNAIL   0x08

Typedef Documentation

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

Function Documentation

◆ vlc_preparser_Cancel()

size_t vlc_preparser_Cancel ( vlc_preparser_t preparser,
vlc_preparser_req_id  id 
)

◆ 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::fetcher, input_fetcher_Delete(), vlc_preparser_t::parser, task::preparser, vlc_preparser_t::thumbnailer, vlc_executor_Delete(), and vlc_preparser_Cancel().

Referenced by vlc_playlist_Delete(), and vlc_playlist_New().

◆ vlc_preparser_GenerateThumbnail()

vlc_preparser_req_id vlc_preparser_GenerateThumbnail ( vlc_preparser_t preparser,
input_item_t item,
const struct vlc_thumbnailer_arg arg,
const struct vlc_thumbnailer_cbs cbs,
void *  cbs_userdata 
)

This function enqueues the provided item for generating a thumbnail.

Parameters
preparserthe preparser object
itema valid item to generate the thumbnail for
argpointer to a seek struct, that tell at which time the thumbnail should be taken, NULL to disable seek
timeoutA timeout value, or VLC_TICK_INVALID to disable timeout
cbscallback to listen to events (can't be NULL)
cbs_userdataopaque pointer used by the callbacks
Returns
VLC_PREPARSER_REQ_ID_INVALID in case of error, or a valid id if the item was scheduled for thumbnailing. If this returns an error, the thumbnailer.on_ended callback will not be invoked

The provided input_item will be held by the thumbnailer and can safely be released safely after calling this function.

References task::cbs, task::id, task::item, task::preparser, PreparserAddTask(), task::runnable, TaskNew(), task::thumb_arg, vlc_preparser_cbs::thumbnailer, vlc_preparser_t::thumbnailer, ThumbnailerRun(), vlc_executor_Submit(), VLC_PREPARSER_REQ_ID_INVALID, and VLC_PREPARSER_TYPE_THUMBNAIL.

◆ vlc_preparser_New()

◆ vlc_preparser_Push()

vlc_preparser_req_id vlc_preparser_Push ( vlc_preparser_t preparser,
input_item_t item,
int  type_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
type_optiona combination of VLC_PREPARSER_TYPE_* and VLC_PREPARSER_OPTION_* flags. The type must be in the set specified in vlc_preparser_New() (it is possible to select less types).
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 vlc_input_thread_cfg::cbs, Fetch(), vlc_preparser_t::fetcher, task::id, task::item, vlc_preparser_t::lock, vlc_preparser_cbs::parser, vlc_preparser_t::parser, ParserRun(), task::preparser, PreparserAddTask(), PreparserGetNextTaskIdLocked(), task::runnable, TaskNew(), vlc_executor_Submit(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_PREPARSER_REQ_ID_INVALID, VLC_PREPARSER_TYPE_FETCHMETA_ALL, VLC_PREPARSER_TYPE_PARSE, VLC_PREPARSER_TYPE_THUMBNAIL, 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 task::preparser, and vlc_preparser_t::timeout.