I build FFmpeg for iOS and have enabled VideoToolbox, but when decoding video use function avcodec_decode_video2, it doesn't use VideoToolbox and very slow on iPhone. I use the example demuxing_decoding here: https://ffmpeg.org/doxygen/trunk/demuxing_decoding_8c-example.html and have try to setup VideoToolbox decoding without success.
Have anyone encountered that problem?