mediacodec: use a dynamic array for inflight pictures.

Starting API 21, the way to know the number of output buffers is deprecated.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
mediacodec: lock InsertInflightPicture

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
mediacodec: add member.critical

Fail only if a critical method is not found.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
mediacodec: fix deprecated calls if API >= 21

Use getInputBuffer and getOutputBuffer instead of getInputBuffers and
getOutputBuffers.

see http://developer.android.com/reference/android/media/MediaCodec.html

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
android/surface: fix prototype

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
swscale: fix memory corruption when i_extend_factor != 1

This led to a random crash when resizing video on a small display (or when
resizing small video).

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>