History

Make avfilter_get_video_buffer() recursive.

When called on a link with a filter whose destination pad has not a get_video_buffer callback defined, it will call avfilter_get_video_buffer() on the first output link of the destination filer, rather than use avfilter_default_get_buffer(), so the video buffer can be allocated forward in the filterchain. Also add the w and h parameters to avfilter_get_video_buffer(), as the minimum width and height requested by each filter in the filterchain may change, this allows for example a memcpy-less pad filter. This change breaks API / ABI backward compatibility. See the thread: "[PATCH] Implement recusive avfilter_get_video_buffer()". Originally committed as revision 20272 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini committed 17 years ago

Commit 0eb4ff91 parent 1f09ab53 files · +21 −15Browse files

Showing the changes to libavfilter/avfilter.h (1 of 3 files). Show all

Unified · Split

libavfilter/avfilter.h+9−6
@@ -22,9 +22,9 @@ · 21 unmodified lines
22#ifndef AVFILTER_AVFILTER_H22#ifndef AVFILTER_AVFILTER_H
23#define AVFILTER_AVFILTER_H23#define AVFILTER_AVFILTER_H
24 24
25#define LIBAVFILTER_VERSION_MAJOR 025#define LIBAVFILTER_VERSION_MAJOR 1
26#define LIBAVFILTER_VERSION_MINOR 526#define LIBAVFILTER_VERSION_MINOR 0
27#define LIBAVFILTER_VERSION_MICRO 127#define LIBAVFILTER_VERSION_MICRO 0
28 28
29#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \29#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
30 LIBAVFILTER_VERSION_MINOR, \30 LIBAVFILTER_VERSION_MINOR, \
@@ -293,7 +293,7 @@ struct AVFilterPad · 262 unmodified lines
293 *293 *
294 * Input video pads only.294 * Input video pads only.
295 */295 */
296 AVFilterPicRef *(*get_video_buffer)(AVFilterLink *link, int perms);296 AVFilterPicRef *(*get_video_buffer)(AVFilterLink *link, int perms, int w, int h);
297 297
298 /**298 /**
299 * Callback called after the slices of a frame are completely sent. If299 * Callback called after the slices of a frame are completely sent. If
@@ -361,7 +361,7 @@ int avfilter_default_config_output_link(AVFilterLink *link); · 61 unmodified lines
361int avfilter_default_config_input_link (AVFilterLink *link);361int avfilter_default_config_input_link (AVFilterLink *link);
362/** default handler for get_video_buffer() for video inputs */362/** default handler for get_video_buffer() for video inputs */
363AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link,363AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link,
364 int perms);364 int perms, int w, int h);
365/**365/**
366 * A helper for query_formats() which sets all links to the same list of366 * A helper for query_formats() which sets all links to the same list of
367 * formats. If there are no links hooked to this filter, the list of formats is367 * formats. If there are no links hooked to this filter, the list of formats is
@@ -499,10 +499,13 @@ int avfilter_config_links(AVFilterContext *filter); · 131 unmodified lines
499 * @param link the output link to the filter from which the picture will499 * @param link the output link to the filter from which the picture will
500 * be requested500 * be requested
501 * @param perms the required access permissions501 * @param perms the required access permissions
502 * @param w the minimum width of the buffer to allocate
503 * @param h the minimum height of the buffer to allocate
502 * @return A reference to the picture. This must be unreferenced with504 * @return A reference to the picture. This must be unreferenced with
503 * avfilter_unref_pic when you are finished with it.505 * avfilter_unref_pic when you are finished with it.
504 */506 */
505AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms);507AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
508 int w, int h);
506 509
507/**510/**
508 * Requests an input frame from the filter at the other end of the link.511 * Requests an input frame from the filter at the other end of the link.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t