libeffects: do not use GNU old-style field designators

Avoiding the use of GCC extensions improves code portability

Change-Id: I9edbedc5c8ad4aa46ca54bc2e28280441431a530
Long mp3 metadata displays as corrupted file after transfer

Cut the metadata to 1 Byte and return in function
getObjectPropertyList in order to show it properly on a PC.

Change-Id: Iefacf9fa86c20ece2572e6d95d35877a94066fe7
libnbaio: Fix previous get_presentation_position commit

The previous commit has no effect because HAVE_PRE_KITKAT_AUDIO_BLOB is
actually never defined.

Change-Id: Ic41b5f02c2cee741aaacce6da1839001a49b9410
Avoid jumps to faulty position after seeks

When seeking multiple times it is possible that some seeks
are discarded in AwesomePlayer, which causes unwanted jumps
to faulty positions.
The reason is that a seek flag is reset twice in AwesomePlayer.
At first when the video seek is completed and then again when the
audio seek is completed. If a new seek is made after the previous
video seek completed but before the previous audio seek completed,
the new seek position is discarded by the previous audio seek
completion.

This fix makes sure that the seek flag is reset only when video
has completed the seek.

Change-Id: I8f8741d4cb8682345f1d1855bbad57c05f4e3c8d
AudioMixer: Remove tracks from enabledTracks after reseting outTemp

If any track goes through AudioMixer::process__genericNoResampling, and
its getnextbuffer returns NULL, Then that track is removed by AudioMixer
from enabledTracks.

Thus if all tracks getnextbuffer return NULL, Then this function doesn't
reset outTemp and last buffer in AudioFlinger's mMixBuffer will be
repeated and noise is observed.

Remove tracks from enabledTracks after reseting outTemp to zero, so that
process__genericNoResampling will reset outTemp and noise won't appear.

Bug: 12450065
Change-Id: I1ccac7ee4a3bf7fd930254356c072099e11e7c19
Signed-off-by: Gaurav Kumar <gaurav.kumar@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
frameworks: av: camera: add missing HTC cam parameter

* add CAPTURE_MODE_EIS

Change-Id: I767f7e6ecd0164ae65d8a607fdc1a7166c8886ec
Camera: Support obtaining camera memory from MemoryHeapIon

* Exynos 5 devices want the ION file descriptor from MemoryHeapIon

Change-Id: I9e445cf24c15713f713181667e7b7caa1a96592e
libstagefright: fix AV sync late margin on non-QCOM_HARDWARE

Change I65cd3dce9b31b87f1488c37af9618669b29c362c changed the
late margin to a property defaulting to the same 40ms as the
original code, but uses QCOM_HARDWARE dependencies to read
the value (otherwise it's left unset).

Hardwire it back as the default 40ms

Change-Id: If63e171ea4e9693aa90dd7fabd8997f361a3959c
libstagefright: unbreak hardware OMX on OMAP3

http://review.cyanogenmod.org/58070 has mistakenly reverted
http://review.cyanogenmod.org/44365 which broke hardware OMX
on OMAP3.

The fix for OMAP3 was just a logic change to prevent an
indefinate loop since the nIndex value was being overriden by
the OMX component. The code was modified to use a seprate control
value other than nIndex itself and doesnt pose any issues with
other platforms.

Change-Id: I8ca4f9d48c3f9241f21c9fe6ab98d0be5783ceab
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