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
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
 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.

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
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 changes I74f843fe,Ib824f3a6,I1bd5f2cc,I4d081d34,Ic69e45f4 into du44

* changes:
  stagefright: update support for omap3 decoders and encoders
  libstagefright: Fix app crash during pcm offload playback
   libstagefright: Use channel count if channel mask is zero.
  libstagefright: Fix incorrect comparison of mimetype
  audio:Avoid AudioTrackThread if Track creation fails