mirror of https://git.ffmpeg.org/ffmpeg.git
recommit of
promote avpicture_alloc to public interface patch by (Drew Hess <dhess at ilm dot com>) Originally committed as revision 2351 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
86a7e11502
commit
75917b887b
|
@ -1524,6 +1524,20 @@ void img_resample(ImgReSampleContext *s,
|
||||||
|
|
||||||
void img_resample_close(ImgReSampleContext *s);
|
void img_resample_close(ImgReSampleContext *s);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate memory for a picture. Call avpicture_free to free it.
|
||||||
|
*
|
||||||
|
* @param picture the picture to be filled in.
|
||||||
|
* @param pix_fmt the format of the picture.
|
||||||
|
* @param width the width of the picture.
|
||||||
|
* @param height the height of the picture.
|
||||||
|
* @return 0 if successful, -1 if not.
|
||||||
|
*/
|
||||||
|
int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
|
||||||
|
|
||||||
|
/* Free a picture previously allocated by avpicture_alloc. */
|
||||||
|
void avpicture_free(AVPicture *picture);
|
||||||
|
|
||||||
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
|
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
|
||||||
int pix_fmt, int width, int height);
|
int pix_fmt, int width, int height);
|
||||||
int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
|
int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
|
||||||
|
|
|
@ -1613,7 +1613,7 @@ static ConvertEntry convert_table[PIX_FMT_NB][PIX_FMT_NB] = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int avpicture_alloc(AVPicture *picture,
|
int avpicture_alloc(AVPicture *picture,
|
||||||
int pix_fmt, int width, int height)
|
int pix_fmt, int width, int height)
|
||||||
{
|
{
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
|
@ -1630,7 +1630,7 @@ static int avpicture_alloc(AVPicture *picture,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void avpicture_free(AVPicture *picture)
|
void avpicture_free(AVPicture *picture)
|
||||||
{
|
{
|
||||||
av_free(picture->data[0]);
|
av_free(picture->data[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue