[ffmpeg] - backport - avio: Add an internal function for reading without copying

As long as there is enough contiguous data in the avio buffer,
just return a pointer to it instead of copying it to the caller
provided buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
[ffmpeg] - backport - mpegts: Remove one memcpy per packet

This was being performed to ensure that a complete packet was held in
contiguous memory, prior to parsing the packet. However, the source buffer
is typically large enough that the packet was already contiguous, so it is
beneficial to return the packet by reference in most cases.

         Before          After
         Mean   StdDev   Mean   StdDev  Change
memcpy    720.7  32.7     649.8  25.1   +10.9%
Overall  2372.7  46.1    2291.7  21.8    +3.5%

Signed-off-by: Martin Storsjö <martin@martin.st>
[ffmpeg] - backport - mpegts: Make discard_pid() faster for single-program streams

When a stream contains a single program, there's no point in doing a
PID -> program lookup. Normally the one and only program isn't disabled,
so no packets should be discarded.

              Before          After
              Mean   StdDev   Mean   StdDev  Change
discard_pid()   73.8  9.4       20.2  1.5    +264.8%
Overall       2300.8 28.0     2253.1 20.6      +2.1%

Signed-off-by: Martin Storsjö <martin@martin.st>
[ffmpeg] - backport - mpegts: Remove one 64-bit integer modulus operation per packet

The common case of the pointer having increased by one packet (which results
in no change to the modulus) can be detected with a 64-bit subtraction,
which is far cheaper than a division on many platforms.

           Before          After
           Mean   StdDev   Mean   StdDev  Change
Divisions   248.3  8.8      51.5   7.4    +381.7%
Overall    2773.2 25.6     2372.5 43.1     +16.9%

Signed-off-by: Martin Storsjö <martin@martin.st>
[ffmpeg/patches] Add backported mpegts optimisations
jni: fix BitSet classname and missing setGlobal
jni: fix cursor long type
jni: fill in Surface class
jni: clean and fixup SurfaceTexture
jni: switch WifiConfiguration to getters and setters

It can be instantiated.
jni: add missing WifiManager functions
jni: add function for determining runtime sdk version in classes
jni: const'ify Intent as necessary
jni: add new classes
jni: hook up new classes
jni: fix forward-declare
jni: fixup stagefright after JNISurface change
jni: fixed local ref leak
Merge pull request #3075 from popcornmix/ffmpeg_mepgts

[ffmpeg] Backport of mpegts optimisations
Merge pull request #3081 from theuni/jni-update

Jni update