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"

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 (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
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 51 of file avf_a3dscope.c.

◆ FLAGS

Definition at line 52 of file avf_a3dscope.c.

◆ TFLAGS

Definition at line 53 of file avf_a3dscope.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( a3dscope  )

◆ query_formats()

static int query_formats ( const AVFilterContext ctx,
AVFilterFormatsConfig **  cfg_in,
AVFilterFormatsConfig **  cfg_out 
)
static

Definition at line 76 of file avf_a3dscope.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 96 of file avf_a3dscope.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 106 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 120 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 135 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 143 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 151 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 156 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 200 of file avf_a3dscope.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 213 of file avf_a3dscope.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 287 of file avf_a3dscope.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 314 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 55 of file avf_a3dscope.c.

◆ audio3dscope_inputs

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

Definition at line 322 of file avf_a3dscope.c.

◆ audio3dscope_outputs

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

Definition at line 330 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 338 of file avf_a3dscope.c.

query_formats
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: avf_a3dscope.c:76
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: avf_a3dscope.c:314
audio3dscope_inputs
static const AVFilterPad audio3dscope_inputs[]
Definition: avf_a3dscope.c:322
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition: opt.h:315
zoom
static void zoom(float *u, float *v, float amount)
Definition: vf_xfade.c:1695
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
w
uint8_t w
Definition: llviddspenc.c:38
audio3dscope_outputs
static const AVFilterPad audio3dscope_outputs[]
Definition: avf_a3dscope.c:330
config_input
static int config_input(AVFilterLink *inlink)
Definition: avf_a3dscope.c:96
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
config_output
static int config_output(AVFilterLink *outlink)
Definition: avf_a3dscope.c:106
TFLAGS
#define TFLAGS
Definition: avf_a3dscope.c:53
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition: opt.h:303
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
size
int size
Definition: twinvq_data.h:10344
FLAGS
#define FLAGS
Definition: avf_a3dscope.c:52
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
OFFSET
#define OFFSET(x)
Definition: avf_a3dscope.c:51
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition: opt.h:271
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
Audio3dScopeContext
Definition: avf_a3dscope.c:31
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
activate
static int activate(AVFilterContext *ctx)
Definition: avf_a3dscope.c:287