FFmpeg
Data Structures | Macros | Functions | Variables
avf_showspatial.c File Reference
#include <float.h>
#include <math.h>
#include "libavutil/tx.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "audio.h"
#include "video.h"
#include "avfilter.h"
#include "filters.h"
#include "internal.h"
#include "window_func.h"

Go to the source code of this file.

Data Structures

struct  ShowSpatialContext
 

Macros

#define OFFSET(x)   offsetof(ShowSpatialContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define RE(y, ch)   s->fft_data[ch][y].re
 
#define IM(y, ch)   s->fft_data[ch][y].im
 

Functions

 AVFILTER_DEFINE_CLASS (showspatial)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int run_channel_fft (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_output (AVFilterLink *outlink)
 
static void draw_dot (uint8_t *dst, int linesize, int value)
 
static int draw_spatial (AVFilterLink *inlink, AVFrame *insamples)
 
static int spatial_activate (AVFilterContext *ctx)
 

Variables

static const AVOption showspatial_options []
 
static const AVFilterPad showspatial_inputs []
 
static const AVFilterPad showspatial_outputs []
 
const AVFilter ff_avf_showspatial
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 55 of file avf_showspatial.c.

◆ FLAGS

Definition at line 56 of file avf_showspatial.c.

◆ RE

#define RE (   y,
  ch 
)    s->fft_data[ch][y].re

Definition at line 192 of file avf_showspatial.c.

◆ IM

#define IM (   y,
  ch 
)    s->fft_data[ch][y].im

Definition at line 193 of file avf_showspatial.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( showspatial  )

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 70 of file avf_showspatial.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 84 of file avf_showspatial.c.

◆ run_channel_fft()

static int run_channel_fft ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 111 of file avf_showspatial.c.

Referenced by spatial_activate().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 129 of file avf_showspatial.c.

◆ draw_dot()

static void draw_dot ( uint8_t *  dst,
int  linesize,
int  value 
)
static

Definition at line 195 of file avf_showspatial.c.

Referenced by draw_spatial().

◆ draw_spatial()

static int draw_spatial ( AVFilterLink inlink,
AVFrame insamples 
)
static

Definition at line 204 of file avf_showspatial.c.

Referenced by spatial_activate().

◆ spatial_activate()

static int spatial_activate ( AVFilterContext ctx)
static

Definition at line 255 of file avf_showspatial.c.

Variable Documentation

◆ showspatial_options

const AVOption showspatial_options[]
static
Initial value:
= {
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "512x512"}, 0, 0, FLAGS },
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "512x512"}, 0, 0, FLAGS },
{ "win_size", "set window size", OFFSET(win_size), AV_OPT_TYPE_INT, {.i64 = 4096}, 1024, 65536, FLAGS },
WIN_FUNC_OPTION("win_func", OFFSET(win_func), FLAGS, WFUNC_HANNING),
{ "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 },
{ NULL }
}

Definition at line 58 of file avf_showspatial.c.

◆ showspatial_inputs

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

Definition at line 318 of file avf_showspatial.c.

◆ showspatial_outputs

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

Definition at line 325 of file avf_showspatial.c.

◆ ff_avf_showspatial

const AVFilter ff_avf_showspatial
Initial value:
= {
.name = "showspatial",
.description = NULL_IF_CONFIG_SMALL("Convert input audio to a spatial video output."),
.uninit = uninit,
.priv_size = sizeof(ShowSpatialContext),
.activate = spatial_activate,
.priv_class = &showspatial_class,
}

Definition at line 333 of file avf_showspatial.c.

showspatial_outputs
static const AVFilterPad showspatial_outputs[]
Definition: avf_showspatial.c:325
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:238
spatial_activate
static int spatial_activate(AVFilterContext *ctx)
Definition: avf_showspatial.c:255
w
uint8_t w
Definition: llviddspenc.c:38
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
WIN_FUNC_OPTION
#define WIN_FUNC_OPTION(win_func_opt_name, win_func_offset, flag, default_window_func)
Definition: window_func.h:37
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: avf_showspatial.c:70
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FLAGS
#define FLAGS
Definition: avf_showspatial.c:56
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
OFFSET
#define OFFSET(x)
Definition: avf_showspatial.c:55
ShowSpatialContext
Definition: avf_showspatial.c:37
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:235
WFUNC_HANNING
@ WFUNC_HANNING
Definition: window_func.h:29
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: avf_showspatial.c:84
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
showspatial_inputs
static const AVFilterPad showspatial_inputs[]
Definition: avf_showspatial.c:318
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:127
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
config_output
static int config_output(AVFilterLink *outlink)
Definition: avf_showspatial.c:129