httplive/ACodec: Enable smooth streaming

- Use property to enable - hls.enable.smooth.streaming
- Set component in smooth streaming mode by doing a setParameter
  with OMX extension for SS
- Handle Port Reconfig Info event from component
- Whenever resolution changes do update buffer geometry on
  native window

Patchset 1: Add QCOM_HARDWARE ifdefs

Conflicts:

	media/libstagefright/ACodec.cpp

Change-Id: I694d05fe7aba2482f50f31a6e80b646822f15b31
libstagefright: return proper color format on target basis.

 Video preferred Color format is different for different targets.
Add a method to choose the preferred format for each target.

Patchset 1: Add QCOM_HARDWARE ifdefs

Conflicts:

	media/libstagefright/ACodec.cpp

Change-Id: Iba28d5d6e2917792492b3b2e9d38396d468f3202
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
libstagefright: Add support for fragmented MPEG4 container

- Stagefright parser dosent support parsing fragmented 3G2 clips
- add support to used mm-parser to parser fragmented 3G2 clips

(cherry picked from commit f1eb550a11bdc2a4534a89764f8c42008add90ae)

Change-Id: I9afcbd144dbbd50218b5ad8733b07d6c73f5f4d7
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
framework\base:: remove decrypt handle

Decrypt context will be created directly in decoder so remove the code
that was used to copy the decrypt context pointer from parser.

(cherry picked from commit 5bb0aa03232513255ee22607f6995040a6b19cb7)

Change-Id: I01e540a0c28f0039f037a5045b4b1da78c12550c
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: Change allocation buffer count for VideoEditor

- OMXCodec: AllocateBuffersOnPort: Add a check to allocated
  minmum buffer count for encoder, min + 1 for decoder input
  and min + 2 for decoder output

Change-Id: I483cbe0587b76b0c029e11054eda666e548c2b63

Conflicts:

	include/media/stagefright/OMXCodec.h
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: Enable frame by frame mode

- Enable frame by frame for all formats - local playback & http
  streaming.
- Arbitrary mode is enabled only for specific formats by setting
  a new key (kKeyUseArbitraryMode) in extractor, for following
  formats :
  - H264 Interlaced clips
  - VC1 Advance profile clips
  - MPEG4 in AVI container
- If the arbitrary mode key is not set by the extractor, it will
  default to frame by frame mode for all video clips except
  interlaced clips.
- Adds SPS parsing functionality.

Change-Id: If8c47d0499720eead86b4c4fbe74696aba4423fb
CRs-Fixed: 322872
libstagefright: Crop the native window with the display resolution

We were providing the native window with the display width and height in
set_geometry.  On the surfaceflinger side, they assume that this is
aligned, which causes problems for HDMI.  Instead we'll now pass in the
aligned stride and slice in native_window_set_geometry, then specify the desired
display width and height by calling native_window_set_crop.

Change-Id: I9b9a910e951468bdeb30f3f8ea9df70f3c2ad00a
CRs-Fixed: 283063
libstagefright: Add interlaced video support

Stagefright waits for the Index Settings changed event to be propagated
to it from the component. If interlaced, appropriate flags are given to
the native window.

Change-Id: I240c5139232c6905c3de7632885736147d5f70b1
(cherry picked from commit ce070db0c8d491218adb9a8386116d39909813e9)
libstagefright: Fix for crash during playback of unsupported clip

-Crash in media server observed during playback of unsupported clip
-The OMX_EventError not handled properly in SF IL client leading
to crash as i/p buffers and o/p buffers are not freed.
-Shutting down the i/p and o/p ports when OMX_EventError is
received with state OMX_ErrorInvalidState. In error state,
free i/p and o/p buffers on receiving empty buffer done and
fill buffer done messages.

Change-Id: I6d2b7b659b5f424b9fc5d668e47f2a9d51b49314
CRs-Fixed: 331572

Conflicts:

	include/media/stagefright/OMXCodec.h
	media/libstagefright/OMXCodec.cpp
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