framework/av: Fix build failure for Emulator

Emulator build was failing due to usage of redundant class names.
Updated to use ExtendedUtils which is the updated class name.

Change-Id: I58bc29fc4ce6eb58af2db563e67848d06dba56f6
Merge "framework/av: Fix build failure for Emulator"
audio: Add track to trackToRemove list when it is terminated

- PlaybackThread loop is continuing for direct output even after
  the track is terminated by the client. This is causing 2 direct
  tracks being active when client starts another session
- Fix is add the terminated track to tracksToRemove list so that
  this track is destroyed properly

  CRs-Fixed: 566808

Change-Id: I65f565d9c3a00e071174659ffb92f711dfd8742a
audio: Fixed framecount in AudioRecord

- Incorrect frameCount is passed to AudioRecordClientProxy,
  which is used while user side pointer is incremented
  This is causing distortion in SIP call
- Fix is to use frameCount of the shared block instead of
  frameCount passed by the client
- InputBytes initialization is also done in AudioFlinger

CRs-Fixed: 568988

Change-Id: Iab32234b198ff4d792eea4c4a82097028089013d
Merge "audio: Add track to trackToRemove list when it is terminated"
audio: update setParameter command time properly

-setParameter is getting delayed regardless of delay is
 present or not. Because setparameter command time is always
 getting updated with wrong values(previous values) with any
 commands.
-Fix is to restrict the updation of command->mTime always.
 Added check to update command->mTime, only when identical
 commands are present.

Change-Id: I10b94b19f64ef4f15495d34f009238a691d1b36c
CRs-Fixed: 568318, 569010
audio: Initialize LPA variables in audioflinger

 - During initialization of audioflinger, a number of
variables related to LPA are not set to default values.
This causes an undesired side effect that the first
effect in the effect chain is considered to be LPA
enabled. Since LPA does not execute effect processing,
switching xLoud on/off does nothing
 - Fixed by initializing member variables in audioflinger.

Change-Id: Ide06fb0e6804558388e6610cc7686f168591e4a5
libstagefright: print seek statistics even when paused

 - if seek is issued during paused state, SEEK_PREVIEW flag is set
   and statistics needs to be printed even if that happens.

Change-Id: Ida5040d2961bff4dfb8a53b50be01609aaac9976
CRs-Fixed: 512801
Merge "audio: Fixed framecount in AudioRecord"
Merge "audio: update setParameter command time properly"
libstagefright: fix thumbnail issue

Set thumbnail mode before setting video resolution to
video decoder to resolve thumbnails generation issue.

CRs-fixed: 563422
Change-Id: I42503676c2199bcb390b0b27652570d0f8188d13
scale the kMaxCttsOffsetTimeUs for HFR recording

-timestampUs & decodingTimeUs are scaled for HFR recording
-the difference between these is compared against non-scaled
constant(kMaxCttsOffsetTimeUs).
-fix provided to scale this constant(kMaxCttsOffsetTimeUs)
-and compare against the scaled time difference.

Change-Id: I08188423008d8f6a4824f2748d56a1e355d39a89
CRs-Fixed: 566695
AudioFlinger.cpp - audioConfigChanged_l set for srs Tunnel Device Switch

 - During device switch we were only setting the route
   but was not calling audioConfigChanged_l
 - Hence the effects for the new device would apply only
   when there is a config change.
 - Now we call audioConfigChanged_l during device switch
   setPrameter so that the new effects will be apply as
   soon as device is switched.

Change-Id: I641cd8a7d6ffb7423ccfaa45e4c29b1b5352e61e
CRs-Fixed: 548021
Revert "frameworks/av: AAC CSD support for MediaCodec path"

This reverts commit Ic8197138f5107f2a6026c28847e74987d91acc16
Currently AAC CSD is retrieved in MediaCodec using
kKeyAacCodecSpecificData. This support was added as part of
commit Id046b0d4bf96f029c1b6b5d78d753073e38ac841.

Change-Id: I54bc6204c1fe88f4e4545f501e6bd1bb2a8beaf9
CRs-Fixed: 527284

Conflicts:
	media/libstagefright/Utils.cpp
audio: Handle AudioSource pause only for hardware decoder

-AudioSource needs to be paused in case of hardware decoder
to release dsp resources while in suspend state. Currently
added pause support extends to software decoder case as well
and leads to unwanted results. Limit this to handle pause only
for hardware component case.

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

Conflicts:
	media/libmedia/AudioTrack.cpp
media: Add Ops check before starting audio recording.

Confirm user permission before starting audio recording.

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