cameraservice: Resolve message vs start/stop preview races

Move the mutex in start/stopPreview to include the metadata message
management. Fast start/stop sequences could (and would) eventually
cause the messages to be enabled/disabled out of sequence (or while
the camera wasn't ready for it)

Fixes BACON-173

Change-Id: I367bc45729ce2e858fea972f35e881a755c6021a
libstagefright: stop audio source before deleting AudioPlayer

-audio source won't be stopped during AudioPlayer destruction
 due to start failed and AUDIOPLAYER_STARTED not set
-handle audio source stop in AwesomePlayer if AUDIOPLAYER_STARTED
 not set

Change-Id: I395c045a0a8a5d5b6ea8cc762d6a2636bb885b0e
CRs-Fixed: 704605
libstagefright: fix drainInputBuffers for FlushCompleteEmulation Quirk

Codecs which use the "requires-flush-complete-emulation" require
flushing (draining) the buffers before filling them. The change
"accelerate camera recording start up speed" has changed the order
of filling and draining the buffers which doesn't work well with
the FlushCompleteEmulation quirk

Change-Id: I78193f0aca4a85455393a4cf20d33b919ea6a57e
stagefright: update OMAP3 h264 codec data construction

Changes are based on gingerbread branch and they help improve
video stuttering on OMAP3.

Change-Id: Ic886a4c555c2a7a41204e7a18f38560744b782f6
libstagefright: update OMAP3 support

* Move the OMAP_ENHANCENEMENT flag to make sure that the
  buffer is not modified futher on.
* Don't queue more than 4 buffers to the component. This
  greatly improved the video recording framerates both for
  480P and 720P.

Change-Id: Iacc983214d873099e8f6218f374717a2ae4ffcc8