Separate video specific BufferRef properties into VideoProps.

Define a new struct AVFilterBufferRefVideoProps and add a type field
to AVFilterBufferRef.

Video specific properties in AVFilterBufferRefVideoProps are now
referred to by *video pointer in AVFilterBufferRef.

Patch by S.N. Hemanth Meenakshisundaram smeenaks->ucsd.edu.

Originally committed as revision 24763 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
S.N. Hemanth Meenakshisundaram
2010-08-11 11:06:04 +00:00
committed by Stefano Sabatini
parent fd7b11d027
commit cc80caff52
10 changed files with 59 additions and 42 deletions

View File

@@ -39,9 +39,10 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per
int i, tempsize;
char *buf;
ref->buf = pic;
ref->w = w;
ref->h = h;
ref->buf = pic;
ref->video = av_mallocz(sizeof(AVFilterBufferRefVideoProps));
ref->video->w = w;
ref->video->h = h;
/* make sure the buffer gets read permission or it's useless for output */
ref->perms = perms | AV_PERM_READ;
@@ -49,15 +50,15 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per
pic->refcount = 1;
ref->format = link->format;
pic->free = avfilter_default_free_buffer;
av_fill_image_linesizes(pic->linesize, ref->format, ref->w);
av_fill_image_linesizes(pic->linesize, ref->format, ref->video->w);
for (i=0; i<4;i++)
pic->linesize[i] = FFALIGN(pic->linesize[i], 16);
tempsize = av_fill_image_pointers(pic->data, ref->format, ref->h, NULL, pic->linesize);
tempsize = av_fill_image_pointers(pic->data, ref->format, ref->video->h, NULL, pic->linesize);
buf = av_malloc(tempsize + 16); // +2 is needed for swscaler, +16 to be
// SIMD-friendly
av_fill_image_pointers(pic->data, ref->format, ref->h, buf, pic->linesize);
av_fill_image_pointers(pic->data, ref->format, ref->video->h, buf, pic->linesize);
memcpy(ref->data, pic->data, 4*sizeof(pic->data[0]));
memcpy(ref->linesize, pic->linesize, 4*sizeof(pic->linesize[0]));