FFmpeg
Data Structures | Macros | Functions | Variables
vsrc_testsrc.c File Reference
#include "config_components.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/ffmath.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/xga_font_data.h"
#include "avfilter.h"
#include "drawutils.h"
#include "filters.h"
#include "formats.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  TestSourceContext
 

Macros

#define OFFSET(x)   offsetof(TestSourceContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define FLAGSR   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define SIZE_OPTIONS
 
#define COMMON_OPTIONS_NOSIZE
 
#define COMMON_OPTIONS   SIZE_OPTIONS COMMON_OPTIONS_NOSIZE
 
#define NOSIZE_OPTIONS_OFFSET   2
 

Functions

static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS_EXT (nullsrc_yuvtestsrc, "nullsrc/yuvtestsrc", options)
 
static void av_unused set_color (TestSourceContext *s, FFDrawColor *color, uint32_t argb)
 
 AVFILTER_DEFINE_CLASS_EXT (allyuv_allrgb, "allyuv/allrgb", &options[NOSIZE_OPTIONS_OFFSET])
 

Variables

static const AVOption options []
 
static const AVFilterPad outputs []
 

Detailed Description

Misc test sources.

testsrc is based on the test pattern generator demuxer by Nicolas George: http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2007-October/037845.html

rgbtestsrc is ported from MPlayer libmpcodecs/vf_rgbtest.c by Michael Niedermayer.

allyuv, smptebars and smptehdbars are by Paul B Mahol.

Definition in file vsrc_testsrc.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 103 of file vsrc_testsrc.c.

◆ FLAGS

Definition at line 104 of file vsrc_testsrc.c.

◆ FLAGSR

Definition at line 105 of file vsrc_testsrc.c.

◆ SIZE_OPTIONS

#define SIZE_OPTIONS
Value:
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS },\
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS },\

Definition at line 107 of file vsrc_testsrc.c.

◆ COMMON_OPTIONS_NOSIZE

#define COMMON_OPTIONS_NOSIZE
Value:
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, FLAGS },\
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, FLAGS },\
{ "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },\
{ "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },\
{ "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX, FLAGS },

Definition at line 111 of file vsrc_testsrc.c.

◆ COMMON_OPTIONS

#define COMMON_OPTIONS   SIZE_OPTIONS COMMON_OPTIONS_NOSIZE

Definition at line 118 of file vsrc_testsrc.c.

◆ NOSIZE_OPTIONS_OFFSET

#define NOSIZE_OPTIONS_OFFSET   2

Definition at line 120 of file vsrc_testsrc.c.

Function Documentation

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 128 of file vsrc_testsrc.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 143 of file vsrc_testsrc.c.

◆ config_props()

static int config_props ( AVFilterLink outlink)
static

Definition at line 151 of file vsrc_testsrc.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 173 of file vsrc_testsrc.c.

◆ AVFILTER_DEFINE_CLASS_EXT() [1/2]

AVFILTER_DEFINE_CLASS_EXT ( nullsrc_yuvtestsrc  ,
"nullsrc/yuvtestsrc"  ,
options   
)

◆ set_color()

static void av_unused set_color ( TestSourceContext s,
FFDrawColor color,
uint32_t  argb 
)
static

Definition at line 704 of file vsrc_testsrc.c.

◆ AVFILTER_DEFINE_CLASS_EXT() [2/2]

AVFILTER_DEFINE_CLASS_EXT ( allyuv_allrgb  ,
"allyuv/allrgb"  ,
options[NOSIZE_OPTIONS_OFFSET] 
)

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ NULL }
}

Definition at line 123 of file vsrc_testsrc.c.

◆ outputs

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
},
}

Definition at line 165 of file vsrc_testsrc.c.

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
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Underlying C type is AVRational.
Definition: opt.h:280
duration
int64_t duration
Definition: movenc.c:65
FLAGS
#define FLAGS
Definition: vsrc_testsrc.c:104
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition: opt.h:303
config_props
static int config_props(AVFilterLink *outlink)
Definition: vsrc_testsrc.c:151
COMMON_OPTIONS
#define COMMON_OPTIONS
Definition: vsrc_testsrc.c:118
OFFSET
#define OFFSET(x)
Definition: vsrc_testsrc.c:103
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201