FFmpeg
Data Structures | Macros | Functions
executor.c File Reference
#include "internal.h"
#include "mem.h"
#include "thread.h"
#include "executor.h"

Go to the source code of this file.

Data Structures

struct  ThreadInfo
 HAVE_THREADS. More...
 
struct  AVExecutor
 

Macros

#define ExecutorThread   char
 
#define executor_thread_create(t, a, s, ar)   0
 
#define executor_thread_join(t, r)   do {} while(0)
 

Functions

static AVTaskremove_task (AVTask **prev, AVTask *t)
 
static void add_task (AVTask **prev, AVTask *t)
 
static int run_one_task (AVExecutor *e, void *lc)
 
static void executor_free (AVExecutor *e, const int has_lock, const int has_cond)
 
AVExecutorav_executor_alloc (const AVTaskCallbacks *cb, int thread_count)
 Alloc executor. More...
 
void av_executor_free (AVExecutor **executor)
 Free executor. More...
 
void av_executor_execute (AVExecutor *e, AVTask *t)
 Add task to executor. More...
 

Macro Definition Documentation

◆ ExecutorThread

#define ExecutorThread   char

Definition at line 28 of file executor.c.

◆ executor_thread_create

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

Definition at line 30 of file executor.c.

◆ executor_thread_join

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

Definition at line 31 of file executor.c.

Function Documentation

◆ remove_task()

static AVTask* remove_task ( AVTask **  prev,
AVTask t 
)
static

Definition at line 61 of file executor.c.

Referenced by run_one_task().

◆ add_task()

static void add_task ( AVTask **  prev,
AVTask t 
)
static

Definition at line 68 of file executor.c.

Referenced by av_executor_execute().

◆ run_one_task()

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

Definition at line 74 of file executor.c.

Referenced by av_executor_execute().

◆ executor_free()

static void executor_free ( AVExecutor e,
const int  has_lock,
const int  has_cond 
)
static

Definition at line 112 of file executor.c.

Referenced by av_executor_alloc(), and av_executor_free().

◆ av_executor_alloc()

AVExecutor* av_executor_alloc ( const AVTaskCallbacks callbacks,
int  thread_count 
)

Alloc executor.

Parameters
callbackscallback structure for executor
thread_countworker thread number
Returns
return the executor

Definition at line 135 of file executor.c.

◆ av_executor_free()

void av_executor_free ( AVExecutor **  e)

Free executor.

Parameters
epointer to executor

Definition at line 174 of file executor.c.

◆ av_executor_execute()

void av_executor_execute ( AVExecutor e,
AVTask t 
)

Add task to executor.

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

Definition at line 182 of file executor.c.