buffer sink
More...
Go to the source code of this file.
|
static void | cleanup_redundant_layouts (AVFilterContext *ctx) |
|
int attribute_align_arg | av_buffersink_get_frame (AVFilterContext *ctx, AVFrame *frame) |
| Get a frame with filtered data from sink and put it in frame. More...
|
|
static int | return_or_keep_frame (BufferSinkContext *buf, AVFrame *out, AVFrame *in, int flags) |
|
static int | get_frame_internal (AVFilterContext *ctx, AVFrame *frame, int flags, int samples) |
|
int attribute_align_arg | av_buffersink_get_frame_flags (AVFilterContext *ctx, AVFrame *frame, int flags) |
| Get a frame with filtered data from sink and put it in frame. More...
|
|
int attribute_align_arg | av_buffersink_get_samples (AVFilterContext *ctx, AVFrame *frame, int nb_samples) |
| Same as av_buffersink_get_frame(), but with the ability to specify the number of samples read. More...
|
|
AVBufferSinkParams * | av_buffersink_params_alloc (void) |
|
AVABufferSinkParams * | av_abuffersink_params_alloc (void) |
|
static av_cold int | common_init (AVFilterContext *ctx) |
|
static int | activate (AVFilterContext *ctx) |
|
void | av_buffersink_set_frame_size (AVFilterContext *ctx, unsigned frame_size) |
| Set the frame size for an audio buffer sink. More...
|
|
static int | vsink_query_formats (AVFilterContext *ctx) |
|
static int | asink_query_formats (AVFilterContext *ctx) |
|
| AVFILTER_DEFINE_CLASS (buffersink) |
|
| AVFILTER_DEFINE_CLASS (abuffersink) |
|
buffer sink
Definition in file buffersink.c.
#define FF_INTERNAL_FIELDS 1 |
#define MAKE_AVFILTERLINK_ACCESSOR |
( |
|
type, |
|
|
|
field |
|
) |
| |
Value:}
int(* activate)(AVFilterContext *ctx)
Filter activation function.
AVFilterLink ** inputs
array of pointers to input links
#define av_assert0(cond)
assert() equivalent, that is always enabled.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this field
static int activate(AVFilterContext *ctx)
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 For filters that do not use the this method is called when a frame is wanted on an output For a 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 or at least make progress towards producing a it should return
const AVFilter * filter
the AVFilter of which this is an instance
Definition at line 206 of file buffersink.c.
#define CHECK_LIST_SIZE |
( |
|
field | ) |
|
Value:if (buf->field ## _size %
sizeof(*buf->field)) {
\ "should be multiple of %d\n", \
buf->field ## _size, (
int)
sizeof(*buf->field));
\ }
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this field
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 For filters that do not use the this method is called when a frame is wanted on an output For a 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 or at least make progress towards producing a it should return
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
Definition at line 227 of file buffersink.c.
Referenced by asink_query_formats(), and vsink_query_formats().
AVBufferSinkParams* av_buffersink_params_alloc |
( |
void |
| ) |
|
AVABufferSinkParams* av_abuffersink_params_alloc |
( |
void |
| ) |
|
AVFILTER_DEFINE_CLASS |
( |
buffersink |
| ) |
|
AVFILTER_DEFINE_CLASS |
( |
abuffersink |
| ) |
|
Initial value:= {
}
offset must point to a pointer immediately followed by an int for the length
Definition at line 311 of file buffersink.c.
Initial value:= {
}
static const uint8_t channel_counts[7]
offset must point to a pointer immediately followed by an int for the length
static const uint16_t channel_layouts[7]
static enum AVSampleFormat sample_fmts[]
Definition at line 317 of file buffersink.c.
Initial value:= {
{
.name = "default",
},
}
Definition at line 330 of file buffersink.c.
Initial value:= {
.name = "buffersink",
.description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them available to the end of the filter graph."),
.priv_class = &buffersink_class,
}
static av_cold int init(AVCodecContext *avctx)
static int vsink_query_formats(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int activate(AVFilterContext *ctx)
static const AVFilterPad outputs[]
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 inputs
static int query_formats(AVFilterContext *ctx)
static av_cold int common_init(AVFilterContext *ctx)
static const AVFilterPad avfilter_vsink_buffer_inputs[]
Definition at line 338 of file buffersink.c.
Initial value:= {
{
.name = "default",
},
}
Definition at line 350 of file buffersink.c.
Initial value:= {
.name = "abuffersink",
.description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them available to the end of the filter graph."),
.priv_class = &abuffersink_class,
}
static av_cold int init(AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int activate(AVFilterContext *ctx)
static const AVFilterPad avfilter_asink_abuffer_inputs[]
static const AVFilterPad outputs[]
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 inputs
static int query_formats(AVFilterContext *ctx)
static av_cold int common_init(AVFilterContext *ctx)
static int asink_query_formats(AVFilterContext *ctx)
Definition at line 358 of file buffersink.c.