FFmpeg
Data Structures | Macros | Functions
api-threadmessage-test.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/frame.h"
#include "libavutil/threadmessage.h"
#include "libavutil/thread.h"

Go to the source code of this file.

Data Structures

struct  sender_data
 Thread message API test. More...
 
struct  receiver_data
 
struct  message
 

Macros

#define MAGIC   0xdeadc0de
 
#define SPAWN_THREADS(type)
 
#define WAIT_THREADS(type)
 

Functions

static void free_frame (void *arg)
 
static voidsender_thread (void *arg)
 
static voidreceiver_thread (void *arg)
 
static int get_workload (int minv, int maxv)
 
int main (int ac, char **av)
 

Macro Definition Documentation

#define MAGIC   0xdeadc0de

Definition at line 53 of file api-threadmessage-test.c.

Referenced by free_frame(), receiver_thread(), and sender_thread().

#define SPAWN_THREADS (   type)
Value:
do { \
for (i = 0; i < nb_##type##s; i++) { \
struct type##_data *td = &type##s[i]; \
\
td->id = i; \
td->queue = queue; \
td->workload = get_workload(type##_min_load, type##_max_load); \
\
ret = pthread_create(&td->tid, NULL, type##_thread, td); \
if (ret) { \
const int err = AVERROR(ret); \
av_log(NULL, AV_LOG_ERROR, "Unable to start " AV_STRINGIFY(type) \
" thread: %s\n", av_err2str(err)); \
goto end; \
} \
} \
} while (0)
#define NULL
Definition: coverity.c:32
static int get_workload(int minv, int maxv)
GLint GLenum type
Definition: opengl_enc.c:104
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:194
#define td
Definition: regdef.h:70
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Definition: error.h:119
#define s(width, name)
Definition: cbs_vp9.c:257
if(ret)
static av_always_inline int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
Definition: os2threads.h:80
#define AV_STRINGIFY(s)
Definition: macros.h:36
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
for(j=16;j >0;--j)
int i
Definition: input.c:407

Referenced by main().

#define WAIT_THREADS (   type)
Value:
do { \
for (i = 0; i < nb_##type##s; i++) { \
struct type##_data *td = &type##s[i]; \
\
ret = pthread_join(td->tid, NULL); \
if (ret) { \
const int err = AVERROR(ret); \
av_log(NULL, AV_LOG_ERROR, "Unable to join " AV_STRINGIFY(type) \
" thread: %s\n", av_err2str(err)); \
goto end; \
} \
} \
} while (0)
#define NULL
Definition: coverity.c:32
GLint GLenum type
Definition: opengl_enc.c:104
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:194
#define td
Definition: regdef.h:70
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Definition: error.h:119
static av_always_inline int pthread_join(pthread_t thread, void **value_ptr)
Definition: os2threads.h:94
#define s(width, name)
Definition: cbs_vp9.c:257
if(ret)
#define AV_STRINGIFY(s)
Definition: macros.h:36
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
for(j=16;j >0;--j)
int i
Definition: input.c:407

Referenced by main().

Function Documentation

static void free_frame ( void arg)
static

Definition at line 55 of file api-threadmessage-test.c.

Referenced by main().

static void* sender_thread ( void arg)
static

Definition at line 62 of file api-threadmessage-test.c.

static void* receiver_thread ( void arg)
static

Definition at line 126 of file api-threadmessage-test.c.

static int get_workload ( int  minv,
int  maxv 
)
static

Definition at line 159 of file api-threadmessage-test.c.

int main ( int  ac,
char **  av 
)

Definition at line 164 of file api-threadmessage-test.c.