ffmpeg_filter.c File Reference
Include dependency graph for ffmpeg_filter.c:

Go to the source code of this file.

Macros

#define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name)
 
#define AUTO_INSERT_FILTER(opt_name, filter_name, arg)
 
#define DESCRIBE_FILTER_LINK(f, inout, in)
 
#define AUTO_INSERT_FILTER_INPUT(opt_name, filter_name, arg)
 

Functions

enum AVPixelFormat choose_pixel_fmt (AVStream *st, AVCodec *codec, enum AVPixelFormat target)
 
void choose_sample_fmt (AVStream *st, AVCodec *codec)
 
static char * choose_pix_fmts (OutputStream *ost)
 
 DEF_CHOOSE_FORMAT (enum AVSampleFormat, sample_fmt, sample_fmts, AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME) DEF_CHOOSE_FORMAT(int
 
GET_SAMPLE_RATE_NAME DEF_CHOOSE_FORMAT (uint64_t, channel_layout, channel_layouts, 0, GET_CH_LAYOUT_NAME)
 
static void init_input_filter (FilterGraph *fg, AVFilterInOut *in)
 
static int configure_output_video_filter (FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
 
static int configure_output_audio_filter (FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
 
int configure_output_filter (FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
 
static int sub2video_prepare (InputStream *ist)
 
static int configure_input_video_filter (FilterGraph *fg, InputFilter *ifilter, AVFilterInOut *in)
 
static int configure_input_audio_filter (FilterGraph *fg, InputFilter *ifilter, AVFilterInOut *in)
 
static int configure_input_filter (FilterGraph *fg, InputFilter *ifilter, AVFilterInOut *in)
 
int configure_filtergraph (FilterGraph *fg)
 
int ist_in_filtergraph (FilterGraph *fg, InputStream *ist)
 

Variables

 sample_rate
 
 supported_samplerates
 

Macro Definition Documentation

#define AUTO_INSERT_FILTER (   opt_name,
  filter_name,
  arg 
)
Value:
do { \
AVFilterContext *filt_ctx; \
av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \
"similarly to -af " filter_name "=%s.\n", arg); \
\
avfilter_get_by_name(filter_name), \
filter_name, arg, NULL, fg->graph); \
if (ret < 0) \
\
ret = avfilter_link(last_filter, pad_idx, filt_ctx, 0); \
if (ret < 0) \
\
last_filter = filt_ctx; \
pad_idx = 0; \
} while (0)
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
Link two filters together.
Definition: avfilter.c:114
const char * arg
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
struct AVFilterContext AVFilterContext
Definition: avfilter.h:63
ret
Definition: avfilter.c:821
NULL
Definition: eval.c:55
int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx)
Create and add a filter instance into an existing graph.
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return
#define AV_LOG_INFO
Definition: log.h:156
AVFilter * avfilter_get_by_name(const char *name)
Get a filter definition matching the given name.
Definition: avfilter.c:391

Referenced by configure_output_audio_filter().

#define AUTO_INSERT_FILTER_INPUT (   opt_name,
  filter_name,
  arg 
)
Value:
do { \
AVFilterContext *filt_ctx; \
av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \
"similarly to -af " filter_name "=%s.\n", arg); \
snprintf(name, sizeof(name), "graph %d %s for input stream %d:%d", \
fg->index, filter_name, ist->file_index, ist->st->index); \
avfilter_get_by_name(filter_name), \
name, arg, NULL, fg->graph); \
if (ret < 0) \
\
ret = avfilter_link(filt_ctx, 0, first_filter, pad_idx); \
if (ret < 0) \
\
first_filter = filt_ctx; \
} while (0)
const char * name
Definition: avisynth_c.h:675
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
Link two filters together.
Definition: avfilter.c:114
const char * arg
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
struct AVFilterContext AVFilterContext
Definition: avfilter.h:63
static AVFilter * first_filter
Definition: avfilter.c:389
ret
Definition: avfilter.c:821
NULL
Definition: eval.c:55
int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx)
Create and add a filter instance into an existing graph.
#define snprintf
Definition: snprintf.h:34
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return
#define AV_LOG_INFO
Definition: log.h:156
AVFilter * avfilter_get_by_name(const char *name)
Get a filter definition matching the given name.
Definition: avfilter.c:391

Referenced by configure_input_audio_filter().

#define DEF_CHOOSE_FORMAT (   type,
  var,
  supported_list,
  none,
  get_name 
)
Value:
static char *choose_ ## var ## s(OutputStream *ost) \
{ \
if (ost->st->codec->var != none) { \
get_name(ost->st->codec->var); \
} else if (ost->enc && ost->enc->supported_list) { \
const type *p; \
int len; \
exit(1); \
for (p = ost->enc->supported_list; *p != none; p++) { \
get_name(*p); \
avio_printf(s, "%s|", name); \
} \
ret[len - 1] = 0; \
}
const char * name
Definition: avisynth_c.h:675
const char * s
Definition: avisynth_c.h:668
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
Definition: aviobuf.c:988
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
Definition: aviobuf.c:976
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
uint8_t
ret
Definition: avfilter.c:821
NULL
Definition: eval.c:55
char * av_strdup(const char *s)
Duplicate the string s.
Definition: mem.c:220
struct AVIOContext AVIOContext
Bytestream IO Context.
#define type
int len
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return
for(j=16;j >0;--j)
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2

Definition at line 137 of file ffmpeg_filter.c.

#define DESCRIBE_FILTER_LINK (   f,
  inout,
  in 
)
Value:
{ \
AVFilterContext *ctx = inout->filter_ctx; \
AVFilterPad *pads = in ? ctx->input_pads : ctx->output_pads; \
int nb_pads = in ? ctx->input_count : ctx->output_count; \
if (avio_open_dyn_buf(&pb) < 0) \
exit(1); \
avio_printf(pb, "%s", ctx->filter->name); \
if (nb_pads > 1) \
avio_printf(pb, ":%s", avfilter_pad_get_name(pads, inout->pad_idx));\
avio_w8(pb, 0); \
avio_close_dyn_buf(pb, &f->name); \
}
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
Definition: aviobuf.c:988
Sinusoidal phase f
About Git write you should know how to use GIT properly Luckily Git comes with excellent documentation git help man git shows you the available git< command > help man git< command > shows information about the subcommand< command > The most comprehensive manual is the website Git Reference visit they are quite exhaustive You do not need a special username or password All you need is to provide a ssh public key to the Git server admin What follows now is a basic introduction to Git and some FFmpeg specific guidelines Read it at least if you are granted commit privileges to the FFmpeg project you are expected to be familiar with these rules I if not You can get git from etc no matter how small Every one of them has been saved from looking like a fool by this many times It s very easy for stray debug output or cosmetic modifications to slip in
Definition: git-howto.txt:5
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
Definition: aviobuf.c:976
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
struct AVFilterContext AVFilterContext
Definition: avfilter.h:63
void avio_w8(AVIOContext *s, int b)
Definition: aviobuf.c:151
struct AVIOContext AVIOContext
Bytestream IO Context.
const char * avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx)
Get the name of an AVFilterPad.
Definition: avfilter.c:837
struct AVFilterPad AVFilterPad
Definition: avfilter.h:65
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2

Definition at line 466 of file ffmpeg_filter.c.

Referenced by configure_input_filter(), and configure_output_filter().

Function Documentation

static char* choose_pix_fmts ( OutputStream ost)
static

Definition at line 93 of file ffmpeg_filter.c.

Referenced by configure_output_video_filter().

enum AVPixelFormat choose_pixel_fmt ( AVStream st,
AVCodec codec,
enum AVPixelFormat  target 
)

Definition at line 38 of file ffmpeg_filter.c.

Referenced by choose_pix_fmts(), and read_ffserver_streams().

void choose_sample_fmt ( AVStream st,
AVCodec codec 
)

Definition at line 71 of file ffmpeg_filter.c.

Referenced by read_ffserver_streams().

int configure_filtergraph ( FilterGraph fg)
static int configure_input_audio_filter ( FilterGraph fg,
InputFilter ifilter,
AVFilterInOut in 
)
static

Definition at line 617 of file ffmpeg_filter.c.

Referenced by configure_input_filter().

static int configure_input_filter ( FilterGraph fg,
InputFilter ifilter,
AVFilterInOut in 
)
static

Definition at line 706 of file ffmpeg_filter.c.

Referenced by configure_filtergraph().

static int configure_input_video_filter ( FilterGraph fg,
InputFilter ifilter,
AVFilterInOut in 
)
static

Definition at line 531 of file ffmpeg_filter.c.

Referenced by configure_input_filter().

static int configure_output_audio_filter ( FilterGraph fg,
OutputFilter ofilter,
AVFilterInOut out 
)
static

Definition at line 360 of file ffmpeg_filter.c.

Referenced by configure_output_filter().

int configure_output_filter ( FilterGraph fg,
OutputFilter ofilter,
AVFilterInOut out 
)

Definition at line 483 of file ffmpeg_filter.c.

Referenced by configure_filtergraph(), and init_output_filter().

static int configure_output_video_filter ( FilterGraph fg,
OutputFilter ofilter,
AVFilterInOut out 
)
static

Definition at line 279 of file ffmpeg_filter.c.

Referenced by configure_output_filter().

DEF_CHOOSE_FORMAT ( enum  AVSampleFormat,
sample_fmt  ,
sample_fmts  ,
AV_SAMPLE_FMT_NONE  ,
GET_SAMPLE_FMT_NAME   
)
GET_SAMPLE_RATE_NAME DEF_CHOOSE_FORMAT ( uint64_t  ,
channel_layout  ,
channel_layouts  ,
,
GET_CH_LAYOUT_NAME   
)

Definition at line 172 of file ffmpeg_filter.c.

static void init_input_filter ( FilterGraph fg,
AVFilterInOut in 
)
static

Definition at line 206 of file ffmpeg_filter.c.

Referenced by configure_filtergraph().

int ist_in_filtergraph ( FilterGraph fg,
InputStream ist 
)

Definition at line 800 of file ffmpeg_filter.c.

Referenced by decode_audio(), and decode_video().

static int sub2video_prepare ( InputStream ist)
static

Definition at line 495 of file ffmpeg_filter.c.

Referenced by configure_input_video_filter().

Variable Documentation

supported_samplerates

Definition at line 169 of file ffmpeg_filter.c.

Referenced by print_codec().