The struct is going to be used for audio data as well, so the new name is less misleading. Patch by S.N. Hemanth Meenakshisundaram smeenaks AT ucsd DOT edu. Originally committed as revision 24284 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -25,7 +25,7 @@ · 24 unmodified lines | |||
| 25 | #include "libavutil/avutil.h" | 25 | #include "libavutil/avutil.h" |
| 26 | 26 | ||
| 27 | #define LIBAVFILTER_VERSION_MAJOR 1 | 27 | #define LIBAVFILTER_VERSION_MAJOR 1 |
| 28 | #define LIBAVFILTER_VERSION_MINOR 23 | 28 | #define LIBAVFILTER_VERSION_MINOR 24 |
| 29 | #define LIBAVFILTER_VERSION_MICRO 0 | 29 | #define LIBAVFILTER_VERSION_MICRO 0 |
| 30 | 30 | ||
| 31 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ | 31 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |
| @@ -67,7 +67,7 @@ typedef struct AVFilterPad AVFilterPad; · 35 unmodified lines | |||
| 67 | * should not store pointers to this structure directly, but instead use the | 67 | * should not store pointers to this structure directly, but instead use the |
| 68 | * AVFilterPicRef structure below. | 68 | * AVFilterPicRef structure below. |
| 69 | */ | 69 | */ |
| 70 | typedef struct AVFilterPic | 70 | typedef struct AVFilterBuffer |
| 71 | { | 71 | { |
| 72 | uint8_t *data[4]; ///< picture data for each plane | 72 | uint8_t *data[4]; ///< picture data for each plane |
| 73 | int linesize[4]; ///< number of bytes per line | 73 | int linesize[4]; ///< number of bytes per line |
| @@ -83,13 +83,13 @@ typedef struct AVFilterPic · 9 unmodified lines | |||
| 83 | * back into a memory pool to be reused later without the overhead of | 83 | * back into a memory pool to be reused later without the overhead of |
| 84 | * reallocating it from scratch. | 84 | * reallocating it from scratch. |
| 85 | */ | 85 | */ |
| 86 | void (*free)(struct AVFilterPic *pic); | 86 | void (*free)(struct AVFilterBuffer *pic); |
| 87 | 87 | ||
| 88 | int w, h; ///< width and height of the allocated buffer | 88 | int w, h; ///< width and height of the allocated buffer |
| 89 | } AVFilterPic; | 89 | } AVFilterBuffer; |
| 90 | 90 | ||
| 91 | /** | 91 | /** |
| 92 | * A reference to an AVFilterPic. Since filters can manipulate the origin of | 92 | * A reference to an AVFilterBuffer. Since filters can manipulate the origin of |
| 93 | * a picture to, for example, crop image without any memcpy, the picture origin | 93 | * a picture to, for example, crop image without any memcpy, the picture origin |
| 94 | * and dimensions are per-reference properties. Linesize is also useful for | 94 | * and dimensions are per-reference properties. Linesize is also useful for |
| 95 | * image flipping, frame to field filters, etc, and so is also per-reference. | 95 | * image flipping, frame to field filters, etc, and so is also per-reference. |
| @@ -98,7 +98,7 @@ typedef struct AVFilterPic · 2 unmodified lines | |||
| 98 | */ | 98 | */ |
| 99 | typedef struct AVFilterPicRef | 99 | typedef struct AVFilterPicRef |
| 100 | { | 100 | { |
| 101 | AVFilterPic *pic; ///< the picture that this is a reference to | 101 | AVFilterBuffer *pic; ///< the picture that this is a reference to |
| 102 | uint8_t *data[4]; ///< picture data for each plane | 102 | uint8_t *data[4]; ///< picture data for each plane |
| 103 | int linesize[4]; ///< number of bytes per line | 103 | int linesize[4]; ///< number of bytes per line |
| 104 | int w; ///< image width | 104 | int w; ///< image width |
| @@ -23,10 +23,10 @@ · 22 unmodified lines | |||
| 23 | #include "avfilter.h" | 23 | #include "avfilter.h" |
| 24 | 24 | ||
| 25 | /* TODO: buffer pool. see comment for avfilter_default_get_video_buffer() */ | 25 | /* TODO: buffer pool. see comment for avfilter_default_get_video_buffer() */ |
| 26 | static void avfilter_default_free_video_buffer(AVFilterPic *pic) | 26 | static void avfilter_default_free_buffer(AVFilterBuffer *ptr) |
| 27 | { | 27 | { |
| 28 | av_free(pic->data[0]); | 28 | av_free(ptr->data[0]); |
| 29 | av_free(pic); | 29 | av_free(ptr); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | /* TODO: set the buffer's priv member to a context structure for the whole | 32 | /* TODO: set the buffer's priv member to a context structure for the whole |
| @@ -34,7 +34,7 @@ static void avfilter_default_free_video_buffer(AVFilterPic *pic) · 1 unmodified line | |||
| 34 | * alloc & free cycle currently implemented. */ | 34 | * alloc & free cycle currently implemented. */ |
| 35 | AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h) | 35 | AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h) |
| 36 | { | 36 | { |
| 37 | AVFilterPic *pic = av_mallocz(sizeof(AVFilterPic)); | 37 | AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer)); |
| 38 | AVFilterPicRef *ref = av_mallocz(sizeof(AVFilterPicRef)); | 38 | AVFilterPicRef *ref = av_mallocz(sizeof(AVFilterPicRef)); |
| 39 | int i, tempsize; | 39 | int i, tempsize; |
| 40 | char *buf; | 40 | char *buf; |
| @@ -48,7 +48,7 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, · 7 unmodified lines | |||
| 48 | 48 | ||
| 49 | pic->refcount = 1; | 49 | pic->refcount = 1; |
| 50 | pic->format = link->format; | 50 | pic->format = link->format; |
| 51 | pic->free = avfilter_default_free_video_buffer; | 51 | pic->free = avfilter_default_free_buffer; |
| 52 | ff_fill_linesize((AVPicture *)pic, pic->format, ref->w); | 52 | ff_fill_linesize((AVPicture *)pic, pic->format, ref->w); |
| 53 | 53 | ||
| 54 | for (i=0; i<4;i++) | 54 | for (i=0; i<4;i++) |