camera: Add required symbols for Oppo devices

Change-Id: Iaf43f53130963449f4ec6d3116c58965ead1f475
camera: Remove deprecated HTC camera support code

* Squash of the following:

Revert "Add camera parameters for htc evo 3D. (1/2)"

This reverts commit 8ffd5b96c07a3bc2e9f6fda1a9b5f24ef905d0f3.

Revert "Camera: QCOM legacy definitions,HTC cam switch,NO_UPDATE_PREVIEW"

This reverts commit c62d15799f983171666bc81425245736c0184abc.

Change-Id: Icb90ef229b4019705136eafd75dbf017ed82f58c
frameworks/av: Mediacodec initialization check in QCUtils

- Mediaserver crash is observed while playing wma10pro clips
  on MM stability stress

- 8x10 device is not supporting wma10pro format from openmax
  which is resulting component creation fail.
  However in this case multiaac decoder component is creating
  which is resulting crash

- On QCUtils::helper_addMediaCodec without intialzing the codec
  we are trying to add codec capabilities which is resulting wrong
  codec capabilities to assign for multiaac decoder
  Added initializarion & flags check to fix the issue

Change-Id: I8a61d658bcbebf53a59a30bd6d812b4dafec46c6
CRs-Fixed: 552817
framework/av: Check for NULL pointer of mCblk and zero division error

latency calculation happens in two places: AudioTrack::latency() and
AudioTrack::dump(). Need to add null pointer and zero division check on
both of these places.

Change-Id: I9cbe8c1c00a390cd626bdbf202124f27e60eb3e3
Fixed-CRs: 548514
media: Add Ops check before starting audio recording.

Confirm user permission before starting audio recording.

Change-Id: Ia4e6d8fb6986d4e73fb656ba0efaf42c210e92af
audioflinger: do not use raw pointer for tracks

Commit 9da3d95 surfaced a problem caused by the use of a raw
pointer to a track in offload thread implementation.

Pointers to tracks should always be weak or strong pointers.

Bug: 11708529.
Change-Id: Ic48632532d186c9be8261f73cefdf824b9fbbd2b
audioflinger: SRS effects are not working for LPA

    -Issue: If SRS effects are applied on LPA playback,
     in ARM side there is a delay of 4-5 seconds for effects
     application
    -Root cause: In applyEffects SRS effects are applied first and
     then Android effects are applied.
     In case of active android effects, SRS effects are called
     first and then android effects are called, so buffer with
     SRS effects is getting overwritten with buffer with
     android effects.
     If there are no android effects applied then all
     the SRS effects are overwritten with decoded data.
     So until next write call, SRS effects are not applied and hence delay
     of 4-5 seconds
    -Fix: In applyEffects first apply android effects and then
     apply SRS effects

Change-Id: I36b2133256d168f06b13c3d4a2bad00312d571ac
CRs-Fixed: 566278
audio: Supress redundant effect config events in short duration

Distortion sound persists for the whole song when re-enabling effect in
LPA playback mode till switch to next song. And pop noise is quite obvious
when enable/disable effects in LPA.

As the design of LPA, EffectsThreadEntry() loop is used to handle effect
config changes through applying effects with new config on dsp pcm buffers.
However, it can't handle too many config change events in a short time,
and effect with new configuration will be applied on part of dsp buffers.

Filter out redundant effect config events that come too closely to avoid
applying effect on dsp buffer in vain.

Change-Id: If8915b1d068724d5976e1519ec57e3c08cf89c9d
CRs-Fixed: 562806, 563418
framework/av: Fix for frame drop in video playback

- Breaks in video playback seen in video clips having audio content
  with sampling rates less than 16kHz.
- While extrapolating real time with system time, the real time is wrongly
  caped.
- Fix this issue by limiting the extrapolated real time only when EOS
  is reached.

Change-Id: I95b6a8f7f1f1fd561c92955cf52151ae2890c9a7
CRs-Fixed: 400398
audioflinger: Add Null pointer check while enabling effects for LPA

- MediaServer is crashing when disabling effects after mediaplayer
object is released.
- EffectChain pointer is de-referenced without NULL check, hence
leading to a mediaserver crash.
- Adding a NULL pointer check before using EffectChain object.

Change-Id: If5ff469445246028046ba65e5ddf3300180318c2
CRs-Fixed: 583305
Audio: Tunnel Exception for ER AAC ELD profile format

- some m4a clips are not working properly

- ADSP audio decoders don't support ER AAC ELD support

- Added tunnel exception for ER AAC ELD format.
  Added AACProfile metadata support for MKVExtractor

Change-Id: I2f6fe721b05377dfe0f24ea0ad1f6c4a885d576d
audio: Check the return code of MediaWriter::start

- Return code of MediaWriter::start method is not checked
  in startRawAudioRecording. Due to this, sound recorder
  application is not receiving the error whenever there is
  an error in starting of the recording
- Fix is to check the error and return it back to
  the client accordingly

Change-Id: I15916211da7a2eb0f27fbf9d4151410a8bdfdd42
CRs-Fixed: 591788
audio: Use composition instead of multiple inheritance

- AudioTrack is derived from BnDirectTrackClient along
  with RefBase to receive the notifications from
  AudioFlinger in tunnel/LPA mode. This is breaking
  binary compatibility for the clients which use native
  AudioTrack directly instead of Java based AudioTrack
  API
- Fix is to use composition here instead of inheritance

Change-Id: I9fd2c61cff5629924e3b08f63559679e0263bcfd
Revert "Remove the no longer used PV software aac decoder."

This reverts commit 1f8834711f23f66d528aca98cca9602fb18cab66.

Conflicts:

	media/libstagefright/codecs/aacdec/Android.mk

Change-Id: I32347bb08d5b04b7e3068329a2ebfd497fd085cf

av: Don't use fraunhofer for ARMv6 devices

Using fraunhofer on ARMv6 devices does not work - it causes a sigsev. Don't use it if ARMv7A is not present

Change-Id: I67e200ac2c1ab17a5c051fc5bc735ed7b1e5f21f

Fix build
(cherry picked from commit 9ea13d2f40b9d89edf817de829d6010c32592cbd)

Change-Id: Ic692f7b80c000842d9c70931a53aeece22a62b35
legacy OMX: squashed commit for legacy OMX support

Enable by setting TARGET_QCOM_LEGACY_OMX := true in BoardConfig.mk.

This is a combination of 7 commits.

commit ff5604878d2bf74555adcf938ffbf98d04bea305
Author: Alexey Shavykin <ganster0x29@gmail.com>
Date:   Sun Oct 28 22:46:34 2012 +0200

    Added support legacy Qualcomm OpenMAX IL libs for MSM7x27

    Change-Id: I63e68e63fce955fef52813360032f5e8e90a4b92

commit 27cf702ac81f27cae206ef182420c1cbcdadb709
Author: Ganster41 <ganster0x29@gmail.com>
Date:   Mon Nov 19 15:35:36 2012 +0200

    Correct gralloc usage flags for renderer

commit 3feab8906fcb4464d5f46bc13dcae9da36e41040
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Fri Jan 4 00:31:13 2013 -0200

    Fix legacy OMX encoders

    Ensure that a valid frame_rate is passed to the encoder, otherwise
    encoding will fail.

    Change-Id: Iaaa298496755ff405e393120973d1ed782f5d8f4

commit f03627bce1de975ad9b88206874dda851b7d2bf4
Author: Grigori Goronzy <greg@blackbox>
Date:   Sat Jan 19 18:26:25 2013 +0100

    Fix alignment and copy size for legacy QCOM OMX

    Change-Id: I6d13c67601da0f0c35d3dd455401f982406cefe3

commit 3e6134027e9faa6b24b1cb1d205e4de0e76f9ed2
Author: Ganster41 <ganster0x29@gmail.com>
Date:   Sat Jan 5 19:33:44 2013 +0200

    Fixed Gingerbread mmparser using

    Change-Id: Ib931fa6ed4522b5851d42297f929183cf76043fd

commit 25edf9884ebbd3c608edc88d8bd8a7196d58b190
Author: Ganster41 <ganster0x29@gmail.com>
Date:   Mon Jan 7 19:56:32 2013 +0200

    Try use ExtendedExtractor only if no suitable default extractors available f

    Change-Id: I57a9cc39caee7e3fa2b709ab09cca5629bf81f44

commit 9e983100a684493d6c2df7952af4fa04f252c19b
Author: Konsta <konsta09@gmail.com>
Date:   Sun Oct 6 20:30:50 2013 +0300

    legacy OMX: use local flags

    Allows use of legacy mmparser without enabling all QCOM A/V
    enhancements that are not supported with legacy OMX blobs.

    Change-Id: Ieccf29ed8036864634ee167c1e21908377516494

Conflicts:
	media/libstagefright/Android.mk

Conflicts:
	include/media/stagefright/DataSource.h
	media/libstagefright/DataSource.cpp
	media/libstagefright/OMXCodec.cpp

Change-Id: Ieccf29ed8036864634ee167c1e21908377516494
libstagefright: Enable meta mode for 7x27a video encoder

msm7627a family of chipsets supports only one input frame at
one time. camera expects the input frame to be released before
sending another frame. so send one input buffer and available
output bufefrs to video encoder component. Release the input
buffer to camera (to get another frame) after receiving input
frame done callback from video encoder component.

Change-Id: I8fbc911f046ff7e2a3047dd65d8c09ac2d8608e2

Conflicts:
	media/libmediaplayerservice/Android.mk
omxcodec: fix typo

Change-Id: Ia057f6258a4c84a2ead7e672f4d6b92ec62aaf5d
legacy OMX: handle QCOM colorformat

Conflicts:
	media/libstagefright/ACodec.cpp

Change-Id: I21f51f8ed296503ba6210e07d730ee80126dbb8c
Revert "libstagefright: support for disabling buffer metadata"

This reverts commit d22a92470ae527eb76caa21a4ae85f1d0e44c6b3.

Change-Id: Ic252e5d4014b07a878468a892c1908fdfc669222
libstagefright: support for disabling buffer metadata (kitkat style)

 - Metada mode video recording is enabled by default.
 - use setprop debug.camcorder.disablemeta 1 to disable metadata mode recording.

 kitkat style:
 - Move disablemeta to checkVideoEncoderCapabilities()
 - don't query hardware codecs

(cherry picked from commit 6e858df631c4347989ac093bec64bc757e86d76f)
Change-Id: I7208af27c8149770f5f841e016ee1ce7cbd19dc2