39 #define CHECK_PARAM_CHANGE(s, c, width, height, format)\
40 if (c->w != width || c->h != height || c->pix_fmt != format) {\
41 av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
42 return AVERROR(EINVAL);\
52 "Buffering several frames is not supported. "
53 "Please consume all available frames before adding a new one.\n"
78 "Buffering several frames is not supported. "
79 "Please consume all available frames before adding a new one.\n"
94 char pix_fmt_str[128];
98 (n = sscanf(args,
"%d:%d:%127[^:]:%d:%d:%d:%d", &c->
w, &c->
h, pix_fmt_str,
106 c->
pix_fmt = strtol(pix_fmt_str, &tail, 10);
152 "request_frame() called with no available frame!\n");
173 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them accessible to the filterchain."),
AVFilter avfilter_vsrc_buffer
static int config_props(AVFilterLink *link)
AVFilterBufferRef * avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Request a picture buffer with a specific set of permissions.
AVFilterBufferRefVideoProps * video
video buffer specific properties
int linesize[8]
number of bytes per line
Memory buffer source API.
int h
agreed upon image height
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
static const AVRational pixel_aspect[17]
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static int request_frame(AVFilterLink *link)
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
AVRational pixel_aspect
pixel aspect ratio
int64_t pts
presentation timestamp.
int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
Add a buffer to the filtergraph s.
A filter pad used for either input or output.
int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
Copy the frame properties of src to dst, without copying the actual image data.
A link between two filters.
int width
width and height of the video frame
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
void av_log(void *avcl, int level, const char *fmt,...)
AVFilterFormats * avfilter_make_format_list(const int *fmts)
Create a list of supported formats.
AVRational time_base
time_base to set in the output link
const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB]
The array of all the pixel format descriptors.
int w
agreed upon image width
static int poll_frame(AVFilterLink *link)
static int query_formats(AVFilterContext *ctx)
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], enum PixelFormat pix_fmt, int width, int height)
Copy image in src_data to dst_data.
AVFilterContext * src
source filter
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Send a slice to the next filter.
void avfilter_unref_buffer(AVFilterBufferRef *ref)
Remove a reference to a buffer.
int format
format of the frame, -1 if unknown or unset Values correspond to enum PixelFormat for video frames...
A reference to an AVFilterBuffer.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVFilterBufferRef * avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
Add a new reference to a buffer.
rational number numerator/denominator
void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
Notify the next filter of the start of a frame.
const char * name
filter name
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
#define CHECK_PARAM_CHANGE(s, c, width, height, format)
AVFilterLink ** outputs
array of pointers to output links
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static av_cold void uninit(AVFilterContext *ctx)
memory buffer source API for video
#define AV_PERM_WRITE
can write to the buffer
uint8_t * data[8]
picture/audio data for each plane
int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect)
enum PixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.