Originally committed as revision 25826 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -23,9 +23,10 @@ · 22 unmodified lines | |||
| 23 | #include "libavcore/imgutils.h" | 23 | #include "libavcore/imgutils.h" |
| 24 | #include "libavcore/samplefmt.h" | 24 | #include "libavcore/samplefmt.h" |
| 25 | #include "avfilter.h" | 25 | #include "avfilter.h" |
| 26 | #include "internal.h" | ||
| 26 | 27 | ||
| 27 | /* TODO: buffer pool. see comment for avfilter_default_get_video_buffer() */ | 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 | av_free(ptr->data[0]); | 31 | av_free(ptr->data[0]); |
| 31 | av_free(ptr); | 32 | av_free(ptr); |
| @@ -54,7 +55,7 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per · 22 unmodified lines | |||
| 54 | 55 | ||
| 55 | pic->refcount = 1; | 56 | pic->refcount = 1; |
| 56 | ref->format = link->format; | 57 | ref->format = link->format; |
| 57 | pic->free = avfilter_default_free_buffer; | 58 | pic->free = ff_avfilter_default_free_buffer; |
| 58 | av_image_fill_linesizes(pic->linesize, ref->format, ref->video->w); | 59 | av_image_fill_linesizes(pic->linesize, ref->format, ref->video->w); |
| 59 | 60 | ||
| 60 | for (i = 0; i < 4; i++) | 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 | ref->perms = perms | AV_PERM_READ; | 109 | ref->perms = perms | AV_PERM_READ; |
| 109 | 110 | ||
| 110 | samples->refcount = 1; | 111 | samples->refcount = 1; |
| 111 | samples->free = avfilter_default_free_buffer; | 112 | samples->free = ff_avfilter_default_free_buffer; |
| 112 | 113 | ||
| 113 | sample_size = av_get_bits_per_sample_fmt(sample_fmt) >>3; | 114 | sample_size = av_get_bits_per_sample_fmt(sample_fmt) >>3; |
| 114 | chans_nb = av_get_channel_layout_nb_channels(channel_layout); | 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 | int ff_avfilter_graph_config_formats(AVFilterGraph *graphctx, AVClass *log_ctx); | 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 | #endif /* AVFILTER_INTERNAL_H */ | 63 | #endif /* AVFILTER_INTERNAL_H */ |