libavfilter/vsrc_buffer.c File Reference

memory buffer source filter More...

#include "avfilter.h"
#include "internal.h"
#include "avcodec.h"
#include "buffersrc.h"
#include "vsrc_buffer.h"
#include "libavutil/fifo.h"
#include "libavutil/imgutils.h"

Go to the source code of this file.

Data Structures

struct  BufferSourceContext

Defines

#define CHECK_PARAM_CHANGE(s, c, width, height, format)

Functions

int av_vsrc_buffer_add_video_buffer_ref (AVFilterContext *buffer_filter, AVFilterBufferRef *picref, int flags)
 Add video buffer data in picref to buffer_src.
int av_buffersrc_buffer (AVFilterContext *s, AVFilterBufferRef *buf)
 Add a buffer to the filtergraph s.
unsigned av_vsrc_buffer_get_nb_failed_requests (AVFilterContext *buffer_src)
 Get the number of failed requests.
static av_cold int init (AVFilterContext *ctx, const char *args, void *opaque)
static av_cold void uninit (AVFilterContext *ctx)
static int query_formats (AVFilterContext *ctx)
static int config_props (AVFilterLink *link)
static int request_frame (AVFilterLink *link)
static int poll_frame (AVFilterLink *link)

Variables

AVFilter avfilter_vsrc_buffer


Detailed Description

memory buffer source filter

Definition in file vsrc_buffer.c.


Define Documentation

#define CHECK_PARAM_CHANGE ( s,
c,
width,
height,
format   ) 

Value:

if (c->w != width || c->h != height || c->pix_fmt != format) {\
        av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
        return AVERROR(EINVAL);\
    }

Definition at line 46 of file vsrc_buffer.c.


Function Documentation

int av_buffersrc_buffer ( AVFilterContext s,
AVFilterBufferRef buf 
)

Add a buffer to the filtergraph s.

Parameters:
buf buffer containing frame data to be passed down the filtergraph. This function will take ownership of buf, the user must not free it. A NULL buf signals EOF -- i.e. no more frames will be sent to this filter.

Definition at line 132 of file vsrc_buffer.c.

Referenced by transcode_video().

int av_vsrc_buffer_add_video_buffer_ref ( AVFilterContext buffer_src,
AVFilterBufferRef picref,
int  flags 
)

Add video buffer data in picref to buffer_src.

Parameters:
buffer_src pointer to a buffer source context
flags a combination of AV_VSRC_BUF_FLAG_* flags
Returns:
>= 0 in case of success, a negative AVERROR code in case of failure

Definition at line 52 of file vsrc_buffer.c.

unsigned av_vsrc_buffer_get_nb_failed_requests ( AVFilterContext buffer_src  ) 

Get the number of failed requests.

A failed request is when the request_frame method is called while no frame is present in the buffer. The number is reset when a frame is added.

Definition at line 184 of file vsrc_buffer.c.

static int config_props ( AVFilterLink link  )  [static]

Definition at line 240 of file vsrc_buffer.c.

static av_cold int init ( AVFilterContext ctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 189 of file vsrc_buffer.c.

static int poll_frame ( AVFilterLink link  )  [static]

Definition at line 273 of file vsrc_buffer.c.

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 231 of file vsrc_buffer.c.

static int request_frame ( AVFilterLink link  )  [static]

Definition at line 252 of file vsrc_buffer.c.

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 217 of file vsrc_buffer.c.


Variable Documentation

Initial value:

 {
    .name      = "buffer",
    .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them accessible to the filterchain."),
    .priv_size = sizeof(BufferSourceContext),
    .query_formats = query_formats,

    .init      = init,
    .uninit    = uninit,

    .inputs    = (const AVFilterPad[]) {{ .name = NULL }},
    .outputs   = (const AVFilterPad[]) {{ .name      = "default",
                                    .type            = AVMEDIA_TYPE_VIDEO,
                                    .request_frame   = request_frame,
                                    .poll_frame      = poll_frame,
                                    .config_props    = config_props, },
                                  { .name = NULL}},
}

Definition at line 282 of file vsrc_buffer.c.

Referenced by avfilter_register_all().


Generated on Fri Apr 27 19:21:19 2012 for FFmpeg by  doxygen 1.5.8