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 "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 R   AV_OPT_FLAG_RUNTIME_PARAM
 
#define FPI   0x8000
 

Functions

 AVFILTER_DEFINE_CLASS (avsynctest)
 
static av_cold int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static av_cold int aconfig_props (AVFilterLink *outlink)
 
static av_cold int config_props (AVFilterLink *outlink)
 
static int32_t sin32 (int32_t x, AVRational scale)
 
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 66 of file src_avsynctest.c.

◆ A

Definition at line 67 of file src_avsynctest.c.

◆ V

Definition at line 68 of file src_avsynctest.c.

◆ R

#define R   AV_OPT_FLAG_RUNTIME_PARAM

Definition at line 69 of file src_avsynctest.c.

◆ FPI

#define FPI   0x8000

Definition at line 172 of file src_avsynctest.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( avsynctest  )

◆ query_formats()

static av_cold int query_formats ( const AVFilterContext ctx,
AVFilterFormatsConfig **  cfg_in,
AVFilterFormatsConfig **  cfg_out 
)
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,
AVRational  scale 
)
static

Definition at line 174 of file src_avsynctest.c.

Referenced by audio_frame().

◆ audio_frame()

static int audio_frame ( AVFilterLink outlink)
static

Definition at line 204 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 247 of file src_avsynctest.c.

Referenced by video_frame().

◆ offset()

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

Definition at line 265 of file src_avsynctest.c.

Referenced by video_frame().

◆ video_frame()

static int video_frame ( AVFilterLink outlink)
static

Definition at line 270 of file src_avsynctest.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 361 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|R },
{"a", "set beep amplitude", OFFSET(amplitude), AV_OPT_TYPE_FLOAT, {.dbl=.7}, 0., 1., A|R },
{"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|R },
{"dl", "set flash delay", OFFSET(delay), AV_OPT_TYPE_INT, {.i64=0}, -30, 30, V|R },
{"cycle", "set delay cycle", OFFSET(cycle), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, V|R },
{"c", "set delay cycle", OFFSET(cycle), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, V|R },
{"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 386 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,
.process_command = ff_filter_process_command,
}

Definition at line 399 of file src_avsynctest.c.

avsynctest_outputs
static const AVFilterPad avsynctest_outputs[]
Definition: src_avsynctest.c:386
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition: opt.h:315
w
uint8_t w
Definition: llviddspenc.c:38
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Underlying C type is int64_t.
Definition: opt.h:319
duration
int64_t duration
Definition: movenc.c:65
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
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
query_formats
static av_cold int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: src_avsynctest.c:96
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition: opt.h:323
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition: opt.h:303
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:94
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:900
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition: opt.h:271
activate
static int activate(AVFilterContext *ctx)
Definition: src_avsynctest.c:361
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
V
#define V
Definition: src_avsynctest.c:68
AVSyncTestContext
Definition: src_avsynctest.c:38
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
A
#define A
Definition: src_avsynctest.c:67
R
#define R
Definition: src_avsynctest.c:69
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
OFFSET
#define OFFSET(x)
Definition: src_avsynctest.c:66
config_props
static av_cold int config_props(AVFilterLink *outlink)
Definition: src_avsynctest.c:145