libstagefright: Add property to enable software decoder for video

Add sys property to enable software decoder for video in AwesomePlayer.

Enable software decoder using the adb shell command:
 setprop sys.media.vdec.sw 1

Disable software decoder using the adb shell command:
 setprop sys.media.vdec.sw 0

Change-Id: I9ae6c139575761d2b374b447f38dc5d43172ab40
libstagefright: Remove qcelp decoder from encoder info list

-qcelp decoder omx component is present in the omx component
 encoder list.
-Removed qcelp decoder component.

Change-Id: I05cd86d83384c2b9c0921948775b76de19b9d75c
libstagefright: Checking buffer size.

Checking if the allocated buffer size is equal
to the buffer size requested by decoder.

Change-Id: I6e23668b3005badd7748b7687d014854e7152132
libstagefright: Populating sync sample index for Video track only.

- While an A/V clip in playback, seek fails to desired location
  and starts playback from zero position.
- The stss atom has zero entry count and sync sample index for Audio
  track. Due to this seek fails and starts playback from zero position.
- Skip populating values from stss atom for Audio track, fix added
  for the same.

Change-Id: I3b9073dc182cf4afc8faf612e1d69493d64d113a
CRs-Fixed: 271385
libstagefright : Fix to support AVC1 and MSNV file types

-Add Support for AVC1 and MSNV file types in SniffMPEG4
 function
-Function returns true if the header contains one of these
 filetypes

Change-Id: I6d14f4fef0837b2f6d07ffa2f013616ebb76a085
libstagefright : Fix to support mmp4 file type

-Add Support for mmp4 file type in SniffMPEG4 function.
-Function returns true if the header contains one of these
 filetypes.

Change-Id: I3f88b4b34f9c79c7e3172e813751bcf1c18ad58a
CRs-Fixed: 253907
libstagefright: Adding support for k3g1, skm3 and mp41 major brands

This change adds support for ftyp's k3g1, skm3 and mp41 major brands in
the mp4 parser

Change-Id: I816f80ec1ab288df15a41116bb0b2fedd3b2f692
CRs-Fixed: 257978
libstagefright: Add check for zero chunk size.

mp4 file with chunksize of zero causes a infinite recursive call
of parsechunk of the parser resulting in ANR. Added check to handle
this case.

Change-Id: Id522da4c600600628e528a66b2a53468602020ce
Crs-Fixed:254974
Fixed issue with MPEG4 with 0 audio channels.

Removed check that numChannels != 0 in MPEG4Extractor.
The problem was that numChannels==0 valid, and implies that
the number of channels should come from the audio object
embedded in the MPEG4.

Change-Id: Ibe1b8f1d81ea661932ff1a1c02ed5b992068c15d
CRs-Fixed: 249523
libstagefright: Add NV12 Tile to RGB color conversion

- Adds support of NV12 Tile to RGB565 color conversion
using the qcom color convertor library.

Patchset 1: Add QCOM_HARDWARE ifdefs

Change-Id: I8f6fa92651b666376af514b46a5027f56492dd43
frameworks/base/nuplayer: Support for dynamic port reconfig in HTTP Live

- BW switch is detected by the decoder by a port reconfig event
  instead of a discontinuity event
- Handle port reconfig dyanamically in ACodec
  Steps are - Flush - Get all buffers back - Disable - Enable
- Handle PID change in TS Parser - Set PID based on stream type

Patchset 1: Add QCOM_HARDWARE ifdefs

Conflicts:

	media/libstagefright/ACodec.cpp

Change-Id: I5ff494084fffa218cafd3cd6db1197aad2233c4d
frameworks/base/NuPlayer: Handle Seek from NuPlayer

- Seek was handled by the source by queuing discontinuity events
  individually for each stream.With this approach renderer will
  continue till discontinuity events are handled for each stream
- With the new approach seek is handled by the player -
  - get the new seek time from source
  - flush the source TS segments in LiveDataSource, access units
    in TS Parser, decoders and renderer
  - notify current position to driver
  - LiveSession will not queue a discontinuity for seek.
- Add a mutex lock for connect & disconnect ChromiumHTTPDataSource
- Handle flush in ACodec - Idle to Executing & Loaded to Idle states

Conflicts:

	media/libmediaplayerservice/nuplayer/NuPlayer.cpp

Change-Id: I8a741c2c665d3aca715734fc1fd1eeae33a6271b
Add customized parameters for qcom camera features.

Squashed commit of the following submissions to CAF:

camera: add custom camera parameters to hardware java file.

Change-Id: Ic2b363df6d25a0c3a49aed30e717d10874f533ae

Camera: Add support for wavelet denoise

Change-Id: I97be72615fe5909987ac430034bbdc16f2d20509

Camera : Add support for histogram in frameworks

Change-Id: Ibf751c3b2d488f4be0afaaa3e994372bafeffbe7

Camera: Add ZSL support in framework.

Change-Id: I4e863020d7d407d9c3936beb83dc7abf385c4654

Camera: Add touch AF/AEC support in ICS framework

In, ICS the old touch AF/AEC functions getTouchIndexAf(),
setTouchIndexAf() etc  are no longer valid. Added new functions  to get
the center of touched area.

Change-Id: I37d00040f895cd8a4de2e2a438971aa2d9c1a045

Camera: Add support for Red eye reduction

Change-Id: Iada280ac33aee8b1114dc40d8d79e0e47ad5c2fd

Conflicts:

	api/current.txt

Camera: Enable streaming texture and YV12 feature

Change-Id: I814c92b469e0f25baef0ce80338761d1e6443085

Camera: Add frameworks support for high frame rate

Change-Id: I9722e9b7e61433651ab5f76f76208853eb1fd849

Camera: Simplify ASD menu and best mode menu.

Change-Id: Ia7a1eca9268eec021a6e2c3f7ce2a932e8819d50

Camera : Macro definition change. PIXEL_FORMAT_YV12 to "yuv420p"

Why: CTS testcase is expecting "yuv420p" as the format string for YV12 mode.

CRs-Fixed: 328252
(cherry picked from commit 0a263f67b75497e4b95b9de8c370ed9496ab59ef)

Change-Id: I66f418a52775a969d81bcb332bbe500370e3ab7c

Camera: Changes for face detection

Change-Id: I7b2172e8690d6e23762e42f5888fecbfda15ba61

Camera: Add support for burst count

Change-Id: I4488a5eac1eebb0b5c8e2cc7cbbe7be0c7301be7

Camera: enable HDR feature

(cherry picked from commit e40770bbdadd925fc1e07a08249a15981b961570)

Change-Id: Ie9ca3066e8e53710bf292d047a3724aefc029854

Camera : Add API to find fullsize liveshot support

Change-Id: I3c2fc3578decbe5cf87fded5362f317df0b40b5e
(cherry picked from commit 65d80f04892776eec1c19c844eacb8c454b4bd1a)

Camera: Set default camera area string

The default invalid value for KEY_FOCUS_AREA and
KEY_METERING_AREA is changed to "(0,0,0,0,0)"
CRs-fixed: 334934

Change-Id: I354802c8611ee5c00a591b96b1a1ca04926969cb

Camera: Change the scenemode names in framework

To comply with ICS API Specification,
SCENE_MODE_AUTO changed to SCENE_MODE_ASD
SCENE_MODE_OFF changed to SCENE_MODE_AUTO

Change-Id: I8e744f10c728f469923b09f69d6d64bc5c7c6850

Camera : Framework changes for camcorder UI menu

Change-Id: Iff9e9021da44b67f81a24c828b960113ee249248

Camera : Remove unwanted video resolution in Framework

- FWVGA, WQVGA resolution UI options are removed for camcorder.

Change-Id: If621140966b01dbc8c30a4d161e6771528b8adda

Camera : Enable FWVGA and WQVGA resolutions in camcorder media profiles

Change-Id: Iad9cc33f7b6d8eb7de21df372c016edeef0b99ba

Unlock camera AWB lock only when white-balance is changed.

bug:5633546
Change-Id: I90bb4b5b445daedf38a64e2f8fb980fc0f0aaa81

Change-Id: Ie3cc15132489502e64321776d49d96846b5705d6

Conflicts:

	include/camera/CameraParameters.h
	libs/camera/CameraParameters.cpp
frameworks/base: Add rendering statistics to Stagefright (Adapted)

- this is an adaptation of change 514 (I88dd988c9) from HC to ICS
- functionality is the same as the forementioned patch
- added all statistics properties for AwesomePlayer into
  Google's Stats struct
- acquire locking before modifying/accessing mStats values
- moved mStatistics check in AwesomePlayer to inside the log functions

Change-Id: I553823b22403a0e5e9fc3998a27a54fec9e1b5c4
libstagefright : Fix for clips with Corrupt NAL length

-Stagefright returns ERROR_MALFORMED if the NAL length is corrupt
 resulting in Cannot Play Video message.
-Ignore the frame if the NAL is corrupt.
-Return Custom error ERROR_CORRUPT_NAL and issue a new frame read.

Change-Id: I248b9920d0c3588c5e433e0822f3f663993f2858
CRs-Fixed: 256840
libstagefright: Use QCOM Non tunnel AAC HW Encoder for AAC recording

- Added QCOM NT AAC HW Encoder to encoder list to use it for
  AAC recording

Change-Id: I508d7e5288fadf30f1d3e57f12895ca73a8d4322
libstagefright: Fix to free buffers properly in ERROR state

- In the ERROR state, OMXCodec::on_message tries to free the output
  buffers in the FBD sequence. This can fail if the OMX component hasn't
  been moved to idle state.
- OMXNodeInstance does not check for the return value of OMX_FreeBuffer
  call and returns the buffer entry from the list of active buffers
- This buffer ends up being unfreed which can adversely affect
  the next video playback

(cherry picked from commit 6ef3096b6db1cee7fec57da3ae4c519cdaa28bbb)

Change-Id: I9d80fd0f3c3e75da41697370f787df72316b32e4
CRs-Fixed: 329874
libstagefright: Handle error on allocate buffer failure

Set state to error on allocate buffer failure at start(init)
of decoding.

CRs-Fixed: 332373
(cherry picked from commit c7a957b7595fff44f9242ddcd3eeeabe827f9639)

Change-Id: If0796250c6385df28e3545c08e90e1626ff5e709
libstagefright: State checks before calling OMX_FreeBuffer

- Add state checks based on OMX IL specification before
  calling OMX_FreeBuffer

CRs-Fixed: 332651
(cherry picked from commit 1e141b3eb230dcfa2b1befe8456637a81d83cb36)

Change-Id: I9fbca2938ba40affbb72d464a443902f004f2ae7
libstagefright: Fix crash during 3D Video playback

The crash was observed while handling extra data in FTB.
This was due to improper assignment of buffer handle to
pBuffer. This assignement is corrected in OMX component
and hence CHECK_EQ for buffer handle in OMX nodeInstance
is removed.

Change-Id: Ib1eb206a201f2e23aec2137b64b93bcb0fc2d221
CRs-Fixed: 328535