FFmpeg
Loading...
Searching...
No Matches
executor.c File Reference
#include "config.h"
#include <stdbool.h>
#include "libavutil/mem.h"
#include "libavutil/thread.h"
#include "executor.h"

Go to the source code of this file.

Data Structures

struct  ThreadInfo
 HAVE_THREADS. More...
 
struct  Queue
 Linear double-ended data structure. More...
 
struct  FFExecutor
 

Macros

#define ExecutorThread   char
 
#define executor_thread_create(t, a, s, ar)
 
#define executor_thread_join(t, r)
 

Functions

static FFTaskremove_task (Queue *q)
 
static void add_task (Queue *q, FFTask *t)
 
static int run_one_task (FFExecutor *e, void *lc)
 
static av_cold void executor_free (FFExecutor *e, const int has_lock, const int has_cond)
 
av_cold FFExecutorff_executor_alloc (const FFTaskCallbacks *cb, int thread_count)
 Alloc executor.
 
av_cold void ff_executor_free (FFExecutor **executor)
 Free executor.
 
void ff_executor_execute (FFExecutor *e, FFTask *t)
 Add task to executor.
 

Macro Definition Documentation

◆ ExecutorThread

#define ExecutorThread   char

Definition at line 32 of file executor.c.

◆ executor_thread_create

#define executor_thread_create ( t,
a,
s,
ar )
Value:
0

Definition at line 34 of file executor.c.

Referenced by av_executor_alloc(), and ff_executor_alloc().

◆ executor_thread_join

#define executor_thread_join ( t,
r )
Value:
do {} while(0)

Definition at line 35 of file executor.c.

Referenced by executor_free(), and executor_free().

Function Documentation

◆ remove_task()

static FFTask * remove_task ( Queue * q)
static

Definition at line 71 of file executor.c.

Referenced by run_one_task(), and run_one_task().

◆ add_task()

static void add_task ( Queue * q,
FFTask * t )
static

Definition at line 83 of file executor.c.

Referenced by av_executor_execute(), and ff_executor_execute().

◆ run_one_task()

static int run_one_task ( FFExecutor * e,
void * lc )
static

Definition at line 92 of file executor.c.

Referenced by av_executor_execute(), and ff_executor_execute().

◆ executor_free()

static av_cold void executor_free ( FFExecutor * e,
const int has_lock,
const int has_cond )
static

◆ ff_executor_alloc()

av_cold FFExecutor * ff_executor_alloc ( const FFTaskCallbacks * callbacks,
int thread_count )

Alloc executor.

Parameters
callbackscallback structure for executor
thread_countworker thread number, 0 for run on caller's thread directly
Returns
return the executor

Definition at line 156 of file executor.c.

Referenced by ff_vvc_executor_alloc().

◆ ff_executor_free()

av_cold void ff_executor_free ( FFExecutor ** e)

Free executor.

Parameters
epointer to executor

Definition at line 202 of file executor.c.

Referenced by ff_vvc_executor_free().

◆ ff_executor_execute()

void ff_executor_execute ( FFExecutor * e,
FFTask * t )

Add task to executor.

Parameters
epointer to executor
tpointer to task. If NULL, it will wakeup one work thread

Definition at line 213 of file executor.c.

Referenced by add_task().