summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-03-06 21:47:20 +0100
committerAlfred E. Heggestad <aeh@db.org>2016-03-06 21:47:20 +0100
commit8120bb5a4e7d1d2da630cf901a1555bc13dfba1b (patch)
treebb3df632f17eea644177be0858dac52e7256d2a8 /modules
parent8d4a758aa8eca267201744edd06012610cbfc22c (diff)
avformat: use new type AV_PIX_FMT_YUV420P (ref issue #114)
Diffstat (limited to 'modules')
-rw-r--r--modules/avformat/avformat.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/avformat/avformat.c b/modules/avformat/avformat.c
index cabb103..c4566b5 100644
--- a/modules/avformat/avformat.c
+++ b/modules/avformat/avformat.c
@@ -56,6 +56,11 @@
#endif
+#if LIBAVUTIL_VERSION_MAJOR < 52
+#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
+#endif
+
+
struct vidsrc_st {
const struct vidsrc *vs; /* inheritance */
pthread_t thread;
@@ -151,14 +156,14 @@ static void handle_packet(struct vidsrc_st *st, AVPacket *pkt)
st->sws = sws_getContext(st->sz.w, st->sz.h,
st->ctx->pix_fmt,
st->app_sz.w, st->app_sz.h,
- PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV420P,
SWS_BICUBIC,
NULL, NULL, NULL);
if (!st->sws)
return;
}
- ret = avpicture_alloc(&pict, PIX_FMT_YUV420P,
+ ret = avpicture_alloc(&pict, AV_PIX_FMT_YUV420P,
st->app_sz.w, st->app_sz.h);
if (ret < 0)
return;
@@ -170,7 +175,7 @@ static void handle_packet(struct vidsrc_st *st, AVPacket *pkt)
goto end;
}
else {
- avpicture_fill(&pict, pkt->data, PIX_FMT_YUV420P,
+ avpicture_fill(&pict, pkt->data, AV_PIX_FMT_YUV420P,
st->sz.w, st->sz.h);
}
@@ -281,7 +286,7 @@ static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs,
prms.channels = 1;
prms.width = size->w;
prms.height = size->h;
- prms.pix_fmt = PIX_FMT_YUV420P;
+ prms.pix_fmt = AV_PIX_FMT_YUV420P;
prms.channel = 0;
ret = av_open_input_file(&st->ic, dev, av_find_input_format(fmt),