Increase buffer dequeue timeout when the codec needs to be drained as it
could happen that no input buffer is available when we receive a null
packet for the first time (meaning we are unable to signal end of stream
and mark the codec as draining).
Fixes potential loss of last frames after sending a null packet.
Allows to select a codec (encoder or decoder) only if it supports a
specific profile.
Adds ff_AMediaCodecProfile_getProfileFromAVCodecContext to convert an
AVCodecContext profile to a MediaCodec profile. It only supports H264
for now.
The codepath using MediaCodecList.findDecoderForFormat() (Android >= 5.0)
has been dropped as this method does not allow to select a decoder
compatible with a specific profile.
Codec width/height restrictions seem hardcoded at the OMX level and
seem arbitrary. Bypassing those restrictions allows a device to decode
streams at higher resolutions.
For example it allows a Nexus 5 to decode h264 streams with a resolution
higher than 1920x1080.