libstagefright: Return EOS after buffers are released

Return EOS from SurfaceMediaSource after buffers
have been released, due to disconnect from producer.

CRs-Fixed: 550868
Change-Id: I4b2f3ef1c2895f155260baa0c58d90df4b4210d9
libstagefright: Drain input buffer on resume

* Buffers returned from codec in paused state are
  not drained. When codec is resumed these buffers
  are not drained until the next flush, and may
  cause timed out issue.
* Added change to drain input buffers for sw
  decoders when resuming.

CRs-Fixed: 569585
CRs-Fixed: 574967
Change-Id: Ia62f03e025310457df57e3106575fcc011e64a54
camera: Add flag to leave preview metadata alone

 * This causes severe problems on a certain camera.

Change-Id: I5adaef00bba2eaa3cab09452ad7ed46e24ac5364
Revert "camera: Add flag to leave preview metadata alone"

This reverts commit a6e0b0ac42fc758ce6d26886c9a379e3e8fa840a.

Change-Id: I589caf34170d488ec75645c612d9c65f759eba2c
Typo in CameraParameters::set

Change-Id: I05a6a6adb02c326ae406be24471bd7290c481b5b
Typo: 'key' --> 'value'
camera: Fix the heap corruption issue

 * Add locking around flatten/unflatten because they alter mMap and
   all hope and sleep is lost if it changes while we're iterating.
 * It's even worse if the memory backing the params string changes
   underneath of us :(

Change-Id: I06d85343a4a1c0143fab0687fda9e1d95a28440e
Revert "camera: Fix the heap corruption issue"

This reverts commit 611526fd34bbe92f702eea0ff5bdd0e4f1f14904. Doesn't fix, breaks non-QCOMs :)

Change-Id: Icb1417f4120cab921f7cf879a215fc7ea66112a6
Merge remote-tracking branch 'cyanogen/cm-10.2' into cm-10.2