FFmpeg
Data Structures | Macros | Functions | Variables
src_avsynctest.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/channel_layout.h"
#include "libavutil/ffmath.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/parseutils.h"
#include "libavutil/timestamp.h"
#include "libavutil/xga_font_data.h"
#include "avfilter.h"
#include "drawutils.h"
#include "filters.h"
#include "formats.h"
#include "internal.h"
#include "audio.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  AVSyncTestContext
 

Macros

#define OFFSET(x)   offsetof(AVSyncTestContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define V   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define FPI   0x8000
 

Functions

 AVFILTER_DEFINE_CLASS (avsynctest)
 
static av_cold int query_formats (AVFilterContext *ctx)
 
static av_cold int aconfig_props (AVFilterLink *outlink)
 
static av_cold int config_props (AVFilterLink *outlink)
 
static int32_t sin32 (int32_t x, int shift)
 
static int audio_frame (AVFilterLink *outlink)
 
static void draw_text (FFDrawContext *draw, AVFrame *out, FFDrawColor *color, int x0, int y0, const uint8_t *text)
 
static int offset (int x, int num, int den)
 
static int video_frame (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 

Variables

static const AVOption avsynctest_options []
 
static const AVFilterPad avsynctest_outputs []
 
const AVFilter ff_avsrc_avsynctest
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(AVSyncTestContext, x)

Definition at line 67 of file src_avsynctest.c.

◆ A

Definition at line 68 of file src_avsynctest.c.

◆ V

Definition at line 69 of file src_avsynctest.c.

◆ FPI

#define FPI   0x8000

Definition at line 171 of file src_avsynctest.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( avsynctest  )

◆ query_formats()

static av_cold int query_formats ( AVFilterContext ctx)
static

Definition at line 96 of file src_avsynctest.c.

◆ aconfig_props()

static av_cold int aconfig_props ( AVFilterLink outlink)
static

Definition at line 131 of file src_avsynctest.c.

◆ config_props()

static av_cold int config_props ( AVFilterLink outlink)
static

Definition at line 145 of file src_avsynctest.c.

◆ sin32()

static int32_t sin32 ( int32_t  x,
int  shift 
)
static

Definition at line 173 of file src_avsynctest.c.

Referenced by audio_frame().

◆ audio_frame()

static int audio_frame ( AVFilterLink outlink)
static

Definition at line 202 of file src_avsynctest.c.

Referenced by activate().

◆ draw_text()

static void draw_text ( FFDrawContext draw,
AVFrame out,
FFDrawColor color,
int  x0,
int  y0,
const uint8_t *  text 
)
static

Definition at line 245 of file src_avsynctest.c.

Referenced by video_frame().

◆ offset()

static int offset ( int  x,
int  num,
int  den 
)
static

Definition at line 263 of file src_avsynctest.c.

Referenced by video_frame().

◆ video_frame()

static int video_frame ( AVFilterLink outlink)
static

Definition at line 268 of file src_avsynctest.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 355 of file src_avsynctest.c.

Variable Documentation

◆ avsynctest_options

const AVOption avsynctest_options[]
static
Initial value:
= {
{"size", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, V },
{"s", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, V },
{"framerate", "set frame rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="30"}, 0,INT_MAX, V },
{"fr", "set frame rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="30"}, 0,INT_MAX, V },
{"samplerate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100},8000,384000, A },
{"sr", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100},8000,384000, A },
{"amplitude", "set beep amplitude", OFFSET(amplitude), AV_OPT_TYPE_FLOAT, {.dbl=.7}, 0., 1., A },
{"a", "set beep amplitude", OFFSET(amplitude), AV_OPT_TYPE_FLOAT, {.dbl=.7}, 0., 1., A },
{"period", "set beep period", OFFSET(period), AV_OPT_TYPE_INT, {.i64=3}, 1, 99., A },
{"p", "set beep period", OFFSET(period), AV_OPT_TYPE_INT, {.i64=3}, 1, 99., A },
{"delay", "set flash delay", OFFSET(delay), AV_OPT_TYPE_INT, {.i64=0}, -30, 30, V },
{"dl", "set flash delay", OFFSET(delay), AV_OPT_TYPE_INT, {.i64=0}, -30, 30, V },
{"cycle", "set delay cycle", OFFSET(cycle), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, V },
{"c", "set delay cycle", OFFSET(cycle), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, V },
{"duration", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, V|A },
{"d", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, V|A },
{"fg", "set foreground color", OFFSET(rgba[0]), AV_OPT_TYPE_COLOR, {.str="white"}, 0, 0, V },
{"bg", "set background color", OFFSET(rgba[1]), AV_OPT_TYPE_COLOR, {.str="black"}, 0, 0, V },
{"ag", "set additional color", OFFSET(rgba[2]), AV_OPT_TYPE_COLOR, {.str="gray"}, 0, 0, V },
{NULL},
}

Definition at line 71 of file src_avsynctest.c.

◆ avsynctest_outputs

const AVFilterPad avsynctest_outputs[]
static
Initial value:
= {
{
.name = "audio",
.config_props = aconfig_props,
},
{
.name = "video",
.config_props = config_props,
},
}

Definition at line 380 of file src_avsynctest.c.

◆ ff_avsrc_avsynctest

const AVFilter ff_avsrc_avsynctest
Initial value:
= {
.name = "avsynctest",
.description = NULL_IF_CONFIG_SMALL("Generate an Audio Video Sync Test."),
.priv_size = sizeof(AVSyncTestContext),
.priv_class = &avsynctest_class,
}

Definition at line 393 of file src_avsynctest.c.

avsynctest_outputs
static const AVFilterPad avsynctest_outputs[]
Definition: src_avsynctest.c:380
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:238
w
uint8_t w
Definition: llviddspenc.c:38
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:239
sample_rate
sample_rate
Definition: ffmpeg_filter.c:153
duration
int64_t duration
Definition: movenc.c:64
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
query_formats
static av_cold int query_formats(AVFilterContext *ctx)
Definition: src_avsynctest.c:96
NULL
#define NULL
Definition: coverity.c:32
period
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without period
Definition: writing_filters.txt:89
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Definition: opt.h:240
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:235
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
aconfig_props
static av_cold int aconfig_props(AVFilterLink *outlink)
Definition: src_avsynctest.c:131
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
activate
static int activate(AVFilterContext *ctx)
Definition: src_avsynctest.c:355
V
#define V
Definition: src_avsynctest.c:69
AVSyncTestContext
Definition: src_avsynctest.c:39
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
A
#define A
Definition: src_avsynctest.c:68
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
OFFSET
#define OFFSET(x)
Definition: src_avsynctest.c:67
config_props
static av_cold int config_props(AVFilterLink *outlink)
Definition: src_avsynctest.c:145