[rbp] Restructure the egl context and display variables

Using a global for context that gets set by the first run of the
texture thread is risky if the first function call happens directly
(if it's in a suitable thread so bypasses the texture thread).
[rbp] Use generic texture queue for alloc/destroy

This avoids a subtle bug where one thread calls tex->Sync.Set()
and another calls tex->sync.Wait(); delete tex;

The Set can cause a task switch before the Set call exits.
If the freed tex structure is overwritted before the first thread
is switched back to, it can crash or hang.
[rbp] Fix leaks in the failure handling of jpeg decode to texture

There are a couple of cases where memory could be leaked after an allocation failure
when decoding jpegs to textures.
[omxcodec] Add hardware decode to dvdplayer for Pi

Hijack the abandoned OpenMaxVideo codec
[omxcodec] Enable for dvd menus
[omxcodec] Add omx specific texture create/upload/delete functions
[omxcodec] Add shared pointer to delay shutdown of codec until buffers are returned
[omxcodec] Fix for aspect ratio in non-square pixel modes
[omxcodec] Report error when codec not enabled
[omxcodec] Add deinterlace support
Improved file buffering in CArchive.

CArchive already did some file buffering, but only on writes. Added the
equivalent code for reads. Also improved the write buffer case so that it
only ever issues sector-aligned writes (the read code does this from the
start). Shuffled various bits of code into the header file to squeeze a bit
more performance out of it.

Profiled the effect on CFileItemList::Archive(), which is one of the slow
parts of the process of reopening a media library, on a non-overclocked
Raspberry Pi. Times are in seconds:

TV shows (253 items)

Before          After
Mean   StdDev   Mean   StdDev  Confidence  Change
0.394  0.005    0.151  0.005   100.0%      +159.8%

Songs (4115 items)

Before          After
Mean   StdDev   Mean   StdDev  Confidence  Change
2.931  0.045    0.690  0.019   100.0%      +324.4%
[rbp/settings] Allow av sync type to be enabled

It works for dvdplayer
[omxcodec] Only do essential calls in texture thread
[omxcodec] Fix for files with no valid pts values.
[omxcodec] Fix stall on seek/trickplay - need to reset start flag
[omxcodec] Make sure we have a valid context when video decode starts before first fanart is decoded
[omxcodec] More care with dropping frames quickly
[omxplayer] Allow small audio packets to be concatenated to make better use of audio fifo

Some audio codecs produce small packets which causes a high overhead when submitting to GPU, and doesn't make full use of GPU side buffering.
TrueHD in particular can produce packets with 40 samples (so 1200 packets per second) which causes very high overhead.

What this aims to do is to concatenate audio packets until they approach the ideal audio packet size,
and then deal with the awkardness of concatenated planar formats.
[omxplayer] Use media for determing audio delay and cache time

I've also added caching to the call to OMXMediaTime as the GPU round trip is expensive when called too frequently
[omx] Skip the resize when not needed when decoding jpegs

The decode to texture path almost always uses cached jpegs that are the correct size, so the resize is rarely needed.
The re-enc path usually needs resizing, but may not where the source is small.

Skipping the resize stage saves a little time and memory on GPU and also saves some setup time.
[hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options
[dvdplayer] Use inexact seeking like omxplayer
[omxplayer] Make use of TrueHD fastpath when downmixing

The TrueHD codec actually works in 3 stages. It decodes the downmixed stereo. It then decodes the differences required to produce 5.1.
It then decodes the differences required to produce 7.1.

Many users end up downmixing this 7.1 stream back to 2.0.
Much better to tell the codec we only need the 2.0 stream. It saves about 50% of the CPU required
[omxplayer] When in dual audio mode, make one output the slave

May help audio sync between the two outputs