summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-29 17:39:57 +0100
committerwm4 <wm4@nowhere>2013-11-29 17:39:57 +0100
commit597b8a355002306486c5d4a19890bb403b5d3ded (patch)
tree17de2fbbb77868cb184b6a0f2eca5fffd14d2e9b /video/decode
parentf1072e7629c56e6fdd9aab40be15fe9800789b1a (diff)
downloadmpv-597b8a355002306486c5d4a19890bb403b5d3ded.tar.bz2
mpv-597b8a355002306486c5d4a19890bb403b5d3ded.tar.xz
Take care of some libavutil deprecations, drop support for FFmpeg 1.0
PIX_FMT_* -> AV_PIX_FMT_* (except some pixdesc constants) enum PixelFormat -> enum AVPixelFormat Losen some version checks in certain newer pixel formats. av_pix_fmt_descriptors -> av_pix_fmt_desc_get This removes support for FFmpeg 1.0.x, which is even older than Libav 9.x. Support for it probably was already broken, and its libswresample was rejected by our build system anyway because it's broken. Mostly untested; it does compile with Libav 9.9.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/lavc.h2
-rw-r--r--video/decode/vd_lavc.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h
index 2fdfae41f1..5007b80a0f 100644
--- a/video/decode/lavc.h
+++ b/video/decode/lavc.h
@@ -27,7 +27,7 @@ typedef struct lavc_ctx {
AVCodecContext *avctx;
AVFrame *pic;
struct vd_lavc_hwdec *hwdec;
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
int do_hw_dr1;
int best_csp;
struct mp_image_params image_params;
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 32bbca969f..868f148d8b 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -65,8 +65,8 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
static void uninit_avctx(struct dec_video *vd);
static void setup_refcounting_hw(struct AVCodecContext *s);
-static enum PixelFormat get_format_hwdec(struct AVCodecContext *avctx,
- const enum PixelFormat *pix_fmt);
+static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx,
+ const enum AVPixelFormat *pix_fmt);
static void uninit(struct dec_video *vd);
@@ -383,7 +383,7 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
ctx->hwdec_info = &vd->hwdec_info;
ctx->do_dr1 = ctx->do_hw_dr1 = 0;
- ctx->pix_fmt = PIX_FMT_NONE;
+ ctx->pix_fmt = AV_PIX_FMT_NONE;
ctx->image_params = (struct mp_image_params){0};
ctx->vo_image_params = (struct mp_image_params){0};
ctx->hwdec = hwdec;
@@ -542,20 +542,20 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame)
};
}
-static enum PixelFormat get_format_hwdec(struct AVCodecContext *avctx,
- const enum PixelFormat *fmt)
+static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx,
+ const enum AVPixelFormat *fmt)
{
struct dec_video *vd = avctx->opaque;
vd_ffmpeg_ctx *ctx = vd->priv;
mp_msg(MSGT_DECVIDEO, MSGL_V, "Pixel formats supported by decoder:");
- for (int i = 0; fmt[i] != PIX_FMT_NONE; i++)
+ for (int i = 0; fmt[i] != AV_PIX_FMT_NONE; i++)
mp_msg(MSGT_DECVIDEO, MSGL_V, " %s", av_get_pix_fmt_name(fmt[i]));
mp_msg(MSGT_DECVIDEO, MSGL_V, "\n");
assert(ctx->hwdec);
- for (int i = 0; fmt[i] != PIX_FMT_NONE; i++) {
+ for (int i = 0; fmt[i] != AV_PIX_FMT_NONE; i++) {
const int *okfmt = ctx->hwdec->image_formats;
for (int n = 0; okfmt && okfmt[n]; n++) {
if (imgfmt2pixfmt(okfmt[n]) == fmt[i])
@@ -563,7 +563,7 @@ static enum PixelFormat get_format_hwdec(struct AVCodecContext *avctx,
}
}
- return PIX_FMT_NONE;
+ return AV_PIX_FMT_NONE;
}
static struct mp_image *get_surface_hwdec(struct dec_video *vd, AVFrame *pic)