From: Antonio Ospite Date: Wed, 28 Feb 2018 15:23:34 +0000 (+0100) Subject: am7xxx-play: stop using avcodec_decode_video2() and avcodec_encode_video2() X-Git-Tag: v0.1.7~7 X-Git-Url: https://git.ao2.it/libam7xxx.git/commitdiff_plain/47b30f6e7242156524a793fd91234d95f92cf3a1?hp=47b30f6e7242156524a793fd91234d95f92cf3a1 am7xxx-play: stop using avcodec_decode_video2() and avcodec_encode_video2() Since FFMpeg 3.1, avcodec_decode_video2() and avcodec_encode_video2() have been deprecated in favor of the more generic send/receive API. Provide some wrappers to ease the transition between the two APIs. The change fixes the following warnings: .../libam7xxx/examples/am7xxx-play.c: In function ‘am7xxx_play’: .../libam7xxx/examples/am7xxx-play.c:372:3: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations] ret = avcodec_decode_video2(input_ctx.codec_ctx, frame_raw, &got_frame, &in_packet); ^~~ In file included from /usr/include/x86_64-linux-gnu/libavformat/avformat.h:319:0, from /usr/include/x86_64-linux-gnu/libavdevice/avdevice.h:51, from .../libam7xxx/examples/am7xxx-play.c:32: /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4993:5: note: declared here int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, ^~~~~~~~~~~~~~~~~~~~~ .../libam7xxx/examples/am7xxx-play.c:403:5: warning: ‘avcodec_encode_video2’ is deprecated [-Wdeprecated-declarations] ret = avcodec_encode_video2(output_ctx.codec_ctx, ^~~ In file included from /usr/include/x86_64-linux-gnu/libavformat/avformat.h:319:0, from /usr/include/x86_64-linux-gnu/libavdevice/avdevice.h:51, from .../libam7xxx/examples/am7xxx-play.c:32: /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:5508:5: note: declared here int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, ^~~~~~~~~~~~~~~~~~~~~ ---