VLC  4.0.0-dev
Data Structures | Functions | Variables
preparser.c File Reference
Include dependency graph for preparser.c:

Data Structures

struct  input_preparser_t
 
struct  task
 

Functions

static void RunnableRun (void *)
 
static struct taskTaskNew (input_preparser_t *preparser, input_item_t *item, input_item_meta_request_option_t options, const input_preparser_callbacks_t *cbs, void *userdata, void *id, vlc_tick_t timeout)
 
static void TaskDelete (struct task *task)
 
static void PreparserAddTask (input_preparser_t *preparser, struct task *task)
 
static void PreparserRemoveTask (input_preparser_t *preparser, struct task *task)
 
static void NotifyPreparseEnded (struct task *task)
 
static void OnParserEnded (input_item_t *item, int status, void *task_)
 
static void OnParserSubtreeAdded (input_item_t *item, input_item_node_t *subtree, void *task_)
 
static void OnArtFetchEnded (input_item_t *item, bool fetched, void *userdata)
 
static void Parse (struct task *task, vlc_tick_t deadline)
 
static void Fetch (struct task *task)
 
static void Interrupt (struct task *task)
 
input_preparser_tinput_preparser_New (vlc_object_t *parent)
 This function creates the preparser object and thread. More...
 
int input_preparser_Push (input_preparser_t *preparser, input_item_t *item, input_item_meta_request_option_t i_options, const input_preparser_callbacks_t *cbs, void *cbs_userdata, int timeout_ms, void *id)
 This function enqueues the provided item to be preparsed. More...
 
void input_preparser_fetcher_Push (input_preparser_t *preparser, input_item_t *item, input_item_meta_request_option_t options, const input_fetcher_callbacks_t *cbs, void *cbs_userdata)
 
void input_preparser_Cancel (input_preparser_t *preparser, void *id)
 This function cancel all preparsing requests for a given id. More...
 
void input_preparser_Deactivate (input_preparser_t *preparser)
 This function deactivates the preparser. More...
 
void input_preparser_Delete (input_preparser_t *preparser)
 This function destroys the preparser object and thread. More...
 

Variables

static const input_fetcher_callbacks_t input_fetcher_callbacks
 

Function Documentation

◆ Fetch()

static void Fetch ( struct task task)
static

◆ input_preparser_Cancel()

void input_preparser_Cancel ( input_preparser_t preparser,
void *  id 
)

◆ input_preparser_Deactivate()

void input_preparser_Deactivate ( input_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).

References input_preparser_t::deactivated, input_preparser_Cancel(), and task::preparser.

Referenced by libvlc_InternalCleanup().

◆ input_preparser_Delete()

void input_preparser_Delete ( input_preparser_t preparser)

This function destroys the preparser object and thread.

All pending input items will be released.

References input_preparser_t::executor, input_preparser_t::fetcher, input_fetcher_Delete(), input_preparser_Cancel(), task::preparser, and vlc_executor_Delete().

Referenced by libvlc_InternalCleanup().

◆ input_preparser_fetcher_Push()

void input_preparser_fetcher_Push ( input_preparser_t preparser,
input_item_t item,
input_item_meta_request_option_t  options,
const input_fetcher_callbacks_t cbs,
void *  cbs_userdata 
)

◆ input_preparser_New()

input_preparser_t* input_preparser_New ( vlc_object_t parent)

◆ input_preparser_Push()

int input_preparser_Push ( input_preparser_t preparser,
input_item_t item,
input_item_meta_request_option_t  i_options,
const input_preparser_callbacks_t cbs,
void *  cbs_userdata,
int  timeout,
void *  id 
)

This function enqueues the provided item to be preparsed.

The input item is retained until the preparsing is done or until the preparser object is deleted.

Parameters
timeoutmaximum 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).
idunique id provided by the caller. This is can be used to cancel the request with input_preparser_Cancel()
Returns
VLC_SUCCESS if the item was scheduled for preparsing, an error code otherwise If this returns an error, the on_preparse_ended will not be invoked

References input_item_t::b_net, input_item_t::b_preparse_interact, task::cbs, input_preparser_t::deactivated, input_preparser_t::default_timeout, input_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_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().

◆ Interrupt()

static void Interrupt ( struct task task)
static

◆ NotifyPreparseEnded()

static void NotifyPreparseEnded ( struct task task)
static

◆ OnArtFetchEnded()

static void OnArtFetchEnded ( input_item_t item,
bool  fetched,
void *  userdata 
)
static

◆ OnParserEnded()

static void OnParserEnded ( input_item_t item,
int  status,
void *  task_ 
)
static

◆ OnParserSubtreeAdded()

static void OnParserSubtreeAdded ( input_item_t item,
input_item_node_t subtree,
void *  task_ 
)
static

References task::cbs, task::item, task::userdata, and VLC_UNUSED.

Referenced by Parse().

◆ Parse()

static void Parse ( struct task task,
vlc_tick_t  deadline 
)
static

◆ PreparserAddTask()

static void PreparserAddTask ( input_preparser_t preparser,
struct task task 
)
static

◆ PreparserRemoveTask()

static void PreparserRemoveTask ( input_preparser_t preparser,
struct task task 
)
static

◆ RunnableRun()

static void RunnableRun ( void *  userdata)
static

◆ TaskDelete()

static void TaskDelete ( struct task task)
static

◆ TaskNew()

static struct task* TaskNew ( input_preparser_t preparser,
input_item_t item,
input_item_meta_request_option_t  options,
const input_preparser_callbacks_t cbs,
void *  userdata,
void *  id,
vlc_tick_t  timeout 
)
static

Variable Documentation

◆ input_fetcher_callbacks

const input_fetcher_callbacks_t input_fetcher_callbacks
static
Initial value:
= {
.on_art_fetch_ended = OnArtFetchEnded,
}
static void OnArtFetchEnded(input_item_t *item, bool fetched, void *userdata)
Definition: preparser.c:169

Referenced by Fetch().