vda: fix chroma issue with vda upload

GL_YCBCR_422_APPLE need a GL_RGB internal format not GL_RGBA
vda: cvref textures are non power of two so don't allocate extra space
vda: use IOSurfaceGetPixelformat instead of CVPixelBufferGetPixelFormatType

We have converted the texture to an IOSurfaceRef so use that to check
for format.
vda: allocate pot texture if requested
vda: switch cvref rendering over to standard UYVY422 renderer

This gives brightness/contrast/scaling support. The fallback to
old style upload is dropped since GL_YCBCR_422_APPLE
is no longer used.
[ffmpeg/vda] - update for current used ffmpeg (2.2)
vda: allow 3 render buffers
vda: if no image is returned, we must still reset cv_buffer

This is used unconditinolly by ffmpeg, and if not cleared here an
old already released frame may end up being used.
vda: upgrade to hwaccel2 interface
ffmpeg: if a second GetFormat dis-allow hwaccel, we must restore ffmpeg

This fixes errors in the case that a second instance of a decoder fails, then we must fall back to software again.
gl: multipass renderer would use wrong source pixels sizes

The scaling was inverted for pixel coordinate.
gl: multipass renderer was broken when RECT textures was used as source

FBO is now always rendered with non rect texture target, even if source
is rect.
fixed compilation error with undefined ARRAY_SIZE

Signed-off-by: Andriy Prystupa <andriy.prystupa@globallogic.com>
[linux] systemd-coredumpctl was renamed to coredumpctl, support both in kodi.sh
[Fix] Manually activated subs, if classified as irrelevant, were not shown on resume.
This is fixed by saving the subtitle's index upon manual activation.
[AE/CA] - constify getName of CADevice
[AE/CA] - fix regression introduced in the enumeration refactor - handle "hackintosh" audio devices with "digital" in the name as digital devices
vda: only allow ffmpeg VDA when advanced setting enable it

It currently cause corruption during playback of some files
fixed: quell printf format warnings
copy: support chunked reads so that CFile internal buffer is eliminated

This eliminates memory copies cpu overhead by multiple calls.