Since FFmpeg 3.1, the preferred mechanism for encoding / decoding audio and video is using a send / receive mechanisms instead of calling avcodec_xxx_encode and avcodec_xxx_decode methods.
Now that our baseline is FFmpeg 3.2 we can remove the legacy code, which fixes a number of deprecation warnings.