libav*: create a new avcommon_compat.h file for backward compatibility

This patch includes necessary defines
Avcodec: create replacements for older versions of lavc

Methods avcodec_alloc_context3, avcodec_open2 and error_recognition
member
Partial revert of "avcodec: remove support for old versions"

This partially reverts and adapts commit cde81e52f2d6e17383aced57fe6312eafa79cacf.
This is mostly related to Palette and Options

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Configure: allow older versions for libavcodec
Configure: vaapi and vdpau need avcodec

Should fix distcheck
contrib: vpx: missing header
VPX: try to fix mountain lion patch
libvlccore: remove duplicate ldflags
opengl: Fix the ES 1 vs 2 version check

The version string for ES 1 is "OpenGL ES-CM 1.x" or
"OpenGL ES-CL 1.x". For ES 2 it is "OpenGL ES 2.0", while it
seems to be only "3.x" for ES 3.

Since the code is mostly built for either ES 1 or ES 2 (only
Apple support targeting both at the same time, from the same
built object code - but we only use ES 2 on iOS), simplify
this down to a compile time decision.

Signed-off-by: Martin Storsjö <martin@martin.st>
opengl: Make the ES1/ES2 video output work

This mostly consists of ifdeffing out parts selectively from
opengl.c based on whether shaders or the fixed pipeline are
absent.

Both the ES1 and ES2 outputs have been tested on Ubuntu on
a pandaboard. They seem to mostly work fine, but overlay
subpictures seem garbled.

Signed-off-by: Martin Storsjö <martin@martin.st>
opengl: Take w.num into account when calculating the buffer size

Signed-off-by: Martin Storsjö <martin@martin.st>
Don't leak -lmingw32 in LIBS
Don't automatically enable the gles video outputs

They still lack features such as window sizing and mouse events.

Signed-off-by: Martin Storsjö <martin@martin.st>
avcodec: use encode_video2 if available

closes #8291
allow sout for avcodec>=55
Contribs: fix vpx threading on Win32
Win32: move MessageBox error from libVLC to vlc.exe

One might want to handle libvlc creation errors in a different way
Contribs: build shout without threads on Windows
avformat: set pf_* after everything else in init
avformat: set stream sar.den as we set sar.num also