Camera: QCOM legacy definitions,HTC cam switch,NO_UPDATE_PREVIEW

Updating Camera parameters, and service with several
compatibility patches:

1., QCOM legacy CameraParameters and functions:
Adding these will make ICS qcomm camera blobs work on JB 4.2.
Use BOARD_USES_QCOM_LEGACY_CAM_PARAMS := true in BoardConfig
to use this.

Also fixes the problem of legacy qcom
camera blobs with recent libcameraservice QCOM_HARDWARE changes,
where the orientation is messed up on first
preview: the fix is leaving out setPreviewWindow(window) for
legacy qcomm cam blobs.

2., Also adding NO_UPDATE_PREVIEW flag for legacy purposes.

3., Adding adding the set orientation patch:
Always set buffers orientation when setting the qcom camera preview window
Fixes the rotated preview on TouchPad
https://github.com/CyanogenMod/android_frameworks_base/commit/1a8e41a3c7434737db89b604352575f8b3109e7a

4., camera: Full support for HTC camera switch

5., Adding more parameters for HTC Explorer

Change-Id: I2bfc72b8ef027665356788f1db7f96b31d037dbe
Camera parameters for Samsung's qcom based legacy devices

Change-Id: I8f84e06771338d992521e69704d21cd113201b4b
Revert "audioflinger: apply volume on direct track when track is active"

Causes issues with MortPlayer (LPA).  Track starts/resumes playing, but volume is forced to zero, until a track-change occurs.

4-17 21:41:51.492 D/ALSADevice(  256): setHardwareParams: reqBuffSize 262144 channels 2 sampleRate 44100
04-17 21:41:51.492 D/ALSADevice(  256): setHardwareParams: buffer_size 1048576, period_size 262144, period_cnt 4
04-17 21:41:51.492 W/AudioFlinger(  256): There was no effectChain created for the sessionId(283)
04-17 21:41:51.512 E/AudioFlinger(  256): setting observer mOutputDesc track 0x40c598a0, obv 0x40c598b0
04-17 21:41:51.512 D/AudioSessionOutALSA(  256): setLpaVolume(0)
04-17 21:41:51.512 D/AudioSessionOutALSA(  256): Setting LPA volume to 0 (available range is 0 to 100)
04-17 21:41:51.512 D/ALSADevice(  256): setMixerControl:: name LPA RX Volume value 0 index 0
04-17 21:41:51.512 D/AudioSessionOutALSA(  256): setLpaVolume(0)
04-17 21:41:51.512 D/AudioSessionOutALSA(  256): Setting LPA volume to 0 (available range is 0 to 100)

Change-Id: I6e0ee8cd7c2f577ca5b4cb834c7a83703db4b167
Merge branch 'cm-10.1' of https://github.com/CyanogenMod/android_frameworks_av.git into jb-mr1
Fixed the wrong timestamps issue about camera recording

On emulator, the camera video recording crashes randomly.
It's caused by wrong timestamp when encoding the video frame.
The element of the vector is erased before accessing it.
Therefore, when reading the timestamp from the element,
the memory of the element has been changed.

Change-Id: I9750417fbb9dc4697ccae1e78e286b23925d3764

Signed-off-by: Panfeng Chang <panfengx.chang@intel.com>
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
fix a race condition of MediaPlayerServce::Client::mClient

there will be race condition between mClient.clear in MediaPlayerServce::Client::disconnect method
and c=client->mClient in in MediaPlayerServce::Client::notify method

Change-Id: I767294c4cb864c08e9c0e9f23d6d304a39016205
Signed-off-by: beanz <beanz@marvell.com>
Fix overflow of rand in ARTPConnection

without this fix, (rand()*1000)/RAND_MAX is mainly 0.

Change-Id: I48ae940a7b6974b197d81732774c9dcea107bcf1
Signed-off-by: Yajun Zeng <beanz@marvell.com>
Fix for crash if no content in DESCRIBE response

If DESCRIBE response is received with status 200 but no content,
MyHandler will still set content data for session description
parsing. This will cause NULL Pointer crash.
This fix checks whether DESCRIBE response has content before
parsing session description.

Change-Id: I114ae6fd54ce804e61718f62618ca9008425a433
MPEG4Writer: Write a zero-length compressor string

The first byte is the number of bytes in the string to display,
the rest is the actual string (see ISO/IEC 14496-12:2008 page 29,
compressorname in VisualSampleEntry) to display. Currently, all 31
space characters are displayed in certain players (such as Apple
QuickTime Player) instead of the plain codec name (e.g. "H.264").
By writing the string length properly, the actual content of the
remaining 31 bytes is ignored instead of displayed.

Change-Id: I7f93a8966d74a4e86abc46c3dcb70f71780d9cd6
SoftVorbis: Set the right encoding in the port definition

Previously, it set the encoding type to AAC, which is just a typo.

Change-Id: I2dcae1f579e9feb0b35b6f5d334028c534275042
SoftAMR: Signal the right frame format

The correct enum for the format used is OMX_AUDIO_AMRFrameFormatFSF,
which is the same as is used in amrnb/enc/SoftAMRNBEncoder.cpp,
amrwbenc/SoftAMRWBEncoder.cpp and in OMXCodec and ACodec.

The OMX_AUDIO_AMRFrameFormatConformance enum refers to an odd file
format only used for conformance tests, not used in the wild.

Change-Id: Idc395fc1d4969e33453522d6ec6526876438c526
Avoid invalid memory access when using extractMetadata()

BpMediaMetadataRetriever::extractMetadata() returns a string
which is returned by readCString() function of the reply parcel object.
However, the parcel object is destroyed at the end of the
extractMetadata() function, and so the returned pointer is invalid.
This patch fixes this problem by storing the metadata string value.

Change-Id: I2a2ccba78246175b2845a237679d6cebe881e83b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Prevent invalid frame durations

Prevent frame duration from being negative when
exporting movie studio project

Change-Id: I459fb243650c777c2b59d1094acc88c3a944bd81