camera: Fix hang when changing picture size

Change-Id: I46d060d470b96be56d84f273accf54702e72b321
Camera: Fix for stretched preview in front camera

Stretched preview is observed due to front camera's mount angle.
This patch resizes preview frame using aspect ratios so preview is not
stretched when using the front camera in still and camcorder mode.

Change-Id: I70b5534dd3020bdf46afdfdcefc39d89a2b2e450
CRs-fixed: 435942

Camera: Fixes stretched preview in camera application

- The preview screen nail is getting set with the
  preview frame layout size, which depending on the
  preview resolution might lead to aspect ratio
  mismatches.

Change-Id: Ifdc436feffefa4ad95d3915f48724b0fc3684d9d

Camera: Updates preview screen nail correctly

- Querying the width and height of the screen nail
  currently will return the render width and height
  which in turn depend on the preview frame layout
  size. In cases where both sizes match the screen
  nail will not get updated properly. Instead of
  using the render width and height this change
  uses the actual size of the nail itself.
  This way changes to the resolutions are
  recognized properly and the nail is updated.
- This patch also removes 'updateCameraScreenNailSize()'
  and extends the functionality of 'startPreview()'
  in order to update the screen nail for the cases
  where the preview and the nail size don't match.

Change-Id: Ib99f47f4094e01724725098847f42197b4442c03
Camera: Allow setting "profile-video-size" before recording starts

In Samsung Galaxy TAB 10.1 (p4, p4wifi, p4tmo, p4vzw) in HD (720p)
recording dicoloration happens on top third off all video recordings
due to the preview size not set correctly. This fixes it that the
correct preview size is set so that no discoloration happens.

Change-Id: Ib51be18dff76df882984e644becb9430fe6cd5c8
camera: Add options to better control video preview size

 * usePreferredPreviewSizeForEffects is needed to fix camcorder effect on
   some MSM8660 devices.
 * Add ignorePreferredPreviewSizeForVideo to use the best size reported
   by the driver instead of the preferred-preview-size-for-video value,
   which may report something really awful.

Adapted for cm-10.1 from similar commits in jellybean.
  https://github.com/CyanogenMod/android_packages_apps_Camera/commit/5ea90585dfce5a38f0c91d2ae07145770a0ea569
  https://github.com/CyanogenMod/android_packages_apps_Camera/commit/7310af07d00910033adbd2dce6aaf8b04cd1f220

Change-Id: I58d4f81333a26dbd6d1ce35037b9c32fbd7d5b69
Revert Fest in CM!

This is why we hate CM!!!

Revert "Camera: Fix for stretched preview in front camera"

This reverts commit 0b60b4b074dc05ded53cc7c11c51e66ec95a6a2e.

Revert "camera: Fix hang when changing picture size"

This reverts commit 61c9364715f80ea7ab245d18947f448bd658919d.

Change-Id: I0e6ee67e2166a3a0ea0e512389435a72122c4c6c