FFmpeg
Macros | Functions
avassert.h File Reference
#include <stdlib.h>
#include "avutil.h"
#include "log.h"

Go to the source code of this file.

Macros

#define av_assert0(cond)
 assert() equivalent, that is always enabled. More...
 
#define av_assert1(cond)   ((void)0)
 assert() equivalent, that does not lie in speed critical code. More...
 
#define av_assert2(cond)   ((void)0)
 assert() equivalent, that does lie in speed critical code. More...
 
#define av_assert2_fpu()   ((void)0)
 

Functions

void av_assert0_fpu (void)
 Assert that floating point operations can be executed. More...
 

Detailed Description

simple assert() macros that are a bit more flexible than ISO C assert().

Author
Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file avassert.h.

Macro Definition Documentation

◆ av_assert0

#define av_assert0 (   cond)
Value:
do { \
if (!(cond)) { \
av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
AV_STRINGIFY(cond), __FILE__, __LINE__); \
abort(); \
} \
} while (0)

assert() equivalent, that is always enabled.

Examples
muxing.c, and transcode_aac.c.

Definition at line 37 of file avassert.h.

◆ av_assert1

#define av_assert1 (   cond)    ((void)0)

assert() equivalent, that does not lie in speed critical code.

These asserts() thus can be enabled without fearing speed loss.

Definition at line 53 of file avassert.h.

◆ av_assert2

#define av_assert2 (   cond)    ((void)0)

assert() equivalent, that does lie in speed critical code.

Definition at line 64 of file avassert.h.

◆ av_assert2_fpu

#define av_assert2_fpu ( )    ((void)0)

Definition at line 65 of file avassert.h.

Function Documentation

◆ av_assert0_fpu()

void av_assert0_fpu ( void  )

Assert that floating point operations can be executed.

This will av_assert0() that the cpu is not in MMX state on X86

Definition at line 149 of file utils.c.

AV_LOG_PANIC
#define AV_LOG_PANIC
Something went really wrong and we will crash now.
Definition: log.h:167
NULL
#define NULL
Definition: coverity.c:32
AV_STRINGIFY
#define AV_STRINGIFY(s)
Definition: macros.h:66
cond
int(* cond)(enum AVPixelFormat pix_fmt)
Definition: pixdesc_query.c:28