Added support for secure OMX component.

Change-Id: I249d423c5c38f4505fe6ff9a05aa267a7df6abc4
vidc: support for ION secure heap allocations.

Added support for video decoder secure heap
allocations.

Change-Id: I849990e171ad688cdd37c20f6e1968ad25cacfb7
vdec: Return error if OMX_FreeBuffer is called in incorrect state

- Return a proper error code (OMX_ErrorIncorrectStateOperation) if OMX_FreeBuffer
  is called in an incorrect state.

Change-Id: Iffece6d8437a750fee3902b09d84c56bab948d05
CRs-Fixed: 329874
vidc: Fix for ANR due to continuous bit stream errors.

For consecutive ETBs with bit stream errors, FBDs are
not being generated for a long time, resulting in ANR.
Fixed this by checking the number of consecutive
input frames with bit stream error and then generating
OMX event error.

Change-Id: I79bd1f7f779d07f0bd5771930a77907629bbb394
Crs-fixed: 328793
vidc: Fix crash in encoder for meta mode

Check for NULL pointer in meta handle

Change-Id: Ie0092fc24cf6a64608a725c8b17e3e4a07168808
CRs-Fixed: 331736
Merge "vidc: Fix crash in encoder for meta mode"
vidc: Fix for slow video playback of an AVI clip

A particular avi clip contains xvid video, playing slowly
as compare to audio. The variations in the timestamp values
are ignored in the adjust timestamp function resulting in
setting wrong FPS value. Fixed the same by changing the
timestamp comparison logic.

Change-Id: Ib315414f7d0945d8bf90e6df73a3e1de528dde50
Crs-fixed: 330010
vidc: Fix for crash in camcoder while MPEG-4 ASP recoding

Observing camcoder application crash, while recoding
MPEG-4 video with ASP profile. The number of B frames
value is not initialised, while setting intra period.
Fixed this by initialising it to 0.

Change-Id: I680e6a74c304a41706848cdacfc61826662fa580
CRs-Fixed: 331891
vidc: Generate FBD if genlock lock operation fails

- Add missing call to generate FBD message if genlock_lock fails.
- Without this call, this particular buffer is never returned back
  to OMX IL client.

Change-Id: I465514480e0430174d893cfae36b6f771b4ebb4a
CRs-Fixed: 332651
vidc: Fix for crash in frame parser

Frame parser is crashing while decoding HRD parameters
from the corrupted input bitstream. Added a range check
on the maximum value of the CPB count to avoid the crash.

Change-Id: I06c2526c781b34557e9191f221fe65c99f57010b
CRs-Fixed: 331496
vidc: ION caching support.

Added ION cache support for decoder and encoder.
For decoder and encoder the input and output buffers
are allocated in cached mode.

Change-Id: Ib26e3e23958ac9c6a44537a808a26eb48a60dc35
vidc: vdec: Enable/Disable Time stamp prints on setprop adb command

Added flag to monitor the setprop bit for vidc.dec.debug.ts
Based on this flag timestamp will be printed in the log.
By default these prints will not appear in the log.

Change-Id: Ibf094ddd41898f038a587e4ce7ffadb1661f7be0
CRs-Fixed: 334409
vidc: Fix for specific ISDB-T stream playback through test app

A specific ISDB-T stream is not playing through test app.
Fixed it by changing the input bitstream error condition
check in component. In case of arbitrary mode input bit
stream error is detected in frame parser.

Change-Id: If20c8e2c60ad28da4db374bbe8cb206670e50c6a
CRs-Fixed: 335614
vidc: Fix issues raised by klockwork

Remove banned function scanf and replace it with fgets-sscanf

Change-Id: I96d78a292badfda2fcf99c967582c3f306c439f6
vidc: Fix for secure mode crash.

In secure mode memory is never mmaped in userspace
accordingly memory should never be unmaped.
added checks as not to unmap the memory when in
secure mode.

Change-Id: Ie1388961a949d695446a394c8bd7f94b24bf9313
venc: Support OMX_COLOR_FormatAndroidOpaque color format

- The OMX IL Client can set color format to OMX_COLOR_FormatAndroidOpaque
  if the client is unaware of the input color format. (e.g. live effects)
- If OMX_COLOR_FormatAndroidOpaque is set, we internally map it to
  one of the supported input formats (e.g. OMX_COLOR_FormatYUV420SemiPlanar)

Change-Id: I611f98bb032e1791e40da9a5b84b17db0768e39b
mm-video: Create Decrypt handle internally

Decoder will create decrypt handle internally, when needed.

Change-Id: If8d7d19c26fe39f1bbc20f67de30783028f6fc63
vidc: vdec: Allocate separate fds for buffers

Made changes in allocate_output_buffer() to separate the
fds for decoder output buffers.

Change-Id: I8afb6a67b2df3387522309d0ff02f8d1fa41b794
Merge "venc: Support OMX_COLOR_FormatAndroidOpaque color format"
vidc: Increase the MAX_INPUT_ERROR value

The OMX_Component errors out if the error count from video driver
exceeds MAX_INPUT_ERROR. The OMX component queues each SPS and PPS
separately and the video core returns a non-frame data recoverable
error after processing each SPS\PPS. With this change, the OMX
component can queue the max number of SPS and PPS, without
erroring out.

Change-Id: Ib3ebbbe84e4e5094ce079a46927e9231e8812c3c
CRs-fixed: 337499