stagefright: update support for omap3 decoders and encoders

OMAP3 uses 2 decoders, 720P.Decoder and Video.Decoder.

720P.Decoder is proprietary OMAP3 decoder from ITTIAM. Only
one instance of the 720P decoder can run at a time due to memory
restrictions (512MB) and it's quite slow at thumbnail generation
and it's resource hungry.

Video.Decoder is opensource and could support WVGA resolutions.
It only supports baseline profile and max level 31 for AVC, but
could run 4 instances at the same time and is quite fast especially
for watching WhatsApp videos :P

Using the 720P decoder for low resolution videos is not optimal and
trying to use the Video.Decoder for videos other than Baseline profile
will crash the entire DSP and would require a reboot. Currently
stagefright uses codecs in the order they appear in media_codecs.xml
without querying the supported level and profile from the decoder,
due to which wrong codecs are selected causing problems.

Similarly there are 2 encoders, 720P.Encoder and Video.Encoder. They
support different resolutions and should be used selectively.

This patch has been forward ported from Gingerbread branch.

Change-Id: I74f843fe5d28faefa0b51191778ab2ee8c54f5f6
audio:Avoid AudioTrackThread if Track creation fails

-mAudioTrackThread is starting before the track creation.
 This thread is used to process the audio buffer, which
 is no longer valid if the track creation itself is
 failing.

-Fix is to check for the result of track creation and
 based on the result need to start the mAudioTrackThread.

Change-Id: Ic69e45f4269408ff60fe83390e9f8d0c895582e3
CRs-Fixed: 611668
stagefright: add ClockEstimator API and WindowedLinearFitEstimator

Change-Id: I74474c385848a8eab2ac0da7c069510378e2b217
Smooth out AwesomePlayer

Use clock estimator to smooth out audio time stamps.

Change-Id: Iec1ff30c011069d06ff8051fc4839d00895463d6
audioflinger: Stop resetting compress offload streams

 * This code should only be invoked for legacy DirectTrack.
 * Fixes issues with compress offload failing due to lack
   of metadata after skip / seek.

Change-Id: I4e2eef6421421532556ba411542cfe2f9c1e3802
libstagefright: Fix incorrect comparison of mimetype

'sizeof' is used to calculate length of string constant which returns
size of pointer to string constant. This causes comparison of only
four characters of mimetype. By using strlen, entire mimetype string
is compared - which returns correct result.

Change-Id: I4d081d3452f167d49aebbe3219e8e522ec29d5be
CRs-Fixed: 664311
 libstagefright: Use channel count if channel mask is zero.

-If the channel mask which is part of the meta data is zero use
 a valid channel count to update the channel mask.
-PCM offload playback for wav clips fails for some clips because
 channel mask part of the wave header is zero.

CRs-Fixed: 664374
Change-Id: I1bd5f2cc56fbc1eb9a6e04d219185690d3ce409c
libstagefright: Fix app crash during pcm offload playback

 -ANR is seen with trick mode operations during
  pcm offload playback.
 -If Player issues the read request to omx client while omx client is
  in pausing state, it moves the client to executing state if variable
  mPasued is true and it never returns from pause.
 -Do not set the variable mPaused to true while it is in pausing state.

Change-Id: Ib824f3a651f738be26df8906d7175eb59ce82fab
Merge "stagefright: update support for omap3 decoders and encoders" into cm-11.0
stagefright: update support for omap3 decoders and encoders

OMAP3 uses 2 decoders, 720P.Decoder and Video.Decoder.

720P.Decoder is proprietary OMAP3 decoder from ITTIAM. Only
one instance of the 720P decoder can run at a time due to memory
restrictions (512MB) and it's quite slow at thumbnail generation
and it's resource hungry.

Video.Decoder is opensource and could support WVGA resolutions.
It only supports baseline profile and max level 31 for AVC, but
could run 4 instances at the same time and is quite fast especially
for watching WhatsApp videos :P

Using the 720P decoder for low resolution videos is not optimal and
trying to use the Video.Decoder for videos other than Baseline profile
will crash the entire DSP and would require a reboot. Currently
stagefright uses codecs in the order they appear in media_codecs.xml
without querying the supported level and profile from the decoder,
due to which wrong codecs are selected causing problems.

Similarly there are 2 encoders, 720P.Encoder and Video.Encoder. They
support different resolutions and should be used selectively.

This patch has been forward ported from Gingerbread branch.

Change-Id: I74f843fe5d28faefa0b51191778ab2ee8c54f5f6
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_frameworks_av into cm