diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-10-06 12:10:34 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-10-08 07:13:26 +0200 |
commit | 716d413c13981da15323c7a3821860536eefdbbb (patch) | |
tree | b15ebcded50b8edaa5b9fc8f261774043138e1fa /libavfilter | |
parent | 78071a1420b425dfb787ac739048f523007b8139 (diff) | |
download | ffmpeg-716d413c13981da15323c7a3821860536eefdbbb.tar.gz |
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
Diffstat (limited to 'libavfilter')
32 files changed, 292 insertions, 292 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 29afc86be7..9c05933964 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -90,7 +90,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, link->srcpad = &src->output_pads[srcpad]; link->dstpad = &dst->input_pads[dstpad]; link->type = src->output_pads[srcpad].type; - assert(PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1); + assert(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1); link->format = -1; return 0; diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 7ca9eb42b3..adb8b797d8 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -578,7 +578,7 @@ int avfilter_config_links(AVFilterContext *filter); */ AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms, - int w, int h, enum PixelFormat format); + int w, int h, enum AVPixelFormat format); /** * Create an audio buffer reference wrapped around an already diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index ce897f5f5b..b33aa0aba9 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -44,7 +44,7 @@ typedef struct { /* video only */ int h, w; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; AVRational pixel_aspect; /* audio only */ @@ -173,10 +173,10 @@ static av_cold int init_video(AVFilterContext *ctx, const char *args) av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but %d found in '%s'\n", n, args); return AVERROR(EINVAL); } - if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == PIX_FMT_NONE) { + if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == AV_PIX_FMT_NONE) { char *tail; c->pix_fmt = strtol(pix_fmt_str, &tail, 10); - if (*tail || c->pix_fmt < 0 || c->pix_fmt >= PIX_FMT_NB) { + if (*tail || c->pix_fmt < 0 || c->pix_fmt >= AV_PIX_FMT_NB) { av_log(ctx, AV_LOG_ERROR, "Invalid pixel format string '%s'\n", pix_fmt_str); return AVERROR(EINVAL); } diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 60710243c1..28b2283daa 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -27,7 +27,7 @@ enum { RED = 0, GREEN, BLUE, ALPHA }; int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], - enum PixelFormat pix_fmt, uint8_t rgba_color[4], + enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba, uint8_t rgba_map_ptr[4]) { uint8_t rgba_map[4] = {0}; @@ -37,12 +37,12 @@ int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t *is_packed_rgba = 1; switch (pix_fmt) { - case PIX_FMT_ARGB: rgba_map[ALPHA] = 0; rgba_map[RED ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break; - case PIX_FMT_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break; - case PIX_FMT_RGBA: - case PIX_FMT_RGB24: rgba_map[RED ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break; - case PIX_FMT_BGRA: - case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break; + case AV_PIX_FMT_ARGB: rgba_map[ALPHA] = 0; rgba_map[RED ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break; + case AV_PIX_FMT_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break; + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_RGB24: rgba_map[RED ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break; + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break; default: *is_packed_rgba = 0; } diff --git a/libavfilter/drawutils.h b/libavfilter/drawutils.h index 7b11c06694..73f482e83e 100644 --- a/libavfilter/drawutils.h +++ b/libavfilter/drawutils.h @@ -29,7 +29,7 @@ int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], - enum PixelFormat pix_fmt, uint8_t rgba_color[4], + enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba, uint8_t rgba_map[4]); void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4], diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 98cda8b8e5..7737f177db 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -155,7 +155,7 @@ int ff_fmt_is_in(int fmt, const int *fmts) { const int *p; - for (p = fmts; *p != PIX_FMT_NONE; p++) { + for (p = fmts; *p != AV_PIX_FMT_NONE; p++) { if (fmt == *p) return 1; } @@ -210,7 +210,7 @@ AVFilterFormats *ff_all_formats(enum AVMediaType type) { AVFilterFormats *ret = NULL; int fmt; - int num_formats = type == AVMEDIA_TYPE_VIDEO ? PIX_FMT_NB : + int num_formats = type == AVMEDIA_TYPE_VIDEO ? AV_PIX_FMT_NB : type == AVMEDIA_TYPE_AUDIO ? AV_SAMPLE_FMT_NB : 0; for (fmt = 0; fmt < num_formats; fmt++) diff --git a/libavfilter/vf_blackframe.c b/libavfilter/vf_blackframe.c index 65443fc24c..4f5a883b46 100644 --- a/libavfilter/vf_blackframe.c +++ b/libavfilter/vf_blackframe.c @@ -45,10 +45,10 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV410P, PIX_FMT_YUV420P, PIX_FMT_GRAY8, PIX_FMT_NV12, - PIX_FMT_NV21, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NV12, + AV_PIX_FMT_NV21, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c index cfe33da9be..7f334715c3 100644 --- a/libavfilter/vf_boxblur.c +++ b/libavfilter/vf_boxblur.c @@ -124,13 +124,13 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUVA420P, - PIX_FMT_YUV440P, PIX_FMT_GRAY8, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, - PIX_FMT_YUVJ440P, - PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index 1c8e87799a..839376744c 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -85,30 +85,30 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGB48BE, PIX_FMT_RGB48LE, - PIX_FMT_BGR48BE, PIX_FMT_BGR48LE, - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, - PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, - PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, - PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, - PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, - PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, - PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE, - PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, - PIX_FMT_RGB8, PIX_FMT_BGR8, - PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, - PIX_FMT_PAL8, PIX_FMT_GRAY8, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGB48LE, + AV_PIX_FMT_BGR48BE, AV_PIX_FMT_BGR48LE, + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE, + AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE, + AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE, + AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE, + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE, + AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE, + AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE, + AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, + AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, + AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index e107f471c3..7f750078f2 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -43,13 +43,13 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV422P, PIX_FMT_YUVJ422P, - PIX_FMT_YUV444P, PIX_FMT_YUVJ444P, - PIX_FMT_YUV411P, PIX_FMT_GRAY8, - PIX_FMT_NV12, PIX_FMT_NV21, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NV12, AV_PIX_FMT_NV21, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c index 86b625cdd1..c273899d76 100644 --- a/libavfilter/vf_delogo.c +++ b/libavfilter/vf_delogo.c @@ -161,11 +161,11 @@ static const AVClass delogo_class = { static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVA420P, PIX_FMT_GRAY8, - PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c index 69fdd790d7..2cc8850dfd 100644 --- a/libavfilter/vf_drawbox.c +++ b/libavfilter/vf_drawbox.c @@ -66,12 +66,12 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, - PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 7aeea86ce1..c08cd6fb24 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -389,14 +389,14 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_YUV420P, PIX_FMT_YUV444P, - PIX_FMT_YUV422P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index ca847929ae..92ea8f6d80 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -73,13 +73,13 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c index 5a8e6f94a1..cf174ded1d 100644 --- a/libavfilter/vf_fieldorder.c +++ b/libavfilter/vf_fieldorder.c @@ -71,14 +71,14 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { AVFilterFormats *formats; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; int ret; /** accept any input pixel format that is not hardware accelerated, not * a bitstream format, and does not have vertically sub-sampled chroma */ if (ctx->inputs[0]) { formats = NULL; - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if (!( av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL || av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BITSTREAM) && av_pix_fmt_descriptors[pix_fmt].nb_components diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c index 0437bfaa07..23dda0c23c 100644 --- a/libavfilter/vf_format.c +++ b/libavfilter/vf_format.c @@ -38,18 +38,18 @@ typedef struct { * List of flags telling if a given image format has been listed * as argument to the filter. */ - int listed_pix_fmt_flags[PIX_FMT_NB]; + int listed_pix_fmt_flags[AV_PIX_FMT_NB]; } FormatContext; -#define PIX_FMT_NAME_MAXSIZE 32 +#define AV_PIX_FMT_NAME_MAXSIZE 32 static av_cold int init(AVFilterContext *ctx, const char *args) { FormatContext *format = ctx->priv; const char *cur, *sep; - char pix_fmt_name[PIX_FMT_NAME_MAXSIZE]; + char pix_fmt_name[AV_PIX_FMT_NAME_MAXSIZE]; int pix_fmt_name_len; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; /* parse the list of formats */ for (cur = args; cur; cur = sep ? sep+1 : NULL) { @@ -57,7 +57,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) pix_fmt_name_len = strlen(cur); else pix_fmt_name_len = sep - cur; - if (pix_fmt_name_len >= PIX_FMT_NAME_MAXSIZE) { + if (pix_fmt_name_len >= AV_PIX_FMT_NAME_MAXSIZE) { av_log(ctx, AV_LOG_ERROR, "Format name too long\n"); return -1; } @@ -66,7 +66,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) pix_fmt_name[pix_fmt_name_len] = 0; pix_fmt = av_get_pix_fmt(pix_fmt_name); - if (pix_fmt == PIX_FMT_NONE) { + if (pix_fmt == AV_PIX_FMT_NONE) { av_log(ctx, AV_LOG_ERROR, "Unknown pixel format: %s\n", pix_fmt_name); return -1; } @@ -80,12 +80,12 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static AVFilterFormats *make_format_list(FormatContext *format, int flag) { AVFilterFormats *formats; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; formats = av_mallocz(sizeof(AVFilterFormats)); - formats->formats = av_malloc(sizeof(enum PixelFormat) * PIX_FMT_NB); + formats->formats = av_malloc(sizeof(enum AVPixelFormat) * AV_PIX_FMT_NB); - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if (format->listed_pix_fmt_flags[pix_fmt] == flag) formats->formats[formats->format_count++] = pix_fmt; diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index f29224e501..45c7cf1340 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -329,12 +329,12 @@ static int query_formats(AVFilterContext *ctx) AVFilterFormats *formats = NULL; if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) { - ff_add_format(&formats, PIX_FMT_BGRA); + ff_add_format(&formats, AV_PIX_FMT_BGRA); } else if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) { - ff_add_format(&formats, PIX_FMT_RGBA); + ff_add_format(&formats, AV_PIX_FMT_RGBA); } else { /* F0R_COLOR_MODEL_PACKED32 */ - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_BGRA, PIX_FMT_ARGB, PIX_FMT_ABGR, PIX_FMT_ARGB, PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, AV_PIX_FMT_ARGB, AV_PIX_FMT_NONE }; formats = ff_make_format_list(pix_fmts); } diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 2953256521..78568fb62f 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -151,12 +151,12 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV410P, PIX_FMT_YUV420P, - PIX_FMT_GRAY8, PIX_FMT_NV12, - PIX_FMT_NV21, PIX_FMT_YUV444P, - PIX_FMT_YUV422P, PIX_FMT_YUV411P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_GRAY8, AV_PIX_FMT_NV12, + AV_PIX_FMT_NV21, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c index 87bfe11191..0937d484a8 100644 --- a/libavfilter/vf_hflip.c +++ b/libavfilter/vf_hflip.c @@ -42,30 +42,30 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGB48BE, PIX_FMT_RGB48LE, - PIX_FMT_BGR48BE, PIX_FMT_BGR48LE, - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, - PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, - PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, - PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, - PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, - PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, - PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE, - PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, - PIX_FMT_RGB8, PIX_FMT_BGR8, - PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, - PIX_FMT_PAL8, PIX_FMT_GRAY8, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGB48LE, + AV_PIX_FMT_BGR48BE, AV_PIX_FMT_BGR48LE, + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE, + AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE, + AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE, + AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE, + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE, + AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE, + AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE, + AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, + AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, + AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c index 71b670d3f1..e349a4b51c 100644 --- a/libavfilter/vf_hqdn3d.c +++ b/libavfilter/vf_hqdn3d.c @@ -264,27 +264,27 @@ static void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, - PIX_FMT_YUV422P, - PIX_FMT_YUV444P, - PIX_FMT_YUV410P, - PIX_FMT_YUV411P, - PIX_FMT_YUV440P, - PIX_FMT_YUVJ420P, - PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ444P, - PIX_FMT_YUVJ440P, - AV_NE( PIX_FMT_YUV420P9BE, PIX_FMT_YUV420P9LE ), - AV_NE( PIX_FMT_YUV422P9BE, PIX_FMT_YUV422P9LE ), - AV_NE( PIX_FMT_YUV444P9BE, PIX_FMT_YUV444P9LE ), - AV_NE( PIX_FMT_YUV420P10BE, PIX_FMT_YUV420P10LE ), - AV_NE( PIX_FMT_YUV422P10BE, PIX_FMT_YUV422P10LE ), - AV_NE( PIX_FMT_YUV444P10BE, PIX_FMT_YUV444P10LE ), - AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ), - AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ), - AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ), - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ444P, + AV_PIX_FMT_YUVJ440P, + AV_NE( AV_PIX_FMT_YUV420P9BE, AV_PIX_FMT_YUV420P9LE ), + AV_NE( AV_PIX_FMT_YUV422P9BE, AV_PIX_FMT_YUV422P9LE ), + AV_NE( AV_PIX_FMT_YUV444P9BE, AV_PIX_FMT_YUV444P9LE ), + AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ), + AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ), + AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ), + AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ), + AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ), + AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ), + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c index fc6dfbc52e..8e3a937274 100644 --- a/libavfilter/vf_libopencv.c +++ b/libavfilter/vf_libopencv.c @@ -34,14 +34,14 @@ #include "formats.h" #include "video.h" -static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *picref, enum PixelFormat pixfmt) +static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *picref, enum AVPixelFormat pixfmt) { IplImage *tmpimg; int depth, channels_nb; - if (pixfmt == PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; channels_nb = 1; } - else if (pixfmt == PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; channels_nb = 4; } - else if (pixfmt == PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; channels_nb = 3; } + if (pixfmt == AV_PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; channels_nb = 1; } + else if (pixfmt == AV_PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; channels_nb = 4; } + else if (pixfmt == AV_PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; channels_nb = 3; } else return; tmpimg = cvCreateImageHeader((CvSize){picref->video->w, picref->video->h}, depth, channels_nb); @@ -52,7 +52,7 @@ static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *pi img->widthStep = picref->linesize[0]; } -static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage *img, enum PixelFormat pixfmt) +static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage *img, enum AVPixelFormat pixfmt) { picref->linesize[0] = img->widthStep; picref->data[0] = img->imageData; @@ -60,8 +60,8 @@ static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_GRAY8, PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index ccb4e1b31f..9f3cfe1a23 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -144,26 +144,26 @@ static av_cold void uninit(AVFilterContext *ctx) } #define YUV_FORMATS \ - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, \ - PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUV440P, \ - PIX_FMT_YUVA420P, \ - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, \ - PIX_FMT_YUVJ440P + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, \ + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, \ + AV_PIX_FMT_YUVA420P, \ + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, \ + AV_PIX_FMT_YUVJ440P #define RGB_FORMATS \ - PIX_FMT_ARGB, PIX_FMT_RGBA, \ - PIX_FMT_ABGR, PIX_FMT_BGRA, \ - PIX_FMT_RGB24, PIX_FMT_BGR24 + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, \ + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, \ + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24 -static enum PixelFormat yuv_pix_fmts[] = { YUV_FORMATS, PIX_FMT_NONE }; -static enum PixelFormat rgb_pix_fmts[] = { RGB_FORMATS, PIX_FMT_NONE }; -static enum PixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, PIX_FMT_NONE }; +static enum AVPixelFormat yuv_pix_fmts[] = { YUV_FORMATS, AV_PIX_FMT_NONE }; +static enum AVPixelFormat rgb_pix_fmts[] = { RGB_FORMATS, AV_PIX_FMT_NONE }; +static enum AVPixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, AV_PIX_FMT_NONE }; static int query_formats(AVFilterContext *ctx) { LutContext *lut = ctx->priv; - enum PixelFormat *pix_fmts = lut->is_rgb ? rgb_pix_fmts : + enum AVPixelFormat *pix_fmts = lut->is_rgb ? rgb_pix_fmts : lut->is_yuv ? yuv_pix_fmts : all_pix_fmts; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); @@ -223,13 +223,13 @@ static int config_props(AVFilterLink *inlink) lut->var_values[VAR_H] = inlink->h; switch (inlink->format) { - case PIX_FMT_YUV410P: - case PIX_FMT_YUV411P: - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV440P: - case PIX_FMT_YUV444P: - case PIX_FMT_YUVA420P: + case AV_PIX_FMT_YUV410P: + case AV_PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV440P: + case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_YUVA420P: min[Y] = min[U] = min[V] = 16; max[Y] = 235; max[U] = max[V] = 240; @@ -246,12 +246,12 @@ static int config_props(AVFilterLink *inlink) if (lut->is_rgb) { switch (inlink->format) { - case PIX_FMT_ARGB: lut->rgba_map[A] = 0; lut->rgba_map[R] = 1; lut->rgba_map[G] = 2; lut->rgba_map[B] = 3; break; - case PIX_FMT_ABGR: lut->rgba_map[A] = 0; lut->rgba_map[B] = 1; lut->rgba_map[G] = 2; lut->rgba_map[R] = 3; break; - case PIX_FMT_RGBA: - case PIX_FMT_RGB24: lut->rgba_map[R] = 0; lut->rgba_map[G] = 1; lut->rgba_map[B] = 2; lut->rgba_map[A] = 3; break; - case PIX_FMT_BGRA: - case PIX_FMT_BGR24: lut->rgba_map[B] = 0; lut->rgba_map[G] = 1; lut->rgba_map[R] = 2; lut->rgba_map[A] = 3; break; + case AV_PIX_FMT_ARGB: lut->rgba_map[A] = 0; lut->rgba_map[R] = 1; lut->rgba_map[G] = 2; lut->rgba_map[B] = 3; break; + case AV_PIX_FMT_ABGR: lut->rgba_map[A] = 0; lut->rgba_map[B] = 1; lut->rgba_map[G] = 2; lut->rgba_map[R] = 3; break; + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_RGB24: lut->rgba_map[R] = 0; lut->rgba_map[G] = 1; lut->rgba_map[B] = 2; lut->rgba_map[A] = 3; break; + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_BGR24: lut->rgba_map[B] = 0; lut->rgba_map[G] = 1; lut->rgba_map[R] = 2; lut->rgba_map[A] = 3; break; } lut->step = av_get_bits_per_pixel(desc) >> 3; } diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c index e2d34a7c4e..f0b58427a7 100644 --- a/libavfilter/vf_overlay.c +++ b/libavfilter/vf_overlay.c @@ -98,8 +98,8 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - const enum PixelFormat inout_pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; - const enum PixelFormat blend_pix_fmts[] = { PIX_FMT_YUVA420P, PIX_FMT_NONE }; + const enum AVPixelFormat inout_pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; + const enum AVPixelFormat blend_pix_fmts[] = { AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE }; AVFilterFormats *inout_formats = ff_make_format_list(inout_pix_fmts); AVFilterFormats *blend_formats = ff_make_format_list(blend_pix_fmts); @@ -208,11 +208,11 @@ static void blend_frame(AVFilterContext *ctx, start_y = FFMAX(y, 0); height = end_y - start_y; - if (dst->format == PIX_FMT_BGR24 || dst->format == PIX_FMT_RGB24) { + if (dst->format == AV_PIX_FMT_BGR24 || dst->format == AV_PIX_FMT_RGB24) { uint8_t *dp = dst->data[0] + x * 3 + start_y * dst->linesize[0]; uint8_t *sp = src->data[0]; - int b = dst->format == PIX_FMT_BGR24 ? 2 : 0; - int r = dst->format == PIX_FMT_BGR24 ? 0 : 2; + int b = dst->format == AV_PIX_FMT_BGR24 ? 2 : 0; + int r = dst->format == AV_PIX_FMT_BGR24 ? 0 : 2; if (y < 0) sp += -y * src->linesize[0]; for (i = 0; i < height; i++) { diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 8adab3bb8b..a852b0db5c 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -73,19 +73,19 @@ enum var_name { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, - - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, + + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 4941e8dd4c..568a42bced 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -123,12 +123,12 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { AVFilterFormats *formats; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; int ret; if (ctx->inputs[0]) { formats = NULL; - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if ( sws_isSupportedInput(pix_fmt) && (ret = ff_add_format(&formats, pix_fmt)) < 0) { ff_formats_unref(&formats); @@ -138,7 +138,7 @@ static int query_formats(AVFilterContext *ctx) } if (ctx->outputs[0]) { formats = NULL; - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if ( sws_isSupportedOutput(pix_fmt) && (ret = ff_add_format(&formats, pix_fmt)) < 0) { ff_formats_unref(&formats); diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c index 8135f5b74f..a8ef440b36 100644 --- a/libavfilter/vf_transpose.c +++ b/libavfilter/vf_transpose.c @@ -65,28 +65,28 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, - PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, - PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, - PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, - PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, - PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, - PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE, - PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, - PIX_FMT_NV12, PIX_FMT_NV21, - PIX_FMT_RGB8, PIX_FMT_BGR8, - PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, PIX_FMT_GRAY8, - PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE, + AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE, + AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE, + AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE, + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE, + AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE, + AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE, + AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE, + AV_PIX_FMT_NV12, AV_PIX_FMT_NV21, + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, + AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index 6140c75a87..7db76d43d8 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -159,10 +159,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_YUV410P, - PIX_FMT_YUV411P, PIX_FMT_YUV440P, PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index 22a55be829..abb7812ce1 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -357,27 +357,27 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, - PIX_FMT_YUV422P, - PIX_FMT_YUV444P, - PIX_FMT_YUV410P, - PIX_FMT_YUV411P, - PIX_FMT_GRAY8, - PIX_FMT_YUVJ420P, - PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ444P, - AV_NE( PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE ), - PIX_FMT_YUV440P, - PIX_FMT_YUVJ440P, - AV_NE( PIX_FMT_YUV420P10BE, PIX_FMT_YUV420P10LE ), - AV_NE( PIX_FMT_YUV422P10BE, PIX_FMT_YUV422P10LE ), - AV_NE( PIX_FMT_YUV444P10BE, PIX_FMT_YUV444P10LE ), - AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ), - AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ), - AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ), - PIX_FMT_YUVA420P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV411P, + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ444P, + AV_NE( AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE ), + AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ440P, + AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ), + AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ), + AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ), + AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ), + AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ), + AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ), + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/video.c b/libavfilter/video.c index 4afce99fb1..1710126697 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -99,7 +99,7 @@ AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link, int perms, in AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms, - int w, int h, enum PixelFormat format) + int w, int h, enum AVPixelFormat format) { AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer)); AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef)); diff --git a/libavfilter/vsrc_color.c b/libavfilter/vsrc_color.c index 964213fb22..9df81ad19f 100644 --- a/libavfilter/vsrc_color.c +++ b/libavfilter/vsrc_color.c @@ -93,19 +93,19 @@ static av_cold void color_uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, - - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, + + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c index 78e1642bac..7479a3cc8c 100644 --- a/libavfilter/vsrc_movie.c +++ b/libavfilter/vsrc_movie.c @@ -203,7 +203,7 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { MovieContext *movie = ctx->priv; - enum PixelFormat pix_fmts[] = { movie->codec_ctx->pix_fmt, PIX_FMT_NONE }; + enum AVPixelFormat pix_fmts[] = { movie->codec_ctx->pix_fmt, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index bbfd39a7a9..3177263e76 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -352,8 +352,8 @@ static av_cold int test_init(AVFilterContext *ctx, const char *args) static int test_query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGB24, PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; @@ -397,29 +397,29 @@ static const AVClass rgbtestsrc_class = { #define A 3 static void rgbtest_put_pixel(uint8_t *dst, int dst_linesize, - int x, int y, int r, int g, int b, enum PixelFormat fmt, + int x, int y, int r, int g, int b, enum AVPixelFormat fmt, int rgba_map[4]) { int32_t v; uint8_t *p; switch (fmt) { - case PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break; - case PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break; - case PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break; - case PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break; - case PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break; - case PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break; - case PIX_FMT_RGB24: - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break; + case AV_PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break; + case AV_PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break; + case AV_PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break; + case AV_PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break; + case AV_PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break; + case AV_PIX_FMT_RGB24: + case AV_PIX_FMT_BGR24: v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8)); p = dst + 3*x + y*dst_linesize; AV_WL24(p, v); break; - case PIX_FMT_RGBA: - case PIX_FMT_BGRA: - case PIX_FMT_ARGB: - case PIX_FMT_ABGR: + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_ARGB: + case AV_PIX_FMT_ABGR: v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8)); p = dst + 4*x + y*dst_linesize; AV_WL32(p, v); @@ -458,13 +458,13 @@ static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args) static int rgbtest_query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGBA, PIX_FMT_ARGB, PIX_FMT_BGRA, PIX_FMT_ABGR, - PIX_FMT_BGR24, PIX_FMT_RGB24, - PIX_FMT_RGB444, PIX_FMT_BGR444, - PIX_FMT_RGB565, PIX_FMT_BGR565, - PIX_FMT_RGB555, PIX_FMT_BGR555, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGBA, AV_PIX_FMT_ARGB, AV_PIX_FMT_BGRA, AV_PIX_FMT_ABGR, + AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, + AV_PIX_FMT_RGB444, AV_PIX_FMT_BGR444, + AV_PIX_FMT_RGB565, AV_PIX_FMT_BGR565, + AV_PIX_FMT_RGB555, AV_PIX_FMT_BGR555, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; @@ -475,12 +475,12 @@ static int rgbtest_config_props(AVFilterLink *outlink) TestSourceContext *test = outlink->src->priv; switch (outlink->format) { - case PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break; - case PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break; - case PIX_FMT_RGBA: - case PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break; - case PIX_FMT_BGRA: - case PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break; + case AV_PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break; + case AV_PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break; + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break; + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break; } return config_props(outlink); |