aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorS.N. Hemanth Meenakshisundaram <smeenaks@ucsd.edu>2010-08-11 11:06:04 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-08-11 11:06:04 +0000
commitcc80caff52a3a20d2ef4285d06263e542e3ddf46 (patch)
tree2b9820513a08b21da8159ff7c704dde70c037105 /libavfilter/avfilter.c
parentfd7b11d027da7cc350d867d22d4c6bbe6022d8df (diff)
downloadffmpeg-cc80caff52a3a20d2ef4285d06263e542e3ddf46.tar.gz
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
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index b7242be331..b4e1c20023 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -49,6 +49,10 @@ AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
{
AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
*ret = *ref;
+ if (ref->type == AVMEDIA_TYPE_VIDEO) {
+ ret->video = av_malloc(sizeof(AVFilterBufferRefVideoProps));
+ *ret->video = *ref->video;
+ }
ret->perms &= pmask;
ret->buf->refcount ++;
return ret;
@@ -58,6 +62,7 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
if(!(--ref->buf->refcount))
ref->buf->free(ref->buf);
+ av_free(ref->video);
av_free(ref);
}
@@ -179,7 +184,7 @@ void ff_dprintf_picref(void *ctx, AVFilterBufferRef *picref, int end)
picref->data [0], picref->data [1], picref->data [2], picref->data [3],
picref->linesize[0], picref->linesize[1], picref->linesize[2], picref->linesize[3],
picref->pts, picref->pos,
- picref->pixel_aspect.num, picref->pixel_aspect.den, picref->w, picref->h,
+ picref->video->pixel_aspect.num, picref->video->pixel_aspect.den, picref->video->w, picref->video->h,
end ? "\n" : "");
}
@@ -314,7 +319,7 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
for(i = 0; i < 4; i ++) {
int planew =
- ff_get_plane_bytewidth(link->format, link->cur_buf->w, i);
+ ff_get_plane_bytewidth(link->format, link->cur_buf->video->w, i);
if(!src[i]) continue;