am7xxx-play: stop using avcodec_decode_video2() and avcodec_encode_video2()
authorAntonio Ospite <ao2@ao2.it>
Wed, 28 Feb 2018 15:23:34 +0000 (16:23 +0100)
committerAntonio Ospite <ao2@ao2.it>
Thu, 1 Mar 2018 15:12:16 +0000 (16:12 +0100)
commit47b30f6e7242156524a793fd91234d95f92cf3a1
tree0c46e555d125fb33ababcbb5510a85631f654850
parentca8e35d5dcc10f8f00e4852d2e02390e9c338265
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,
       ^~~~~~~~~~~~~~~~~~~~~
examples/am7xxx-play.c