DataSource: Remove global variables in DataSource related to sniff

Removed global variables related to sniff, and added Sniffer class
to implement the sniff functionality with non-static members.

Change-Id: I6fbd0ba5b686e09fda11d78cdd687a69c81a6bdf
CRs-Fixed: 567753
libstagefright: Add MPEG2 Codec support

Enables playback support for MPEG2 Codec to play specific ts content

CRs-Fixed: 631693
Change-Id: I96e44b1f1f26ea138802d8d75f1784a06dd8dc6b
libstagefright: Fix crash while setting buffer size

The format returned from MakeAVCCodecSpecificData may be
NULL and will crash on trying to set buffer size.

Added NULL check to avoid crash

Change-Id: I45485f820a6aa657e63aeeb6dd43061a2e3575e3
CRs-Fixed: 644331
libeffect: Fix enabled effect count calculation error

When switching from tunnel to arm effects, effect chain will be moved
from offload thread to mixer thread. During this procedure effect instance
is not destroyed, instead it's preserved and mounted onto new chain.

The migrant sequence is 1) disable instance -> 2) move to new effect
chain -> 3) enable instance again. However, the accumulated effect
enabled count is not decreased when effect instance is disabled.

As a result, LvmBundle_process() is only called once when Effect_process()
called twice, which causes input buffer get processed alternately and
glitch sound appears.

Change-Id: Idd3b8753a73694cc36617ed55b40fda93155abed
CRs-Fixed: 636353
libmedia: Add timelapse profiles for 4k sizes

 The encoder profiles need to be extended to
 support 4k resolutions during timelapse as well.

Change-Id: If67ef1cca45bc61ce1d08bcd5b33adcf22ed8751
CRs-Fixed: 642013
disable camera sounds (3/3)

Change-Id: Iff4eb5ca7dd13038bf852a76d0c605814864497a
Signed-off-by: Jonathan Steadman <xxwhitehawk@gmail.com>
screenrecord: Add audio support

Adds audio recording to the screenrecord system. Note that
while recording, the audio is muted from the device output,
and that the audio volume is controlled separately (so make
sure to turn up your volume if you hear nothing).
Audio from the microphone can also be recorded by adding
--microphone to the command line.

Change-Id: I97dfcaf3d93b786c5466e1f4215549e3d015bcf0
screenrecord: Enable SUBMIX_IN as well and cleanup on exit

While on Nexus 5/Nexus 7 (AOSP QCOM audio), trying to turn on
SUBMIX_IN fails and is not needed, it is required on Find 5
and N1 (CAF QCOM audio), or otherwise SUBMIX_OUT won't turn
on.
We also now release the audio routing as it wouldn't revive
the audio speakers otherwise.

Change-Id: I0f80a232304733e0b0a834b188b8cfa5b88915f3
Revert "libstagefright: Re-introduce a QCOM_HARDWARE ifdef after the FFMPEG commit"

This reverts commit 90044a90c66510274794ce6c3b7ad55f817b0165.
Revert "DataSource: Remove global variables in DataSource related to sniff"

This reverts commit 339771454adee792ec2d72f97ffae31d26ded4f2.
Revert "libstagefright: Extended media support via FFMPEG"

This reverts commit 3113d5d9c90adde859d62a48832fb3ca1d30b1a8.
Revert "libstagefright: Add MPEG2 Codec support"

This reverts commit c2cbd9c588753e80d3c17e246ecbc385b6fd01ec.