VLC 4.0.0-dev
Loading...
Searching...
No Matches
external.c File Reference
Include dependency graph for external.c:

Data Structures

struct  preparser_serdes_cbs_ctx
struct  preparser_sys
struct  preparser_process_thread
union  preparser_task_cbs
struct  preparser_task
struct  preparser_process_pool

Macros

#define VLC_PREPARSER_PATH   "vlc-preparser"

Functions

static ssize_t write_cbs (const void *data, size_t size, void *userdata)
static ssize_t read_cbs (void *data, size_t size, void *userdata)
static struct preparser_taskpreparser_task_get_req_owner (struct vlc_preparser_req *req)
static void preparser_task_ExecCallback (struct preparser_task *task, int status)
 Execute task callbacks.
static int preparser_task_Run (struct preparser_process_thread *thread, vlc_tick_t timeout)
 Execute a task: Send a request and wait for a response then call callbacks.
static struct vlc_preparser_reqpreparser_task_req_Hold (struct vlc_preparser_req *req)
static input_item_tpreparser_task_req_GetItem (struct vlc_preparser_req *req)
static void preparser_task_req_Release (struct vlc_preparser_req *req)
static struct preparser_taskpreparser_task_New (input_item_t *item, enum vlc_preparser_msg_req_type req_type)
 Create a new task.
static void preparser_task_Delete (struct preparser_task *task)
 Delete a task and its message.
static void preparser_task_InitPush (struct preparser_task *task, int options, const union preparser_task_cbs *cbs, void *userdata)
 Init a task for a Push request.
static void preparser_task_InitThumbnail (struct preparser_task *task, const struct vlc_thumbnailer_arg *arg, const union preparser_task_cbs *cbs, void *userdata)
 Init a task for a Generate Thumbnail request.
static void preparser_task_InitThumbnailToFile (struct preparser_task *task, const struct vlc_thumbnailer_arg *arg, const struct vlc_thumbnailer_output *outputs, size_t output_count, const union preparser_task_cbs *cbs, void *userdata)
 Init a task for a Generate Thumbnail To Files request.
static void preparser_pool_QueuePush (struct preparser_process_pool *pool, struct preparser_task *task)
 Add a task to the process pool queue and trigger the queue_wait.
static struct preparser_taskpreparser_pool_QueueTake (struct preparser_process_pool *pool)
 Take a task on the queue or wait for a new one to be added.
static int preparser_pool_SpawnProcess (struct preparser_process_thread *thread)
static void * preparser_pool_Run (void *data)
 Process thread loop.
static int preparser_pool_SpawnThread (struct preparser_process_pool *pool)
 Start a new thread process with its external process.
static void preparser_pool_Submit (struct preparser_process_pool *pool, struct preparser_task *task)
 Push a new task in the queue and check if a new process thread can be spawn.
static size_t preparser_pool_Cancel (struct preparser_process_pool *pool, struct vlc_preparser_req *req)
 Cancel a request.
static void preparser_pool_Delete (struct preparser_process_pool *pool)
 Clear and delete the process pool.
static struct preparser_process_poolpreparser_pool_New (vlc_object_t *obj, size_t max, vlc_tick_t timeout, int types)
 Create a new process pool with max maximum process.
static struct vlc_preparser_reqpreparser_Push (void *opaque, input_item_t *item, int options, const struct vlc_preparser_cbs *cbs, void *cbs_userdata)
 Preparser push operation.
static struct vlc_preparser_reqpreparser_GenerateThumbnail (void *opaque, input_item_t *item, const struct vlc_thumbnailer_arg *thumb_arg, const struct vlc_thumbnailer_cbs *cbs, void *cbs_userdata)
 Preparser GenerateThumbnail operation.
static struct vlc_preparser_reqpreparser_GenerateThumbnailToFiles (void *opaque, input_item_t *item, const struct vlc_thumbnailer_arg *thumb_arg, const struct vlc_thumbnailer_output *outputs, size_t output_count, const struct vlc_thumbnailer_to_files_cbs *cbs, void *cbs_userdata)
 Preparser GenerateThumbnailToFiles operation.
static size_t preparser_Cancel (void *opaque, struct vlc_preparser_req *req)
 Preparser Cancel operation.
static void preparser_SetTimeout (void *opaque, vlc_tick_t timeout)
 Preparser SetTimeout operation.
static void preparser_Delete (void *opaque)
 Preparser Delete operation.
void * vlc_preparser_external_New (vlc_preparser_t *owner, vlc_object_t *parent, const struct vlc_preparser_cfg *cfg)
 Create a new preparser with an external process.

Macro Definition Documentation

◆ VLC_PREPARSER_PATH

#define VLC_PREPARSER_PATH   "vlc-preparser"

Function Documentation

◆ preparser_Cancel()

size_t preparser_Cancel ( void * opaque,
struct vlc_preparser_req * req )
static

◆ preparser_Delete()

void preparser_Delete ( void * opaque)
static

◆ preparser_GenerateThumbnail()

◆ preparser_GenerateThumbnailToFiles()

struct vlc_preparser_req * preparser_GenerateThumbnailToFiles ( void * opaque,
input_item_t * item,
const struct vlc_thumbnailer_arg * thumb_arg,
const struct vlc_thumbnailer_output * outputs,
size_t output_count,
const struct vlc_thumbnailer_to_files_cbs * cbs,
void * cbs_userdata )
static

◆ preparser_pool_Cancel()

◆ preparser_pool_Delete()

◆ preparser_pool_New()

◆ preparser_pool_QueuePush()

void preparser_pool_QueuePush ( struct preparser_process_pool * pool,
struct preparser_task * task )
static

◆ preparser_pool_QueueTake()

◆ preparser_pool_Run()

void * preparser_pool_Run ( void * data)
static

Process thread loop.

Take a task on the queue, then execute the task and delete it. Check that the external process has not crashed otherwise start a new one.

References task::interrupt, task::node, preparser_pool_QueueTake(), preparser_pool_SpawnProcess(), preparser_task_Delete(), preparser_task_Run(), thread, vlc_interrupt_set(), vlc_list_append(), vlc_list_remove(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_process_Terminate(), VLC_SUCCESS, and vlc_thread_set_name().

Referenced by preparser_pool_SpawnThread().

◆ preparser_pool_SpawnProcess()

◆ preparser_pool_SpawnThread()

◆ preparser_pool_Submit()

void preparser_pool_Submit ( struct preparser_process_pool * pool,
struct preparser_task * task )
static

Push a new task in the queue and check if a new process thread can be spawn.

If there is more unfinished task than spawned process thread and that the max number of process thread is not reached, then a new thread is spwaned.

References preparser_process_pool::closing, preparser_process_pool::lock, preparser_process_pool::max_threads, preparser_process_pool::nthreads, preparser_pool_QueuePush(), preparser_pool_SpawnThread(), preparser_process_pool::unfinished, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by preparser_GenerateThumbnail(), preparser_GenerateThumbnailToFiles(), and preparser_Push().

◆ preparser_Push()

◆ preparser_SetTimeout()

◆ preparser_task_Delete()

void preparser_task_Delete ( struct preparser_task * task)
static

◆ preparser_task_ExecCallback()

◆ preparser_task_get_req_owner()

struct preparser_task * preparser_task_get_req_owner ( struct vlc_preparser_req * req)
static

◆ preparser_task_InitPush()

void preparser_task_InitPush ( struct preparser_task * task,
int options,
const union preparser_task_cbs * cbs,
void * userdata )
static

◆ preparser_task_InitThumbnail()

◆ preparser_task_InitThumbnailToFile()

◆ preparser_task_New()

◆ preparser_task_req_GetItem()

input_item_t * preparser_task_req_GetItem ( struct vlc_preparser_req * req)
static

◆ preparser_task_req_Hold()

◆ preparser_task_req_Release()

◆ preparser_task_Run()

int preparser_task_Run ( struct preparser_process_thread * thread,
vlc_tick_t timeout )
static

◆ read_cbs()

◆ vlc_preparser_external_New()

◆ write_cbs()