samsung: add support for tvout and yamahaplayer services

Change-Id: I653f9876b7fb83734abf3a0b9b9b5af1920b8112

libmedia: renamed cflag for samsungs isSeparatedStream()

also needed on non-yamaha sound phones
BOARD_USE_YAMAHAPLAYER -> BOARD_USE_SAMSUNG_SEPARATEDSTREAM

Change-Id: I5326f4e561102df4d47152b560fe0185fa848ff5

libmedia: build with AudioParameter if needed

Usage:
BOARD_USES_LIBMEDIA_WITH_AUDIOPARAMETER := true

Change-Id: I4d33afcf2af200f70120ee9b9ee03c8830712686
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: Video playback bringup

Change-Id: I2d3420a391a085045607bd618772e34d6360da2d
libstagefright: Initial commit for camcorder bringup

TBD
- Remove check in drainInputBuffers
- Remove check in getFrameSize

Change-Id: I29f4df547b3482e9e62501b7f3311af74d2efea0
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
stagefright: Allow compatibility with ICS EGL for OMX

QCOM uses the OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka
format for video buffers, which in ICS was "translated" into a different
gralloc format (0x108, HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED)

JB uses the same value for both the buffer format and the pixel format,
which the ICS Adreno libraries don't recognize. If using such libraries,
enable the conversion with the QCOM_ICS_COMPAT CFLAG

Change-Id: I85b50f193c25c88f4517677dd4a328a0c83f941c
Fix building on qcoms with incomplete configs

Change-Id: Ib5224c993ed1f03d3bd09c0f4a05d2cb7d5d1c2c
Add support for ICS audio blobs

Enable with the ICS_AUDIO_BLOB CFLAG

Change-Id: Ie174d5997202b8931c1f11db62b6ec2e377f096a
audio: Add compatibility bits to use legacy libaudio implementations

Enable with BOARD_USES_AUDIO_LEGACY, requires the use of the generic
legacy audio shim

Change-Id: I60407b48c2a8f3c9736805f31dcdef280c9aa485
libmedia: Add ICS constructor for getOutput

Used by the Tegra ICS OMX libraries

Change-Id: I2f6e7f10f11b53853626d1be86e7b2be870720f4
Add Samsung OMX and Color Format support (2/2)

Change-Id: I76ca4c2bcd61ee27156d6104f212b8ec0b491fbd
Merge branch 'jellybean' of git://github.com/CyanogenMod/android_frameworks_av into jb

Conflicts:
	services/camera/libcameraservice/CameraService.cpp
audio: Temporary workaround for missing QCOM LPA

 * Temporary workaround to fix ABI

Change-Id: I7e7f44048b982ddbc843b3818861727fb473ae11
camera: Add parameters for some Samsung cameras

 * Enable with SAMSUNG_CAMERA_HARDWARE
 * Adds anti-shake, metering, and wdr modes.

Change-Id: I080c90e11fcb8fa48900c01a454868f173f61eb0
ACodec: Video bringup for NuPlayer and other fixes

- Add tile color format
- Handle Flush command in intermediate states

Change-Id: Id60e6a47d7dba39ea6febbfa55f64b6480ac54fa

Process EBD and FBD messages in ERROR state

- OMXCodec::on_message() function drops all OMX messages if
  OMXCodec is in ERROR state
- This can cause EBD/FBD messages containing valid buffers to be
  dropped
- Avoid dropping EBD/FBD messages so that buffer book-keeping is still
  possible

Change-Id: Idc1174b3fa946b26458d49394b87fba1738b228e
Signed-off-by: Iliyan Malchev <malchev@google.com>

nuplayer: Fixes in nuplayer Renderer

- Fix to allow EOS to be queued & handled even before
  a single frame is rendered. This can occur for suspend
  resume scenarios, where seek fails after resume.
- Reset the mSyncQueues flag when an EOS is queued immediately
  after seek
- Fix in AV sync calculation for video only stream's pause
  scenario

Change-Id: I881b9d0584dddde5f20da54f0501258649c9c600

NuPlayer: Fixes in NuPlayer

- Do not scan for sources during pause
- Do not create Video Decoder if Surface is not set
- Do not create Audio Decoder if Audio Sink is not set
- Enable fetchFile & BW estimate logs in LiveSession
- Enable format changed, and EOS logs in NuPlayer

Change-Id: Ia829dd6bb11fd4d1305caaa1dbac7434ea33e02f

ACodec: Support for dynamic port reconfig

- On port settings changed first flush output port
- Move ACodec to new state called FlushingOutputState
- Flush all output buffers, wait till all decoded buffers
  are rendered
- Then disable output port, and allocate output buffers
  with new resolution, and reset native window

Change-Id: Iafa266371ed2a87b909fbcb4eeae6b64208df617

NuPlayer-HLS: Support for handling 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 will be handled by NuPlayer directly
  Flush & reset decoders & renderer, then scan for sources
- Update meta data in ATSParser & AnotherPacketSource after seek
- Add a new discontinity type for HLS seek, and set it for seek

Change-Id: Iaff05b33f9a8d244cddbc53ae55219fb8568e614

libstagefright: Thumbnail mode initial commit

- DIVX and WMV are commented out for now
- Fix thumbnails for videos with non multiple of 4 width
- Fix source start assertion failure on MPEG4Source

Change-Id: I0e8974e088fdcc468e27764861c128cfe291499f
CRs-Fixed: 346285, 331371, 326063, 325461, 323538

libvideoeditor: Initial commit for VideoEditor bringup

- Add the color conversion routines of TILE4x2 to Planar and Planar
  to Semi-Planar to libI420colorconvert.so
- Set the native window buffer count to 3 for image preview
- All Features are supported, Resolutions upto 1080P are supported
  (constrained by available memory) as we need to support two codec
  instances at a time
- High and main profile clips cannot be imported
- Export is in H264 always (Coming from the app)

- NativeWindowRenderer: Fixed the green tint issue when applying
  negative effect
- M4xVSS_API: Do not go through the M4MCS path if there is an
  effect in the clip(avoid double encoding)
- M4MCS_API: Remove the limitBitRate function as we set the bitrate
  in Encoder
- VideoEditorVideoEncoder: Add a function to calculate proper bitrate
  for different quality and resolutions

- Remove the check for effects present in the project to get original
  functionality. This check would encode all clips in the project if
  an effects existed via the _EDIT path. But it fails for HP clips.
  Hence reverting it.
- Only encode in M4MCS for input profile > output profile

- When parsing a clip, add support for level 6 for simple profile
  MPEG4 clips
- However map it to level 5, since OpenMax does not have support for
  level 6

- When creating transitions, the bitrate is copied from the input file,
  if this bitrate is > 20Mbps, it results in an error.Limit this bitrate
  to max of 20Mbps

- During preview, after calling start on mVideoSource if the component
  runs into an out of memory error, then first stop the mVideoSource
  before clearing it.
  Once the source is NULL(cleared), add a check to handle that case
  and propogate it upwards to the app.

- If there is clip with begin cut time and MPEG4, then let it encode
  via the M4MCS path first. Null encoding leads to corruption - because
  in null encoding, if we have a begin cut time then it will decode
  upto that time, encode the frame at the cut time and just copy the
  rest from the reader and write to the intermediate file, resulting
  in corruption. Instead now this change will make it encode from the
  cut time all the way to the end of clip.

- For H263/MPEG4 encoding, bitrate is not reconfigured.We break out
 from the case to avoid getting into the default case.

Change-Id: I850edc1fcaad167250089644a4435bc549f1e31d

CRs-Fixed: 327213, 329321, 328501, 329324, 332373, 332959, 375291

libstagefright: Add support for mm-color-convertor

- Define structure and enums to be used by stagefright
  to interact with mm-color-convertor library
- Adds support of NV12 Tile to RGB565 color conversion
  using the qcom color convertor library.
- Use proper mangled name for color convertor API

Change-Id: Ifd87d0e56c5fe4c9f605321abdd39574415733f5
CRs-Fixed: 329591

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: Fix to use correct HAL pixel format

Use correct HAL pixel format to update buffer geometry
using native window API for 7x27A/8x25.

Change-Id: I3602cf3e21d259a79f36db3103ab5f18ec2a1010

Conflicts:

	media/libstagefright/OMXCodec.cpp

libvideoeditor: remove header file added during bringup

This header file was added to this directory while merging
changes to JB.The header file exist in a different location.
Source code which need the header file is updated to include
correct path.

Change-Id: I95a8cb7dcc13ddb925d4e4f55fbeabbf54f9ca61

libstagefright: Ignore bad size error when parsing d263 atom.

Change-Id: Id71c6d55181d46671aba3e14bfbc4933687b180f
CRs-Fixed: 288020

libstagefright: Handle error on allocate buffer failure

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

Change-Id: Id16cb68aad95bf60aa520d1cc7378cfe0f88b65a
CRs-Fixed: 332373
Signed-off-by: Shalaj Jain <shalajj@codeaurora.org>

libstagefright: Add definitions for sync margins

- Added definitions for late and early margins in AwesomePlayer which
  are used to decide if frames should be delayed or dropped

CRs-Fixed: 276424, 297660

SampleTable: Add shortcut in getMaxSampleSize() to avoid ANR in corrupted clips

-for very large/corrupt values of mNumSampleSizes, getMaxSampleSize will
 run a very long forloop that will cause an ANR
-for cases where mDefaultSampleSize is zero, this ANR issue will not
 occur becase a check is in place for checking mNumSampleSizes corruption
-for cases where mDefaultSampleSize is non-zero, getMaxSampleSize will proceed
 to process each sample for finding max size.  But each run of
 SampleIterator::getSampleSizeDirect will return mDefaultSampleSize as the size
-a check for mDefaultSampleSize being non-zero is placed before the for loop,
 and will return mDefaultSampleSize if it is the case, skipping the entire for loop
 and avoids ANR

Change-Id: Ib2af5f18a2d15fb8efa6e1edaa2e5b46f6746fe8
CRs-Fixed: 316017
Stagefright: Add H263 and common components of AVI/WMV container

Note: ifdef removed from omapzoom, its just constants,
      to change if required later...

Change-Id: I1ed50f1fc0467ed9ca9556df5f1d59ea088a591a
StageFright: enable mp3 audio for mp4 container

based on http://review.omapzoom.org/24931 and 24935

Change-Id: I1f998e773af6a5b3c29411879a2cc8570fb9f2f7