#define LIBAVCODEC_VERSION_MAJOR 52
#define LIBAVCODEC_VERSION_MINOR 22
-#define LIBAVCODEC_VERSION_MICRO 0
+#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
* @param height the height of the picture
* @return zero if successful, a negative value if not
*/
-int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
+int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
/**
* Free a picture previously allocated by avpicture_alloc().
*/
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
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, enum PixelFormat pix_fmt, int width, int height,
unsigned char *dest, int dest_size);
/**
* @param height the height of the image
* @return Image data size in bytes or -1 on error (e.g. too large dimensions).
*/
-int avpicture_get_size(int pix_fmt, int width, int height);
-void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
-const char *avcodec_get_pix_fmt_name(int pix_fmt);
+int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
+void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
+const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
enum PixelFormat avcodec_get_pix_fmt(const char* name);
unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
* @param[in] has_alpha Whether the source pixel format alpha channel is used.
* @return Combination of flags informing you what kind of losses will occur.
*/
-int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
+int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
int has_alpha);
/**
* @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
* @return The best pixel format to convert to or -1 if none was found.
*/
-int avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, int src_pix_fmt,
+enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr);
* a negative value to print the corresponding header.
* Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1.
*/
-void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
+void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
* @return ored mask of FF_ALPHA_xxx constants
*/
int img_get_alpha_info(const AVPicture *src,
- int pix_fmt, int width, int height);
+ enum PixelFormat pix_fmt, int width, int height);
/* deinterlace a picture */
/* deinterlace - if not supported return -1 */
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height);
+ enum PixelFormat pix_fmt, int width, int height);
/* external high level API */
* Copy image 'src' to 'dst'.
*/
void av_picture_copy(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height);
+ enum PixelFormat pix_fmt, int width, int height);
/**
* Crop image top and left side.
*/
int av_picture_crop(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int top_band, int left_band);
+ enum PixelFormat pix_fmt, int top_band, int left_band);
/**
* Pad image.
*/
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
+int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
int padtop, int padbottom, int padleft, int padright, int *color);
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
},
};
-void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift)
+void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift)
{
*h_shift = pix_fmt_info[pix_fmt].x_chroma_shift;
*v_shift = pix_fmt_info[pix_fmt].y_chroma_shift;
}
-const char *avcodec_get_pix_fmt_name(int pix_fmt)
+const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt)
{
if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
return NULL;
return PIX_FMT_NONE;
}
-void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt)
+void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
{
/* print header */
if (pix_fmt < 0)
return 0;
}
-int ff_fill_linesize(AVPicture *picture, int pix_fmt, int width)
+int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
{
int w2;
const PixFmtInfo *pinfo;
return 0;
}
-int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, int pix_fmt,
+int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
int height)
{
int size, h2, size2;
}
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
- int pix_fmt, int width, int height)
+ enum PixelFormat pix_fmt, int width, int height)
{
if(avcodec_check_dimensions(NULL, width, height))
return ff_fill_pointer(picture, ptr, pix_fmt, height);
}
-int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
+int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
unsigned char *dest, int dest_size)
{
const PixFmtInfo* pf = &pix_fmt_info[pix_fmt];
return size;
}
-int avpicture_get_size(int pix_fmt, int width, int height)
+int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height)
{
AVPicture dummy_pict;
if(avcodec_check_dimensions(NULL, width, height))
return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);
}
-int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
+int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
int has_alpha)
{
const PixFmtInfo *pf, *ps;
return loss;
}
-static int avg_bits_per_pixel(int pix_fmt)
+static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
{
int bits;
const PixFmtInfo *pf;
return bits;
}
-static int avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,
- int src_pix_fmt,
+static enum PixelFormat avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,
+ enum PixelFormat src_pix_fmt,
int has_alpha,
int loss_mask)
{
- int dist, i, loss, min_dist, dst_pix_fmt;
+ int dist, i, loss, min_dist;
+ enum PixelFormat dst_pix_fmt;
/* find exact color match with smallest size */
dst_pix_fmt = -1;
return dst_pix_fmt;
}
-int avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, int src_pix_fmt,
+enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr)
{
- int dst_pix_fmt, loss_mask, i;
+ enum PixelFormat dst_pix_fmt;
+ int loss_mask, i;
static const int loss_mask_order[] = {
~0, /* no loss first */
~FF_LOSS_ALPHA,
}
void av_picture_copy(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height)
+ enum PixelFormat pix_fmt, int width, int height)
{
int i;
const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
int avpicture_alloc(AVPicture *picture,
- int pix_fmt, int width, int height)
+ enum PixelFormat pix_fmt, int width, int height)
{
int size;
void *ptr;
}
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
- int pix_fmt, int padtop, int padbottom, int padleft, int padright,
+ enum PixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright,
int *color)
{
uint8_t *optr;
}
int img_get_alpha_info(const AVPicture *src,
- int pix_fmt, int width, int height)
+ enum PixelFormat pix_fmt, int width, int height)
{
const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
int ret;
}
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height)
+ enum PixelFormat pix_fmt, int width, int height)
{
int i;
#include <stdint.h>
#include "avcodec.h"
-int ff_fill_linesize(AVPicture *picture, int pix_fmt, int width);
+int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width);
-int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, int pix_fmt, int height);
+int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, int height);
int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane);