libstagefright:add enhancements for extended format support

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

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 ab6a474cd9acc7bc54c54a7c235f6eab032349ca)
(cherry picked from commit fe07c231dbecd255aedbf7aac597260831eb98cf)
(cherry picked from commit df7b013ceeeb4697f448a2d150ae75b86c325013)
libstagefright:enable extended codec/format support

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

Change-Id: I0bfa4bd6c4dfed93a96e1af431018de54d6fb57b
(cherry picked from commit 318c38f40b53e1987473b29a359e586615bf3c02)
(cherry picked from commit 4a0e6d65c200604a9618e2fc90326031153e6f08)
(cherry picked from commit f9b65059fabc1c24ae5107b54f96a017e8fc7376)
libstagefright: For interlace, set decoder in arbitrary mode

In arbitrary mode, frame parsers sends individual fields
to core. Once both the field is decoded, output done (FBD)
is sent back to client.
Default frame by frame mode will send both the fields in
a single buffer to core, which might decode only one field
or will throw up error.

CRs-Fixed: 531034
Change-Id: I31844093b6a93d3a62577fc8d799353d30573c17
(cherry picked from commit cb45f5a702992242538fab6d9e2c36b7b8e55c7f)
(cherry picked from commit 214938ef4f9997233a33a24e9e9e9751a1fa1882)
(cherry picked from commit 646e3bdce1c8241fb46802e7eba3c4f8a528517d)
audio: add support for MSM audio formats

- Add support for EVRC, QCELP, AMRWB+, and WMA formats
- Refernece change If110058284c8b3e18c2f242f560fc7748f62081c form jb-mr2

Change-Id: Ie20f2d61f79d2ba41d552718187b7098141e7b8c
(cherry picked from commit bca561e38853351c0bae15c5d201dbca7f5a027e)
(cherry picked from commit a11972f505000be397ee3a377ec42bf9e5fef420)
(cherry picked from commit 7465e6129b291c66dc7741325a90e3725e40e941)

Conflicts:
	include/media/stagefright/OMXCodec.h
	media/libmediaplayerservice/Android.mk
	media/libstagefright/Android.mk
	media/libstagefright/AudioSource.cpp
	media/libstagefright/OMXCodec.cpp

Change-Id: Ie40f2d62f72d2b2412552718187b7098141e7b9c
libstagefright: fix metadata key sizes

 - some wma metadata keys should be treated as 32 bit keys instead
   of 64 bits.
 - fixes wma lossless from failing

Change-Id: Ic6af8392aea6a1bd8810dac59e1d1c27c21c4059
(cherry picked from commit 1fae0bcb8ef9244e1f28d21c36e388ab365e3c0f)
(cherry picked from commit 97be73e3004a838227060f026f38c7231dd7e2f7)
(cherry picked from commit 4d24c91e49c89eadb7b48e47e38a9b7b6df8f1cf)
frameworks/av: Add support for LPA and Tunnel Playback

-Add DirectTrack and DirectTrackClient
-DirectTrack enables client to create a direct
 output
-DirectTrackClient allows notifications to be sent to the
 client from DirectTrack.
-DirectTrack is being used for Low Power Audio
 playback and Tunnel Audio playback
Change-Id: I265ae1fa32c6fdd8be0382cc2b28605bc756a2f3
(cherry picked from commit b255c1963bb3af6f547b68d646737a7c92739555)
(cherry picked from commit 7cb21f77ae28f58da1cb8ba8f684b2968dcd4122)
(cherry picked from commit d4fa9e74c1ee1c2f7f7262c245da0b94dc0ac05b)
frameworks/av: port fixes in LPA and Tunnel mode playback

No History was maintained during porting. Updating the Description
and CR's of all the fixes.
Reference point: AU_LINUX_ANDROID_JB_MR1.04.02.02.049.366
LPA Mode:
LPAPlayer synchronization fixes.
Fixes for seek, pause/resume, EOS handling
Fixes for synchronization b/w the decoder thread, TimedEventQueue and player thread.
Convert mono to stereo for LPA clips - CRs-Fixed: 421639
Add support to change clip duration to enable LPA
Set correct device while creating effects - CRs-Fixed: 496866
Fix the LPA-AudioEffects dead lock issue - CRs-Fixed: 477511
fix volume not updated in pause state of direct track - CRs-Fixed: 490592
Tunnel Mode:
Use tunnel player only for music stream
Exceptions in using Tunnel mode decode - CRs-Fixed: 432080
Enable Tunnel Decode for select formats - CRs-Fixed:437651
Use software decoder for ADTS content. - CRs-fixed: 431096
Skip tunnel mode for playback through AudioCache - CRs-Fixed: 437539
Fix stability crash on tunnel playback. - CRs-Fixed: 498386
support multiple tunnel instances - CRs-Fixed: 483603
Fix ANR repeated next with tunnel clips on BT/AOA - CRs-Fixed: 482966
Update condition to ignore a seek request - CRs-Fixed: 461908
Return seek position until seek has been processed - CRs-Fixed: 454825
TunnelPlayer performance tweaks for audio video playback - CRs-Fixed: 444041
Stability fixes for Tunnel Player (part 2) - CRs-Fixed: 449122
Adjustment for TunnelPlayer buffer size - CRs-Fixed: 447274, 442365
Remove unnecessary code from TunnelPlayer - CRs-Fixed: 442365
update condition to send SEEK_COMPLETE - CRs-Fixed: 441411
Stop extractor source after start in TunnelPlayer - CRs-Fixed: 440239
Handling of EOS, and triggering EOS was wrong in TunnelPlayer.
EOS should not be posted till seek is complete
Disable tunnel mode playback for streaming use cases to avoid jittery playback
CRs-Fixed: 433346 432233 429868
APIs for returning correct timestamps were implemented
Check whether sink is open before flushing or closing it.
Check for mIsAudioRouted is good to know if we are closing it
Seekbar freezes after seek and pause
Check pause status before writing

Change-Id: Iea150f8d75aa9aa6d14da078695e920a3742dd81
(cherry picked from commit f7c9bafa439c5d52d945b966ba08cb16dfc34818)
(cherry picked from commit 68dee8112bbac7e0a70003175ed71b4e6a0376f4)
(cherry picked from commit 19c7fd3e330be551d477e8388b536294b1166a22)
frameworks/av: port fixes in LPA and Tunnel mode playback draft -2

 -LPAPlayer: Update condition to ignore seek CRs-Fixed: 453067
 -libstagefright: TunnelPlayer: update condition to send SEEK_COMPLETE
  CRs-Fixed: 441411
 -libstagefright: Fix ANR with rigorous rewind of 3gp LPA clips
  CRs-Fixed: 491077 490992
 -frameworks/av: Add  metadata mode changes to LPAPlayer
  CRs-Fixed: 458904 491077 490992

Change-Id: Ia89d7d6ac63b1267422a9138df9f98ef59b0ccb7
(cherry picked from commit 72f3bd4cddd3d93812692bffbfc19e2534477938)
(cherry picked from commit db6330d01d91d466d18c7714bd024a10fb009f57)
(cherry picked from commit 416e9ef0eed0ffa7b6e2c9d5a107d1ed2a94a624)
frameworks/av: port fixes in LPA effects

 -audio: fix for deadlock issue during LPA playback.
 -frameworks/av: Fix the LPA-AudioEffects dead lock issue CRs-Fixed: 477511
 -audioflinger: Fix pops in LPA while effects are applied CRs-Fixed: 526799
 -audioflinger: Fix delay in enabling effect for LPA CRs-Fixed: 525510

Change-Id: I92118b5cba17f5337608007052e7dc891d2d6b5b
(cherry picked from commit b24a38903f3fc2fd2bf7cc8fb71d50e1ff38162d)
(cherry picked from commit e8a1d6f80e64822d83f04f4f0704890644048189)
(cherry picked from commit 571f36890abe9f6b8bfe7341776cb5b3975bf952)
frameworks/av: Use the correct macro for AV enhancement

- Use correct macro for AV enhancement
- Add HW aac encoder entry in codec list

Change-Id: I2933ee92ff15875144acec17d3dd8ef61d6b37f9
(cherry picked from commit 5bb728d3bb84f2f24ddfbaa99fa133c87ff66298)
(cherry picked from commit dbc1e5bde1564e80052086a7ee301173515c8d64)
(cherry picked from commit 941f87a69f87dbeab0068f3e9a98c97981ff2700)
libstagefright: use correct parameters to FindAVCDimensions

Change-Id: I97485610953b276d823adaa124da65f7f184d395
frameworks/av: Define MSM Audio parameters

- Define MSM audio paramters for FM, VOIP,
  fluence, SSR, and etc.

Change-Id: Iec6f146a0dde3095e3380da439a883b1bbb7d462
(cherry picked from commit 8e943f5bd88bda87f1aa9230487a69372ad49cf7)
(cherry picked from commit 85f4743d12c13aab39ac712a9005632f427c1c43)
(cherry picked from commit 333ba54561c59049f695b07479afe1d5ed734d31)