MLT  7.22.0
Public Member Functions | Data Fields | Private Member Functions
mlt_slices_s Struct Reference

Public Member Functions

int mlt_slices_count_fifo ()
 Get the number of slices for the fifo scheduling policy. More...
 
int mlt_slices_count_normal ()
 Get the number of slices for the normal scheduling policy. More...
 
int mlt_slices_count_rr ()
 Get the number of slices for the round robin scheduling policy. More...
 
int mlt_slices_size_slice (int jobs, int index, int input_size, int *start)
 Compute size of a slice. More...
 

Data Fields

pthread_mutex_t cond_mutex
 
pthread_cond_t cond_var_job
 
pthread_cond_t cond_var_ready
 
int count
 
int f_exit
 
struct mlt_slices_runtime_shead
 
const char * name
 
int readys
 
int ref
 
struct mlt_slices_runtime_stail
 
pthread_t threads [MAX_SLICES]
 

Private Member Functions

static void mlt_slices_close (mlt_slices ctx)
 Destroy sliced threading context. More...
 
static mlt_slices mlt_slices_get_global (mlt_schedule_policy policy)
 Get a global shared sliced threading context. More...
 
static mlt_slices mlt_slices_init (int threads, int policy, int priority)
 Initialize a sliced threading context. More...
 
static void mlt_slices_run (mlt_slices ctx, int jobs, mlt_slices_proc proc, void *cookie)
 Run sliced execution. More...
 

Member Function Documentation

◆ mlt_slices_close()

static void mlt_slices_close ( mlt_slices  ctx)
private

Destroy sliced threading context.

Parameters
ctxcontext pointer

◆ mlt_slices_count_fifo()

int mlt_slices_count_fifo ( )

Get the number of slices for the fifo scheduling policy.

Returns
the number of slices

◆ mlt_slices_count_normal()

int mlt_slices_count_normal ( )

Get the number of slices for the normal scheduling policy.

Returns
the number of slices

◆ mlt_slices_count_rr()

int mlt_slices_count_rr ( )

Get the number of slices for the round robin scheduling policy.

Returns
the number of slices

◆ mlt_slices_get_global()

static mlt_slices mlt_slices_get_global ( mlt_schedule_policy  policy)
private

Get a global shared sliced threading context.

There are separate contexts for each scheduling policy.

Parameters
policythe thread scheduling policy needed
Returns
the context pointer

◆ mlt_slices_init()

static mlt_slices mlt_slices_init ( int  threads,
int  policy,
int  priority 
)
private

Initialize a sliced threading context.

Parameters
threadsnumber of threads to use for job list, 0 for #cpus
policyscheduling policy of processing threads, -1 for normal
prioritypriority value that can be used with the scheduling algorithm, -1 for maximum
Returns
the context pointer

◆ mlt_slices_run()

static void mlt_slices_run ( mlt_slices  ctx,
int  jobs,
mlt_slices_proc  proc,
void *  cookie 
)
private

Run sliced execution.

Parameters
ctxcontext pointer
jobsnumber of jobs to process
proca pointer to the function that will be called
cookiean opaque data pointer passed to proc

◆ mlt_slices_size_slice()

int mlt_slices_size_slice ( int  jobs,
int  index,
int  input_size,
int *  start 
)

Compute size of a slice.

This a helper function for use in a mlt_slices_proc() to get the number of pixels over which to operate.

Parameters
jobsthe number of slices
indexthe zero-based index of the current slice
input_sizethe size of a dimension, usually in pixel units, for example height
[out]startthe optional starting unit for this slice
Returns
the size of the slice, typically in pixel units

Field Documentation

◆ cond_mutex

pthread_mutex_t mlt_slices_s::cond_mutex

◆ cond_var_job

pthread_cond_t mlt_slices_s::cond_var_job

◆ cond_var_ready

pthread_cond_t mlt_slices_s::cond_var_ready

◆ count

int mlt_slices_s::count

◆ f_exit

int mlt_slices_s::f_exit

◆ head

struct mlt_slices_runtime_s* mlt_slices_s::head

◆ name

const char* mlt_slices_s::name

◆ readys

int mlt_slices_s::readys

◆ ref

int mlt_slices_s::ref

◆ tail

struct mlt_slices_runtime_s * mlt_slices_s::tail

◆ threads

pthread_t mlt_slices_s::threads[MAX_SLICES]

The documentation for this struct was generated from the following file: