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,
^~~~~~~~~~~~~~~~~~~~~