camera: fix non-working preview resolutions

For some reason the plane[0] length (Y data) is wrong for these
resolutions. Set it to width * height instead.

Change-Id: Ib40de19ffa76319c91e0a9e71eeb86597bc7f325
camera: fix scene mode

Change-Id: I3a5a7046c0f462418ea270548b43afe25dba86c8
camera: don't set a default video size

This fixes the preview being cropped because it was using 1920x1080
rather than the actual preview size to grab frames from the camera. By
not setting this parameter here it is filled in later in setVideoSize().

Change-Id: Ia0b16f01075e382017e0f5aa965d02cda554ca65
camera: fix setting the EXIF tags for timestamps and GPS data

EXIF data wasn't being sent to the JPEG encoder, it also wasn't created
correctly and the tag IDs for the dates were wrong too.

Change-Id: I7a2844c6e618c5542e6a8d1299820764e5101979
camera: add 960x720 preview resolution

Panorama mode looks for this resolution or smaller so ends up using a
height of 480 without this. It's possible to get 1080 by also adding
1440x1080 and changing the Camera app, however this causes problems with
other apps.

Change-Id: I930bc2c9d04e71b513cda354143fb02a04e3f085
camera: add sharpness, contrast, and saturation compatibility values

Qualcomm uses sharpness-max while other manufacturers use max-sharpness,
so add both values. This lets apps like camera360 work better.

Change-Id: Ia38b5ae60d0c3d7d108e0f65c53127ed9792fefe
camera: make these parameters 32-bit

These parameters should be 32-bit from their usage.

Change-Id: I67171959444573c11fbbe45f961381db15c728fa
camera: fix setting the exposure metering area

HTC uses an older structure for the area to use for metering.

Change-Id: Id423d87c4e995bc8d124bc070f0cc66218c5f8fe
camera: fix corrupt thumbnail in ZSL mode

Add some changes from CAF/ics_strawberry to set the thumbnail size to
the preview size in ZSL mode. Thumbnails can also be dropped but it
doesn't seem like that ever happens.

Change-Id: I8d5ed954e151b6e5266c072757cecf54f2c34f8d
camera: fix camera preview failing to start after picture taken

If the snapshot hasn't completed wbefore the preview is started the
camera will crash. This patch releases a mutex and polls the camera
state until it's ready. It should probably be done with a semaphore,
however it's not clear what all the locks in the code are for, so this
should be safer. It doesn't appear to wait more than 1 ms.

Change-Id: I3ccad9b0eb3744809705849e98b45f66a650d1e7
camera: use correct aspect ratio for thumbnails

In non-ZSL mode thumbnails are always 512x384, this patch chooses a
thumbnail resolution based on the picture aspect ratio and ignores
thumbnail resolution set by the app. It doesn't appear that many apps
set the thumbnail resolution so this should be safe. ZSL mode continues
to use the preview resolution.

Change-Id: I9702e1267ea41869c709edb2a1a63076bba0044c
camera: fix ZSL mode with flash enabled

ZSL mode can't use flash because the snapshot has already been taken.
This patch switches between ZSL and non-ZSL modes depending on whether
the flash is needed. ZSL mode is restored after the snapshot is taken.

Change-Id: I6dd473a9dc98cc0ff6394074fefaca6292e944b3
camera: fix thumbnails again

Set the thumbnail size in the dimension structure correctly.
Also set default thumbnail quality to 50.

Change-Id: I983d17cab49c39cbdf95eaf14a18ad70a7d53293
camera: fix thumbnails for liveshots

Liveshots always need 512x384 thumbnails for some reason.

Change-Id: I4e8716b6f2f4aa93f766423e5d5ca07a4e7dd0c6
camera: silence some preview messages

Change-Id: Idc0c17a58031cdfdeeeb5c14d1db82760ce7f301
camera: change 1080p resolution to 1920x1088

This fixes liveshots during 1080p video recording since liveshot height
must be a multiple of 16. It shouldn't break anything else as this is
the resolution of the stock video camera.

Change-Id: I071153adf797d77dbc29eecbda5b4ac7e4f7c3c0
camera: fix ION ifdef

Change-Id: Icfefa5285077f76739bd43a9b079fc1b12fa0fea
camera: change LOG statements to JB ALOG statements

Change-Id: I26082d5630ab87872e33cfb886a1119ed2746f15
camera: fix autofocus mode

HTC changes a native_parm value.

Change-Id: I2b49839f389f30c14a86f3829353db78e6bf4fbe
camera: fix ZSL mode and allocate memory from IOMMU heap

ZSL mode caused an IOMMU page fault because the stream stop methods stop
the stream and unregister buffers. This is fine if there is a single
stream, however ZSL has a preview stream in addition to a snapshot
stream. When one of them unregisters buffers the other is still
streaming and will fault. The solution is to stop both streams when the
snapshot stream stops and not stop the preview stream, but to only do
this if ZSL is enabled. Switching from ZSL to non-ZSL mode to use flash
also needs to stop the snapshot stream first. This patch also allocates
memory from the IOMMU heap as well.

Change-Id: Ia96692a5fa28873e0372f1c1f09d2fa405487561