VLC  4.0.0-dev
Typedefs | Enumerations | Functions
vlc_thumbnailer.h File Reference
Include dependency graph for vlc_thumbnailer.h:

Go to the source code of this file.

Typedefs

typedef struct vlc_thumbnailer_t vlc_thumbnailer_t
 
typedef struct vlc_thumbnailer_request_t vlc_thumbnailer_request_t
 
typedef void(* vlc_thumbnailer_cb) (void *data, picture_t *thumbnail)
 vlc_thumbnailer_cb defines a callback invoked on thumbnailing completion or error More...
 

Enumerations

enum  vlc_thumbnailer_seek_speed { VLC_THUMBNAILER_SEEK_PRECISE, VLC_THUMBNAILER_SEEK_FAST }
 

Functions

VLC_EXPORT vlc_thumbnailer_tvlc_thumbnailer_Create (vlc_object_t *p_parent)
 vlc_thumbnailer_Create Creates a thumbnailer object More...
 
VLC_EXPORT vlc_thumbnailer_request_tvlc_thumbnailer_RequestByTime (vlc_thumbnailer_t *thumbnailer, vlc_tick_t time, enum vlc_thumbnailer_seek_speed speed, input_item_t *input_item, vlc_tick_t timeout, vlc_thumbnailer_cb cb, void *user_data)
 vlc_thumbnailer_RequestByTime Requests a thumbnailer at a given time More...
 
VLC_EXPORT vlc_thumbnailer_request_tvlc_thumbnailer_RequestByPos (vlc_thumbnailer_t *thumbnailer, float pos, enum vlc_thumbnailer_seek_speed speed, input_item_t *input_item, vlc_tick_t timeout, vlc_thumbnailer_cb cb, void *user_data)
 vlc_thumbnailer_RequestByTime Requests a thumbnailer at a given time More...
 
VLC_EXPORT void vlc_thumbnailer_Cancel (vlc_thumbnailer_t *thumbnailer, vlc_thumbnailer_request_t *request)
 vlc_thumbnailer_Cancel Cancel a thumbnail request More...
 
VLC_EXPORT void vlc_thumbnailer_Release (vlc_thumbnailer_t *thumbnailer)
 vlc_thumbnailer_Release releases a thumbnailer and cancel all pending requests More...
 

Typedef Documentation

◆ vlc_thumbnailer_cb

typedef void(* vlc_thumbnailer_cb) (void *data, picture_t *thumbnail)

vlc_thumbnailer_cb defines a callback invoked on thumbnailing completion or error

This callback will always be called, provided vlc_thumbnailer_Request returned a non NULL request, and provided the request is not cancelled before its completion. In case of failure, p_thumbnail will be NULL. The picture, if any, is owned by the thumbnailer, and must be acquired by using picture_Hold to use it pass the callback's scope.

Parameters
dataIs the opaque pointer passed as vlc_thumbnailer_Request last parameter
thumbnailThe generated thumbnail, or NULL in case of failure or timeout

◆ vlc_thumbnailer_request_t

◆ vlc_thumbnailer_t

Enumeration Type Documentation

◆ vlc_thumbnailer_seek_speed

Enumerator
VLC_THUMBNAILER_SEEK_PRECISE 

Precise, but potentially slow.

VLC_THUMBNAILER_SEEK_FAST 

Fast, but potentially imprecise.

Function Documentation

◆ vlc_thumbnailer_Cancel()

VLC_EXPORT void vlc_thumbnailer_Cancel ( vlc_thumbnailer_t thumbnailer,
vlc_thumbnailer_request_t request 
)

vlc_thumbnailer_Cancel Cancel a thumbnail request

Parameters
thumbnailerA thumbnailer object
requestAn opaque thumbnail request object

Cancelling a request will not invoke the completion callback. The behavior is undefined if the request is cancelled after its completion.

References Interrupt().

◆ vlc_thumbnailer_Create()

VLC_EXPORT vlc_thumbnailer_t* vlc_thumbnailer_Create ( vlc_object_t p_parent)

vlc_thumbnailer_Create Creates a thumbnailer object

Parameters
parentA VLC object
Returns
A thumbnailer object, or NULL in case of failure

References vlc_thumbnailer_t::executor, vlc_thumbnailer_t::lock, vlc_thumbnailer_t::parent, vlc_thumbnailer_t::submitted_tasks, unlikely, vlc_executor_New(), vlc_list_init(), and vlc_mutex_init().

Referenced by libvlc_InternalInit().

◆ vlc_thumbnailer_Release()

VLC_EXPORT void vlc_thumbnailer_Release ( vlc_thumbnailer_t thumbnailer)

vlc_thumbnailer_Release releases a thumbnailer and cancel all pending requests

Parameters
thumbnailerA thumbnailer object

References CancelAllTasks(), vlc_thumbnailer_t::executor, and vlc_executor_Delete().

Referenced by libvlc_InternalCleanup().

◆ vlc_thumbnailer_RequestByPos()

VLC_EXPORT vlc_thumbnailer_request_t* vlc_thumbnailer_RequestByPos ( vlc_thumbnailer_t thumbnailer,
float  pos,
enum vlc_thumbnailer_seek_speed  speed,
input_item_t input_item,
vlc_tick_t  timeout,
vlc_thumbnailer_cb  cb,
void *  user_data 
)

vlc_thumbnailer_RequestByTime Requests a thumbnailer at a given time

Parameters
thumbnailerA thumbnailer object
posThe position at which the thumbnail should be taken
speedThe seeking speed
See also
{enum vlc_thumbnailer_seek_speed}
Parameters
input_itemThe input item to generate the thumbnail for
timeoutA timeout value, or VLC_TICK_INVALID to disable timeout
cbA user callback to be called on completion (success & error)
user_dataAn opaque value, provided as pf_cb's first parameter
Returns
An opaque request object, or NULL in case of failure

If this function returns a valid request object, the callback is guaranteed to be called, even in case of later failure. The returned request object must not be used after the callback has been invoked. That request object is owned by the thumbnailer, and must not be released. The provided input_item will be held by the thumbnailer and can safely be released after calling this function.

References seek_target::pos, RequestCommon(), seek_target::type, and seek_target::VLC_THUMBNAILER_SEEK_POS.

◆ vlc_thumbnailer_RequestByTime()

VLC_EXPORT vlc_thumbnailer_request_t* vlc_thumbnailer_RequestByTime ( vlc_thumbnailer_t thumbnailer,
vlc_tick_t  time,
enum vlc_thumbnailer_seek_speed  speed,
input_item_t input_item,
vlc_tick_t  timeout,
vlc_thumbnailer_cb  cb,
void *  user_data 
)

vlc_thumbnailer_RequestByTime Requests a thumbnailer at a given time

Parameters
thumbnailerA thumbnailer object
timeThe time at which the thumbnail should be taken
speedThe seeking speed
See also
{enum vlc_thumbnailer_seek_speed}
Parameters
input_itemThe input item to generate the thumbnail for
timeoutA timeout value, or VLC_TICK_INVALID to disable timeout
cbA user callback to be called on completion (success & error)
user_dataAn opaque value, provided as pf_cb's first parameter
Returns
An opaque request object, or NULL in case of failure

If this function returns a valid request object, the callback is guaranteed to be called, even in case of later failure. The returned request object must not be used after the callback has been invoked. That request object is owned by the thumbnailer, and must not be released. The provided input_item will be held by the thumbnailer and can safely be released safely after calling this function.

References RequestCommon(), seek_target::time, seek_target::type, and seek_target::VLC_THUMBNAILER_SEEK_TIME.