Revision 0eb4ff9e libavfilter/defaults.c

View differences:

libavfilter/defaults.c
32 32
/* TODO: set the buffer's priv member to a context structure for the whole
33 33
 * filter chain.  This will allow for a buffer pool instead of the constant
34 34
 * alloc & free cycle currently implemented. */
35
AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms)
35
AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
36 36
{
37 37
    AVFilterPic *pic = av_mallocz(sizeof(AVFilterPic));
38 38
    AVFilterPicRef *ref = av_mallocz(sizeof(AVFilterPicRef));
......
40 40
    char *buf;
41 41

  
42 42
    ref->pic   = pic;
43
    ref->w     = pic->w = link->w;
44
    ref->h     = pic->h = link->h;
43
    ref->w     = pic->w = w;
44
    ref->h     = pic->h = h;
45 45

  
46 46
    /* make sure the buffer gets read permission or it's useless for output */
47 47
    ref->perms = perms | AV_PERM_READ;
......
72 72
        out = link->dst->outputs[0];
73 73

  
74 74
    if(out) {
75
        out->outpic      = avfilter_get_video_buffer(out, AV_PERM_WRITE);
75
        out->outpic      = avfilter_get_video_buffer(out, AV_PERM_WRITE, link->w, link->h);
76 76
        out->outpic->pts = picref->pts;
77 77
        avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));
78 78
    }

Also available in: Unified diff