FFmpeg
Data Structures | Macros | Functions | Variables
avf_a3dscope.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "audio.h"
#include "video.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  Audio3dScopeContext
 

Macros

#define OFFSET(x)   offsetof(Audio3dScopeContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define TFLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (a3dscope)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static void projection_matrix (float fov, float a, float near, float far, float matrix[4][4])
 
static void vmultiply (const float v[4], const float m[4][4], float d[4])
 
static void mmultiply (const float m2[4][4], const float m1[4][4], float m[4][4])
 
static float vdot (const float x[3], const float y[3])
 
static void view_matrix (const float eye[3], const float z[3], const float roll, const float pitch, const float yaw, float m[4][4])
 
static void draw_dot (AVFrame *out, unsigned x, unsigned y, float z, int r, int g, int b)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption a3dscope_options []
 
static const AVFilterPad audio3dscope_inputs []
 
static const AVFilterPad audio3dscope_outputs []
 
const AVFilter ff_avf_a3dscope
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 52 of file avf_a3dscope.c.

◆ FLAGS

Definition at line 53 of file avf_a3dscope.c.

◆ TFLAGS

Definition at line 54 of file avf_a3dscope.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( a3dscope  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 77 of file avf_a3dscope.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 106 of file avf_a3dscope.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 116 of file avf_a3dscope.c.

◆ projection_matrix()

static void projection_matrix ( float  fov,
float  a,
float  near,
float  far,
float  matrix[4][4] 
)
static

Definition at line 129 of file avf_a3dscope.c.

Referenced by filter_frame().

◆ vmultiply()

static void vmultiply ( const float  v[4],
const float  m[4][4],
float  d[4] 
)
inlinestatic

Definition at line 144 of file avf_a3dscope.c.

Referenced by filter_frame(), and mmultiply().

◆ mmultiply()

static void mmultiply ( const float  m2[4][4],
const float  m1[4][4],
float  m[4][4] 
)
static

Definition at line 152 of file avf_a3dscope.c.

Referenced by filter_frame(), and view_matrix().

◆ vdot()

static float vdot ( const float  x[3],
const float  y[3] 
)
static

Definition at line 160 of file avf_a3dscope.c.

Referenced by view_matrix().

◆ view_matrix()

static void view_matrix ( const float  eye[3],
const float  z[3],
const float  roll,
const float  pitch,
const float  yaw,
float  m[4][4] 
)
static

Definition at line 165 of file avf_a3dscope.c.

Referenced by filter_frame().

◆ draw_dot()

static void draw_dot ( AVFrame out,
unsigned  x,
unsigned  y,
float  z,
int  r,
int  g,
int  b 
)
static

Definition at line 209 of file avf_a3dscope.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 222 of file avf_a3dscope.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 296 of file avf_a3dscope.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 323 of file avf_a3dscope.c.

Variable Documentation

◆ a3dscope_options

const AVOption a3dscope_options[]
static
Initial 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 },
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, FLAGS },
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, FLAGS },
{ "fov", "set camera FoV", OFFSET(fov), AV_OPT_TYPE_FLOAT, {.dbl=90.f}, 40, 150, TFLAGS },
{ "roll", "set camera roll",OFFSET(roll), AV_OPT_TYPE_FLOAT, {.dbl=0.f}, -180, 180, TFLAGS },
{ "pitch","set camera pitch",OFFSET(pitch), AV_OPT_TYPE_FLOAT, {.dbl=0.f}, -180, 180, TFLAGS },
{ "yaw", "set camera yaw", OFFSET(yaw), AV_OPT_TYPE_FLOAT, {.dbl=0.f}, -180, 180, TFLAGS },
{ "xzoom","set camera zoom", OFFSET(zoom[0]),AV_OPT_TYPE_FLOAT, {.dbl=1.f}, 0.01, 10, TFLAGS },
{ "yzoom","set camera zoom", OFFSET(zoom[1]),AV_OPT_TYPE_FLOAT, {.dbl=1.f}, 0.01, 10, TFLAGS },
{ "zzoom","set camera zoom", OFFSET(zoom[2]),AV_OPT_TYPE_FLOAT, {.dbl=1.f}, 0.01, 10, TFLAGS },
{ "xpos", "set camera position", OFFSET(eye[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.f},-60.f, 60.f, TFLAGS },
{ "ypos", "set camera position", OFFSET(eye[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.f},-60.f, 60.f, TFLAGS },
{ "zpos", "set camera position", OFFSET(eye[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.f},-60.f, 60.f, TFLAGS },
{ "length","set length", OFFSET(size), AV_OPT_TYPE_INT, {.i64=15}, 1, 60, FLAGS },
{ NULL }
}

Definition at line 56 of file avf_a3dscope.c.

◆ audio3dscope_inputs

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

Definition at line 331 of file avf_a3dscope.c.

◆ audio3dscope_outputs

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

Definition at line 339 of file avf_a3dscope.c.

◆ ff_avf_a3dscope

const AVFilter ff_avf_a3dscope
Initial value:
= {
.name = "a3dscope",
.description = NULL_IF_CONFIG_SMALL("Convert input audio to 3d scope video output."),
.uninit = uninit,
.priv_size = sizeof(Audio3dScopeContext),
.priv_class = &a3dscope_class,
.process_command = ff_filter_process_command,
}

Definition at line 347 of file avf_a3dscope.c.

uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: avf_a3dscope.c:323
audio3dscope_inputs
static const AVFilterPad audio3dscope_inputs[]
Definition: avf_a3dscope.c:331
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:238
zoom
static void zoom(float *u, float *v, float amount)
Definition: vf_xfade.c:1633
w
uint8_t w
Definition: llviddspenc.c:38
audio3dscope_outputs
static const AVFilterPad audio3dscope_outputs[]
Definition: avf_a3dscope.c:339
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: avf_a3dscope.c:77
config_input
static int config_input(AVFilterLink *inlink)
Definition: avf_a3dscope.c:106
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
config_output
static int config_output(AVFilterLink *outlink)
Definition: avf_a3dscope.c:116
TFLAGS
#define TFLAGS
Definition: avf_a3dscope.c:54
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:235
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:115
size
int size
Definition: twinvq_data.h:10344
FLAGS
#define FLAGS
Definition: avf_a3dscope.c:53
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:858
OFFSET
#define OFFSET(x)
Definition: avf_a3dscope.c:52
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
Audio3dScopeContext
Definition: avf_a3dscope.c:32
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
activate
static int activate(AVFilterContext *ctx)
Definition: avf_a3dscope.c:296