Originally committed as revision 25826 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -23,9 +23,10 @@ · 22 unmodified lines | ||
| 23 | 23 | #include "libavcore/imgutils.h" |
| 24 | 24 | #include "libavcore/samplefmt.h" |
| 25 | 25 | #include "avfilter.h" |
| 26 | +#include "internal.h" | |
| 26 | 27 | |
| 27 | 28 | /* TODO: buffer pool. see comment for avfilter_default_get_video_buffer() */ |
| 28 | −static void avfilter_default_free_buffer(AVFilterBuffer *ptr) | |
| 29 | +void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr) | |
| 29 | 30 | { |
| 30 | 31 | av_free(ptr->data[0]); |
| 31 | 32 | av_free(ptr); |
| @@ -54,7 +55,7 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per · 22 unmodified lines | ||
| 54 | 55 | |
| 55 | 56 | pic->refcount = 1; |
| 56 | 57 | ref->format = link->format; |
| 57 | − pic->free = avfilter_default_free_buffer; | |
| 58 | + pic->free = ff_avfilter_default_free_buffer; | |
| 58 | 59 | av_image_fill_linesizes(pic->linesize, ref->format, ref->video->w); |
| 59 | 60 | |
| 60 | 61 | for (i = 0; i < 4; i++) |
| @@ -108,7 +109,7 @@ AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int per · 47 unmodified lines | ||
| 108 | 109 | ref->perms = perms | AV_PERM_READ; |
| 109 | 110 | |
| 110 | 111 | samples->refcount = 1; |
| 111 | − samples->free = avfilter_default_free_buffer; | |
| 112 | + samples->free = ff_avfilter_default_free_buffer; | |
| 112 | 113 | |
| 113 | 114 | sample_size = av_get_bits_per_sample_fmt(sample_fmt) >>3; |
| 114 | 115 | chans_nb = av_get_channel_layout_nb_channels(channel_layout); |
| @@ -57,4 +57,7 @@ int ff_avfilter_graph_config_links(AVFilterGraph *graphctx, AVClass *log_ctx); · 56 unmodified lines | ||
| 57 | 57 | */ |
| 58 | 58 | int ff_avfilter_graph_config_formats(AVFilterGraph *graphctx, AVClass *log_ctx); |
| 59 | 59 | |
| 60 | +/** default handler for freeing audio/video buffer when there are no references left */ | |
| 61 | +void ff_avfilter_default_free_buffer(AVFilterBuffer *buf); | |
| 62 | + | |
| 60 | 63 | #endif /* AVFILTER_INTERNAL_H */ |