Fixed sample video corrupted in MediaCodec mode.

Change-Id: I50c5660072d40f6e297e58fd026ea04c89d6a70a
related-to-bug: 6732061
Merge "Fixed sample video corrupted in MediaCodec mode." into jb-dev
merge in jb-mr0-release history after reset to jb-dev
merge in jb-release history after reset to jb-dev
merge in jb-release history after reset to jb-dev
Merge remote-tracking branch 'upstream/jellybean' into jellybean-cm
i9300: Enable back forgotten ISO modes (1/2)

Change-Id: Icefcd8dee6848e684b6c0c191ee485ed973e4ce8
camera: Full support for HTC camera switch

* Adds the changes for using the "htcwc" switch.
* ICS commit: https://github.com/CyanogenMod/android_frameworks_base/commit/6fa3953df37f6744af7c777f4ac803d4df44af33

Change-Id: I845d628106e386608590df7a1ed4f635f655f140
Merge "i9300: Enable back forgotten ISO modes (1/2)" into jellybean
framework/av: Fix AudioFlinger create track failure

- AudioFlinger track creation fails after mediaserver crash
- Mediaplayer doesn't register for new sessionId value if
  mediaserver crashes during a song switch of music player
  and it uses the old sessionId though sessionId values are
  reset by AudioFlinger.
  AudioFlinger assigns the same sessionId to Tone Generator
  and since strategies of these two session differ it would
  result in track creation failure.
- Fix this issue by registering for new sessionId for
  mediaplayer if mediaserver crashes in idle state

Change-Id: Icc8d204bec5d2fa97db17a7319904baa29115b19
audoflinger: Add A2DP Notifications.

LPAPlayer needs A2DP Notifications to support LPA over BT-A2DP
devices.

Change-Id: Ib43231fd51070059cbe876ec54ee7c542bf2caa3
libstagefright: Enable LPA playback on BT-A2DP devices.

-Applicable for msm8660, msm7630 & msm7627a.
-LPAPlayer need to be put in a new file for the above
 targets as proxy port kind of implemention that is used
 for LPA on BT in 8960 is not available for the above targets.
-Consider LPA & Tunnel player compilation only for  QCOM
 targets as it was in ICS.

Change-Id: I638bd8427a7420e7e27b711008e9c6a51fb761b5
libstagefright: Fix for LPA crash and timestamp issue

-Timestamps during LPA playback is incorrect.
Crash is observed during moving to next clip.
-Timestamp after seek is incorrect.
AudioFlinger does not call stop of LPA Audio session.
-Manage timestamps in LPAPlayer.
Call stop of LPA Audio session.

CRs-Fixed: 388808

(cherry picked from commit e839365b783893c8070da587dac8aa5cb56d63f4)

Change-Id: Icccfb7d2325beb0f19d85af67a6719171e3fa625
Cameera: Correct camera orientation for front sensor

Change-Id: I4bc1d02af41ce863631afcbffc07b64277f8f1fe
libstagefright: Enable encode and decode with composition offsets

- Add setprop to enable b-frame encoding
- Setup AVC and MPEG4 encoder parameters for b-frame encoding
- Wait for minimum required buffers if b-frame encoding is
  selected for timelapse recording
- Allow decoding clips with ctts version 1

Change-Id: If2d66577b25c4a001cf72f4f84af56d03dfa4e17
CRs-Fixed: 380462
frameworks/av: Fix ANR during voice call recording when call ends

- While doing voice call recording, when the call ends ANR observed
- When the call is disconnected, audio HAL receives -1 from driver and
  audio HAL propagates this error to AudioFlinger.  But AudioFlinger
  is not sending error status to audio source to stop recording.
  Because of this audiorecord thread keeps on waiting for buffers
  which is resulting in ANR.
- To avoid indefinite wait, a timeout of 1 sec is set for buffer
  in audioSource and after timeout, -ETIMEDOUT is returned
  to recorder thread.

Change-Id: Ifffa1a33a796c83ac819681b2bf4158c8a16f6ce
libstagefright: Fix for data loss in qcp recording

- For evrc and qcelp recording, nearly 1 sec of data which is
  recorded is not writtern to the recorded clip.
- The writer thread which writes the encoded data to .qcp file,
  is not getting enough CPU time. This results in ~500ms of data
  loss in the recorded clip.
- Fix is to increase the priority of the writer thread to
  ANDROID_PRIORITY_AUDIO

Change-Id: I19125593ade2697251df976c81cb4df8dcf7b80b
CRs-fixed: 386398
libstagefright: Fix for CTS recording testcase failure

- AMR WB record is failing through CTS because of incorrect
  sample rate and bitrate values. Fix AMR WB encode
  bitrate and sampling rate values to fix this issue.
- Back to back recording in CTS testcase
  MediaRecorderTest#testRecordingAudioInRawFormats fails.
  Add a fix to release audio source node reference on stop
  recording as well as before creating new audio source.

Change-Id: Ia4b1f2331b0b6f9c6c7d23cd40e8c5b5cec76e28
CRs-fixed: 384336
libstagefright: Fix for FPS drop issue during A-V playback.

Issues:
-The AAC decoder was not updating the timestamp when EOS is reached.
-Logic to smoothen the real time update in AudioPlayer uses system
 time. This introduces corrupt timestamp during EOS.

Fix:
-Update the timestamp in AAC decoder when EOS is reached.
-Extrapolate realtime using system time in AudioPlayer when EOS is
 reached. Cap the value to realtime if  extrapolated time becomes greater
 than realtime.

CRs-Fixed: 384183
Change-Id: Ice54501436431d2527fcd3d710d65d9732fcffdd
frameworks/av : Added key to query a2dp device support

Change-Id: I0440ab83cfcabbecb336c12e2e8db0778e7b936b