Logo Search packages:      
Sourcecode: blender version File versions

int avpicture_alloc ( AVPicture picture,
int  pix_fmt,
int  width,
int  height 
)

Allocate memory for a picture. Call avpicture_free to free it.

Parameters:
picture the picture to be filled in.
pix_fmt the format of the picture.
width the width of the picture.
height the height of the picture.
Returns:
0 if successful, -1 if not.

Definition at line 1944 of file imgconvert.c.

References av_malloc().

{
    int size;
    void *ptr;

    size = avpicture_get_size(pix_fmt, width, height);
    if(size<0)
        goto fail;
    ptr = av_malloc(size);
    if (!ptr)
        goto fail;
    avpicture_fill(picture, ptr, pix_fmt, width, height);
    return 0;
 fail:
    memset(picture, 0, sizeof(AVPicture));
    return -1;
}


Generated by  Doxygen 1.6.0   Back to index