History

Rename AVFilterPic to AVFilterBuffer.

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

S.N. Hemanth Meenakshisundaram committed 16 years ago

Commit f0d77b21 parent 0c733da2 files · +11 −11Browse files

Unified · Split

2 files
  1. libavfilter/avfilter.h +6 −6
  2. libavfilter/defaults.c +5 −5
libavfilter/avfilter.h+6−6
@@ -25,7 +25,7 @@ · 24 unmodified lines
25#include "libavutil/avutil.h"25#include "libavutil/avutil.h"
26 26
27#define LIBAVFILTER_VERSION_MAJOR 127#define LIBAVFILTER_VERSION_MAJOR 1
28#define LIBAVFILTER_VERSION_MINOR 2328#define LIBAVFILTER_VERSION_MINOR 24
29#define LIBAVFILTER_VERSION_MICRO 029#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 the67 * should not store pointers to this structure directly, but instead use the
68 * AVFilterPicRef structure below.68 * AVFilterPicRef structure below.
69 */69 */
70typedef struct AVFilterPic70typedef struct AVFilterBuffer
71{71{
72 uint8_t *data[4]; ///< picture data for each plane72 uint8_t *data[4]; ///< picture data for each plane
73 int linesize[4]; ///< number of bytes per line73 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 of83 * 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 buffer88 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 of92 * 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 origin93 * a picture to, for example, crop image without any memcpy, the picture origin
94 * and dimensions are per-reference properties. Linesize is also useful for94 * 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 */
99typedef struct AVFilterPicRef99typedef struct AVFilterPicRef
100{100{
101 AVFilterPic *pic; ///< the picture that this is a reference to101 AVFilterBuffer *pic; ///< the picture that this is a reference to
102 uint8_t *data[4]; ///< picture data for each plane102 uint8_t *data[4]; ///< picture data for each plane
103 int linesize[4]; ///< number of bytes per line103 int linesize[4]; ///< number of bytes per line
104 int w; ///< image width104 int w; ///< image width
libavfilter/defaults.c+5−5
@@ -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() */
26static void avfilter_default_free_video_buffer(AVFilterPic *pic)26static 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 whole32/* 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. */
35AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)35AVFilterPicRef *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++)

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