CameraHal: Disables SW video scaling if framerate is above 15

- Fix for DR: OMAPS00254351

Change-Id: I053288d70df9cfd81ad0028f99a1c7ff9c606a57
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Test application: Validate MM VTC use cases

Application for testing VTC requirements
Usage: /system/bin/VTCTestApp test_case_id

Test Case ID can be any of the following
0 - Runs all the tests listed in the UTR. Pass/Fail must be determined by the tester after examining the recorded clips.
1 - Default test case. Does not require any parameters to be set.
2 - Tests the ability to request I-Frame generation real time. Option: -I
3 - Tests the ability to specify the maximum allowed frame size. Option: -s
4 - Tests the ability to change the bitrate at runtime. Option: -B
5 - Tests the ability to change the framerate at runtime. Option: -F
6 - Test Playback and Record. Option: -p, -n
7 - Test PIP. Option: -p, -n
8 - Test Video playback Only. Option: -p
9 - Robustness. Default: play and record the predefined resolutions (VGA & 720p). Option: -c, -v

Available Options:
-n: Record Filename(/mnt/sdcard/vtc_videos/video_0.3gp) is appended with this number. Default = 0
-w: Preview/Record Width. Default = 1280
-h: Preview/Record Height. Default = 720
-d: Recording time in secs. Default = 10 seconds
-i: I Frame Interval in secs. Default = 1
-s: Slice Size bytes. Default = 500
-M: Slice Size Macroblocks. Default = 100
-b: Bitrate. Default = 1000000
-f: Framerate. Default = 30
-I: Insert I Frames. Specify the period in secs. Default = 1 second
-B: Change bitrate at runtime to this new value. Default = 100000
-F: Change framerate at runtime to this new value. Default = 15
-p: Playback Filename. Default = /sdcard/nasa.mp4
-c: Robustness, number of cycles of Playback & Record. Default = 10
-t: Playback Duration in milli secs. Default = 0 = Play till EOF
-v: Robustness. Which test to repeat? Range: 1-8. Read test descriptions above.
Default = -1 = play and record the predefined resolutions (VGA & 720p)

Change-Id: I884e654c3f3f7c4bb6e742a9ac4ea745ae875d85
Signed-off-by: Jorge E. Solano <jsolano@ti.com>
Signed-off-by: Anu Sundararajan <sanuradha@ti.com>
Revert "Remove non-(calibrated, api, or verified) 3A settings"

This reverts commit 0aa3eea21098a49cf7601d135945d0feae9c3e72.

Change-Id: I06f5182a9b8ccc2544bcf24b72274df225125e9c
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
CameraHAL: Fix some corner cases while handling Variable FPS Handling

Port FPS takes lower priority than VFR. But there was invalid check to take of
this priority which resulted in incorrect setting of VFR in some corner cases.
This patch makes sure Port FPS is considered only if no Range is Provided.
This patch partially resolves the DR : OMAPS00254364
This patch along with #16816 in Application completely resolves the DR.

Signed-off-by: Sathya Prakash M R <a0393677@ti.com>
Change-Id: I8aa2b5019ddd433d82fff1bad65f8cd16d2778df
Fix PIP mode and update automated testing

PIP was not exiting at the end of playback.
Automated testing parameters were updated.

Change-Id: Idc264f0ba98f3398e9930b3e8372d035f9ec6c52
Signed-off-by: Jorge E. Solano <jsolano@ti.com>
CameraHal: Add missing null check in OMX3A

Check for null before strcmp

b/5639860

Change-Id: I552213c9894679eeb64cd06419f3f430276b273e
Signed-off-by: Tyler Luu <tluu@ti.com>
Prevent out of bounds access to gralloc handle map

1) Flush DisplayQ when stopping display adapter so subsequent
usecases are not affected with display adapter is restarted
2) Protect against out of bounds access to gralloc handle map
by checking buffer index

Change-Id: I3d3d61abffb792f34c1d3740f8c9879c6657392a
Signed-off-by: Tyler Luu <tluu@ti.com>
CameraHal: Fixes a corner case with temporal bracketing

- Currently it is possible for the camera client to cause
  CameraHal to allocate just one image buffer when in
  temporal bracketing mode. This might lead to crashes when
  image capture is started. The patch should handle this
  special case by allocating the required buffer count in
  advance.

Change-Id: I3ca2a96cb03eae2cfd39d4449f9dae09ef6266ee
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Revert "Test application: Validate MM VTC use cases"

This reverts commit 8bc9a80cc69844394b4379133e2bb760405a217b.

Conflicts:

	test/VTC/VTCTestApp.cpp

Note# Since there are interface level changes for
MediaPlayer between MR0 and MR1, this test app
needs to be revisited.

Change-Id: Ie4d92f27f95e400f6f88c7a9bdd75b0cdbb8660a
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
CameraHal: Populate default flash mode in supported flash modes.

Populates the default flash mode (off) in to supported flash modes
when ducati doesn't send the supported flash modes.

[DR]
-
Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com>
Patch set 3:  Simple cherry-pick; no changes made.  Taking
approvals and verifications from patch set 2.
Signed-off-by: Jean Johnson <a0271255@ti.com>
Change-Id: Ifbf990d97af10250bc752eb80d005163b01b85ff
CameraHAL: Re-enable burst support Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vicky Martinez-DeFrain <a0869710@ti.com>

Change-Id: I3f5aa35b07ee2735ffd6c0d0539ba8f4a8ed790d
CameraHAL: Fixes a couple of inconsistencies in OMX capabilities

- The default VFR range from 'encodeVFramerateCap()' is
  never used. Instead a hard-coded one is inserted, which
  will lead to a camera crash on sensors with capabilities
  not within this default.
- The order in which constant framerates could be inserted
  is wrong. It should always be descending.
- Removes a minor of issue with the inserted commas as well.

Change-Id: Icfaf2553852ba8ff9a954ed135edf0e0a9930330
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
CameraHAL: Add OMAP_ENHANCEMENT around BURST mode

Since the value CAMERA_MSG_COMPRESSED_BURST_IMAGE is wrapped
with the OMAP_ENHANCEMENT flag the useage should be wrapped as
well so builds without the OMAP_ENHANCEMENT flags will not fail

Change-Id: I8e36d0f052624590257e5360822841c45132dcdd
Signed-off-by: Dan Murphy <dmurphy@ti.com>
camera_test: 3A settings can be applied before starting the preview

- When preview is stopped camera is not closed.
- This prevents calling the default parameters when the preview is started again.
- The set parameters before starting the preview are applied.
Signed-off-by: Dimitar Borisov <dborisov@mm-sol.com>
Signed-off-by: Vicky Martinez-DeFrain <a0869710@ti.com>
Change-Id: I56db429c403e841b2c937e401169df4bfea6d32d
CameraHAl : FPS check updates and Secondary Camera FPS support

1. Secondary Camera on Blaze supports max of 27 FPS. Hence added (27,27)
   as supported FPS. This is necessary to validate constant FPS on Secondary
   Camera in Camcorder mode using OMAPCamera app.
2. The FPS parameter validation is modified to make sure the deprecated
   FRAME RATE validity is checked only if FPS Range is invalid. Earlier FPS
   parameter check failed even though the FPS range was correct.
Patch set#2 : Some coding style corrections.

Signed-off-by: Sathya Prakash M R <a0393677@ti.com>

Change-Id: I615b394fbc12818128d041d6495b55b8ecf09870
Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com>
CameraHAl: Test App: reset the preview count.

Resets the preview count to zero during startpreview().
Fixes the issue of not getting the preview dumps from
2nd start preview command.

Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com>

Patch Set 2:  Simple cherry-pick on the current tree.  No
changes made.
Signed-off-by: Jean Johnson <a0271255@ti.com>
Change-Id: I2eca1bb3990153069a7278f968422085abb41947
camera_test: Fix for zooming the preview

 - KEY_ZOOM values can be set from 0 to 30 instead of 0 to 60.

Change-Id: Icf79f6388c0aaab7657fb1fc6829fab7483d4014
Signed-off-by: Dimitar Borisov <dborisov@mm-sol.com>
camera_test: Fix for stop video recording

- Fixes segmentation fault when try to stop video recording.
- Camera is disconnected after stop recording and stop preview.
  Not before that.

Signed-off-by: Dimitar Borisov <dborisov@mm-sol.com>

Patch set 3:  Simple cherry-pick on current tree.  No changes made.
Taking verifications and approvals from patch set 2.
Signed-off-by: Jean Johnson <a0271255@ti.com>
Change-Id: I4fc5a676092ca35c41051fc4f84924c3832edae5
CameraHAL: Test App: Getparameters only for first time.

Acquires the parameters from cameraHAL only for the first time
in the opencamera(). So that the test app retains the users
selection of parameters.

Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com>

Patch set 3:  Simple cherry-pick on current tree.  No changes
made.  Taking verification and approvals from patch set 2.
Signed-off-by: Jean Johnson <a0271255@ti.com>
Change-Id: I6092c6e9fe12caa74c8c226528b15b62e8fce890
CameraHAL: Zero Shutter Lag support for camera_test

Signed-off-by: Georgi Georgiev <x0154504@ti.com>

Patch set 2:  Simple cherry-pick on current tree.  No changes made.
Taking approvals and verifications from patch set 1.
Signed-off-by: Jean Johnson <a0271255@ti.com>
Change-Id: Ia77b9f9a0b2ec607eb96b6c76a880d7148385595