MediaProfiles: Add support for camcorder video resolutions.

Added video resolutions to support camcorder recording.

Change-Id: I0873225c23dad09c9c6036337c1d9fc1ab3f1cf4
(cherry picked from commit I2291de43ae2be7338c673f2f0417ec5c1581391e)
(cherry picked from commit dc20e95f433f87dae8c6be9be1bf1dd3c806b0fa)
(cherry picked from commit 1c75d71676776665adbd1eb9ac7a73b931caba39)
(cherry picked from commit e654d7b4cd5192c7b5db3a6f911aebcc08228e1e)
Camera: Enable Histogram feature.

Link the histogram enable/disable commands from
application to the HAL layer.

(cherry picked from commit 8ccc5e2091fcaf181210ebf16a86640e3c609b0d)

Change-Id: I147ba9ce4ac8eea7ee9f786759ec8156e73ddb44
(cherry picked from commit fd3df551caf5304813537a9abeda774c0852d88a)
(cherry picked from commit 2be7cf01031999c5595e8be956bada7254fc7d49)
(cherry picked from commit 90d92ce371c40d26a64978943f13b9f4fa680b6e)
Camera: Add support for ZSL burst mode.

Added ability to set number of snapshots in burst mode.
(cherry picked from commit94e831cb179f05e50ac4fc9b2b15c26f44f2ee9a)

Change-Id: Ie0e7c8c0117b7adc985cfc92df79747ee6a5ea51
(cherry picked from commit 743b78cb1068a8cf9ee23b13365d2b51839d4c65)
(cherry picked from commit abe3011369a25449b5e73091bc4a0a4768661208)
(cherry picked from commit 887936a2f2196a86c1135e85e96e92e6a5ea95e8)
libstagefright:add enhancements for extended format support

Extended-extractor to support extended container format.
 - Introduce an Extended Extractor to facilitate plugging-in
   of proprietary parsers.

Extended-codec to configure codec specific configurations.
 - configures omx component with extensions to augment
   container/codec format-suppor

Extended-utility to add utility methods and shell extensions.
 - Utility methods for supporting following features
  - High Frame Rate (HFR) recording
  - Support for B frame encoding

Change-Id: I77a40af701916f1803fa9c6af3c43a312a8d2c98
(cherry picked from commit abbb9fdbbdb60ec530c50a8a457e861a055223b7)
(cherry picked from commit 4e5b117739746261fe913a34dcc81761aac5c818)
(cherry picked from commit 563fa21d95af784fc9761e89a2c361d0849b8e64)
libstagefright:enable extended codec/format support

Configure omx component with proprietary extensions and
register exended-extractor to augment container/codec
support.

Change-Id: I0bfa4bd6c4dfed93a96e1af431018de54d6fb57b
(cherry picked from commit b088cca3d8e271c8482899d4cc43f72aaf25ab3f)
(cherry picked from commit 391e1e6ba2d19ef64428a7ba0daacc4310b81445)
(cherry picked from commit 469996dbe3d56cf956fdc54f6f986ae94353f958)
Camera: Fix deadlock due to mLock in pcb and takepicture.

In non-zsl case of takepicture, we do streamoff for preview
stream which is waiting on preview callback thread to exit.
By that time the lock has already been acquired by takePicture.
So preivew callback will not exit until it acquires lock and
takePicture cannot continue until PCB call back is returned.
Fix: Avoid the mLock at services when both Preview cb &
Compressed cb are enabled.

(cherrypicked from commit bd423581f4b7eb8481f5525fc51174ce4c7261bc)

Change-Id: Ib7e78eac993c444eb50293425aa5488e86648696
(cherry picked from commit b75002b9e4b68e537ba89e04ce5bc1140392d228)
(cherry picked from commit 8bd42c0c83e159de2d4ea02098bb77a5b353b3a2)
(cherry picked from commit 76029feb6072b2448f0bdbe0a11b9cd5ef87e669)
Camera: Disable TakePicture related messages in stopPreview, stopRecording

This change fixes the race condition and avoid the deadlock
in abnormal snapshot stop I.e, Observed DeadLock when Data
or Notify Callbacks is sent to App after StopPreview is
triggered and so disabling the corresponding take picture messages.

(Changes cherrypicked from commit 962b0856465e7abbd5900fffa68112363b8e5360)

Change-Id: I727e2da2418ee8b800f34887e565ecc18d591453
(cherry picked from commit b9212127ea638e8e4e4c215235ac95102c39364a)
(cherry picked from commit 0b82b17d96f2646c56a5bede34ad9f82ada73d30)
(cherry picked from commit 82f78b4c13978d43e728c82428daf0ef912363fc)
libmediaplayerservice: Add support for DashPlayer

Add support for DashPlayer in MedaPlayerFactor

Change-Id: I3e1fd871340117cb11975f6819d4bf0e6630607a
(cherry picked from commit 284d4bae56ce579525cf9c650b057ffde5063163)
(cherry picked from commit d542abc91a9ac9e1b66bdc24d187474d7578447a)
(cherry picked from commit e541c900cab392ef4c7fcc2fab28e0ac48bee3a8)
audio: Compile AudioParameter as shared library

- AudioParameter as shared lib is needed by BT
  support in WFD source, SRS TruMedia

Change-Id: I464b428ace0cbb57ce6bf7bf3b57d51a7d56f032
(cherry picked from commit 1a6899cb8bed3b2842567095e2aca37ac6e8c458)
(cherry picked from commit 8a0dd57f1c01ea56b943b0e988f6fcf7ebc7ce3d)
(cherry picked from commit 1593d5fc90006039a06fea8232a529e8a617c649)
frameworks/av: Add support for Quality Of Experience (QOE) events in MediaPlayer

- Add MEDIA_QOE event type
- Allow MEDIA_QOE event to be passed to Application after reset
  is completed, similar to MEDIA_ERROR

Change-Id: I71e3d9e1f5f934c5844d80c65c653b2702a22ca1
(cherry picked from commit 965eb26910bfd2276c7f68cf63386c66a8bece4e)
(cherry picked from commit 071b2932880308eb8de12b469950c5f066869be5)
(cherry picked from commit 0efae93b45838060f23ff5925d9e40d9db2389e2)
libmedia: Add proprietary keys to MediaProfiles

Add entries for:
- EVRC, QCELP, and WMA formats
- 4K resolution support for camcorder

Change-Id: I5e4bc47adeb34308b41d696cd4492d3266b98a7b
(cherry picked from commit ff7db5a043f19b4d8cb40a90176cff254125e2bd)
(cherry picked from commit 997aa7e6dbbcd4c19a6151c8214cdac05b8b95f2)
(cherry picked from commit 25507cee8ba40a0b63e103a529fba3606f7aead2)
audio: audio parameter enhancements

- Define audio paramters for FM, FM volume
  Fluence, surround sound recording, A2DP,
  ADSP status, and proxy device.

Change-Id: I29d02e37685846f6d4f00dee02e2726b015eaae7
(cherry picked from commit faabe4d3c1bb350fcc09a220d1498e785be37214)
(cherry picked from commit 7c752b8d79128ae754eefeefea2ddafe78a68b1b)
(cherry picked from commit 643cc2062994bac3a6e0a7787081955f33e8dbbe)
audio: audio enhancements for playback and recording

- Add support for EVRC, QCELP, AMRWB+, and WMA formats.
- Add support for 5.1 channel recording.

Change-Id: Iaf80f982fc8b08617132dbd7d524a1748866745c
(cherry picked from commit a33b4cf44de89d1e16acb21c6f99956ec775683c)
(cherry picked from commit b5eae882bb25c340ef6750b297e07c5626c69dbf)
(cherry picked from commit dcc8e5b1b3c7ff1009dc35ea7d1d18f43f29da0a)
libstagefright: Add support for H/W AAC decoder

- Currently, only software AAC decoding is supported.
- Add support for H/W AAC decoding by including it in the
  list of available decoders and use it for decoding only
  if the property 'media.aaccodectype' is set to 0.

Change-Id: I4bb9df1bd10bd8ee91e63dadd6c473fc4e29813a
CRs-Fixed: 449145
(cherry picked from commit b23f4db95710bce9b51d5baf1d22afeaf7d305dd)
(cherry picked from commit 627c4770de826ed069441b5194167c101dc61966)
(cherry picked from commit 8d002ab28adfed65c6c3f51a26c8b7e483a07762)
CameraService: Adds support for longshot mode

- This change introduces additional functionality inside
  CameraClient for supporting continuous compressed data
  callbacks. This is needed for 'Burst/Long shot' mode
  where we could have indefinite number of callbacks after
  capture is triggered.

(cherrypicked from commit e4f502aa7cbe8875e8a1589024cdcf227c228a2b)

Change-Id: Ia18ca9bdda7736c679db557e510870115089537a
(cherry picked from commit 0809c9e78b3ce107d8b8f1e04c345895f0b791d6)
(cherry picked from commit e64fac804bdac08bc73fcaa2c1f72c1bfc5eaa77)
audio: fix meta MIME type failure in MPEG4Writer

- MIME type info included in source->getFormat()
  is not updated properly because only temp
  variable is updated in AudioSource::getFormat().
  MIME type string contains garbage value and it
  results in invalid audio formats.
  MPEG4Writer returns ERROR_UNSUPPORTED and tunnel
  mode recording with 3gpp format fails
- Fix this issue by assigning return value of
  getFormat() to a local variable, and check the
  return value of findCString.

Change-Id: I242fa25a5d4f7b7e2c88fdd855208dcd42883b6c
(cherry picked from commit d914dbfa1c06dc2d0f5846cef58668fdb3b58138)
(cherry picked from commit 447e5977ea50a0be326fc447248405b18b0a2bc3)
stagefright: Changes in SF to support FM over A2DP

 -Changes in SF to support FM over A2DP

Change-Id: Ic34f4f1dffea89a8666a5e88994bd3d2d3dc69be
libmedia: Add support for LCH tones

- Add the INCALL_MUSIC flag for tracks
  created for INCALL_MUSIC stream.
- Adding tones to the ToneGenerator that are
  to be used for Local Call Hold.

Change-Id: If4092630ec67b11fd2844d0218639a2c5ae6b687
audio policy: Fix MT call delay

- When MT call is accepted, it is observed that it takes 3sec to
  start the voice call. Until then there is no audio heard on
  the far end.
- AudioPolicyService processes setParameters calls in the order
  in which it receives them and when two setParameter calls with
  different keyValuePairs come in (in this case, FM volume with a
  delay and routing), the timestamp of the command received last
  (routing) is updated to be processed at the timestamp of the command
  received earlier (FM volume). FM volume is set with a delay which
  causes the delay in routing as well.
- When two setParameter calls with different keyValuePairs reach
  AudioPolicyService from HAL, the timestamp of the command received
  later is updated to that of the command received first.
  This is unintended and might cause a delay or advance the processing
  of commands.
- The timestamp of the command should be updated only if the
  keyValuePairs in the setParameters call match.

Change-Id: I790479eaad9d2d6fd4204cc4cb7698761c30f7cf
CRs-Fixed: 568278
mediaserver: conditionally launch ListenService

Conditionally instantiate ListenService from MediaService.
ListenServiceruns as a singleton in its own thread that calls
AudioHAL which in turn accesses Listen Driver. It is the entry
point from Application processes that want so execute Listen
commands and receive Voice detection events. It manages Listen
application resources and global states across all Listen
applications.

ListenService is similar to AudioFlinger. That is why it is
instantiated from MediaServer. Listenservice talks to AudioHAL
to deal with concurrent usage of mic.

Change-Id: I71c346bb16e0ed3a7aae9c908e03c7f1c694fe0a