SampleTable: check integer overflow during table alloc

Bug: 15328708
Bug: 15342615
Bug: 15342751
Change-Id: I6bb110a1eba46506799c73be8ff9a4f71c7e7053
(cherry picked from commit edd4a76eb4747bd19ed122df46fa46b452c12a0d)
stagefright: Allow devices to use older widevine blobs

Devices may have widevine plugins built with an older MediaSource
interface.  Trying to use them fails because of the change in
interface in the object (it calls the destructor in the blob when
attempting to call setBuffers).

This commit restores the interface for ! QCOM_HARDWARE devices.

Fixes: JIRA-4944.

Change-Id: I4ce24a16f3eceab0c4def4b09850ed569eb392ab
libstagefright: Adds some parsing capability

o Adds AC3, EAC3 and DTS mime types
o Adds AC3/EAC3 support in MP4 parser
o Adds MPEG4 video, MPEG Audio, AC3, DTS, EAC3 support
in mkv extractor.

Change-Id: I9895c0e40e5ad38976004a9569200f1340d525de
Audio stops after seeking AVI clip with MP3 audio (special contents without proper key samples)

During seek in AVI, nearest Sync sample was searched both for
audio and video. Sync samples are useful only in case of
video. We can ignore Sync field for non-video tracks.

Change-Id: Ibaeda8f14afb83905e19087625a7d72fb1b3c8d6
Signed-off-by: Arulselvan M <arulselvan.m@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Correct the time returned by AudioPlayer::getMediaTime

The change 80a68deec52c9a1b47215ed68526206ec88197f8 was added to
eliminate returning negative media positions.

In the change all negative values of realTimeOffset were discarded.
The value realTimeOffset accounts for the latency and the
number of samples played since last feeding the AudioTrack and is
generally negative. By discarding this value for negative values the
time returned does not account for latency or the number of samples
played.

Change-Id: I470450934228732e34539c227365a225be74ccc8
stagefright: Fix seeking in MPEG4 container - do not merge

- seek based on user-visible timestamp
- seek to previous, next and closest exactly
- also update OggExtractor seek to same logic

Bug: 12786906
Change-Id: I2d5e1fbff6469b6f081a284be2222a4cb50aa754
stagefright: Enable 24-bit mode for DTS audio

 * FFMPEG will convert floating point samples to 24-bit PCM
   if the system is capable of it.

Change-Id: I14fb015468166e567a17bf8758474788e1c285e9
av: audioflinger: Fix SRS build

Change-Id: I1c8bbf62e2a96ce7ccf303427d18a542dbbc0af2
audioflinger: Allow FAST tracks for any supported sample rate

Change-Id: I3c749c8ec5d3b372ed186fb2e706fcbd63e07625
stagefright: More high-resolution audio support

 * Clean up the "error driven" fallback code we had before and
   reconfigure components if the output bit width needs to change
   (a2dp/usb fallback).
 * Decode various formats (AC3/DTS/EAC3) which output floating point
   samples using FFMPEG, which will output 24-bit PCM for us.

Change-Id: I94f5fa59f5f737be8969df4c5ad4295c45cb8657
stagefright: Use multiaac decoder for multiaac :)

 * Fix the channel count and use the non-OMX multiaac codec.
 * This fixes a DSP crash with certain files.

Change-Id: I7fe14b7b647db8017724676f87c083301c2295a8
audio: Audio resampler support for 192Khz playback

-Current AudioResampler limits input sampling rate to be
maximum of twice of output sampling rate to downsample.
The output sampling rate being 48khz, maximum input sampling
rate that be supported is 96khz.
Support is added to use qti resampler for playback upto 192khz.

Change-Id: Ia8f24a0874ebf6e16ef7bd1f2759a14f47149875
stagefright: Resolve turf war between FFMPEG and mm-parser

 * There is overlap between the supported codecs, and the extractors
   generally do the right thing. The current code will blindly call
   into the FFMPEG specific functions when some QC codec should
   be used though, so add checks on the component name first.
 * This resolves hitting asserts when using hardware WMA/WMV codecs.
 * Also add a contraint to block the VC1 codec from try to play ancient
   WMV formats, as it will fail.

Change-Id: I3b8aafaef7ae7c0f2e058f78b043380f04a41e73
libmedia: Add flag for non-native FAST tracks.

Change-Id: Ied9004c0bdc6314541b12095ca1defd0f291eb1a