mm-video: vdec: Remove genlock calls from userspace

With MR1 release, the use of genlock is deprecated.
Therefore, it should not be used anymore.

CRs-fixed: 447716
Change-Id: I89b0131d5e50380debbbfca6b54e1abd355d98a8
mm-video: vidc: Close ION_IOC_MAP fd before closing ION device fd

Changes were made to free output buffer function where ION_IOC_MAP
fd is closed before closing ION device fd.

CRs-Fixed: 382450
Change-Id: I1e567ebc7679f502822113e535f7070ca5b2aea5
libc2dcolorconvert: Remove reserved param from kgsl_map_user_mem

The reserved field is not needed and is only defined in bionic,
removing it.

Change-Id: I9844b8139d3125d0176efd93ab107643d715cf68
mm-video: Fix issue with port reconfiguration specific clip

This change fixes the issue of UI freeze during the
playback of multiple resolution change specific clips
through decoder test app.

CRs-fixed: 476934
Change-Id: Ia5572482073bd743b641319ee246cb483bc1917e
mm-video: vdec: Convey crop information from driver to client

Crop information about uncompressed buffers need to be
conveyed to client to appropriately select the region
to display. This change takes care of this.

Conflicts:

	mm-video/vidc/vdec/src/omx_vdec.cpp

Change-Id: I1ddd129753ad3f6464ea415ded0a61f3b7c9bad6

Conflicts:
	mm-video/vidc/vdec/inc/omx_vdec.h
mm-video: vdec: Suppress unnecessary event callbacks

When smooth streaming is enabled, component is trying to
send an additional event callback to the client when
crop information change is detected into the driver.
This change suppresses that callback.

Change-Id: I91bd2ebc0ad33605ace65e5de3d8f3e68a659f59
mm-video: vdec: Add size and buffer info to platform private

This change adds size and buffer pointer to the platform private
structure which allows the client to mmap the buffer if required.

Secondly, this change overwrites the driver extradata with
OMX extradata when OMX_QcomIndexParamConcealMBMapExtraData
is enabled by the client

CRs-fixed: 472201
Change-Id: Iee7e5dbddcbfae438778759a808a9bbef0fac40b

Conflicts:
	mm-video/vidc/vdec/inc/omx_vdec.h
	mm-video/vidc/vdec/src/omx_vdec.cpp
mm-video: vdec: Handle OMX_IndexConfigCommonOutputCrop in test app

If crop information is changed for output buffer in the middle
of the playback, OMX component sends OMX_EventPortSettingsChanged
event with second parameter as OMX_IndexConfigCommonOutputCrop.
This change handles this parameter and differentiates it from
actual port reconfiguration.

CRs-fixed: 488532
Change-Id: I1c07578b9ffb21ad2ca39d6b4133e9d0581e872c
mm-video: vidc: Handle EOS buffer with content correctly

When EOS buffer with nFilledLen > 0 was queued, the component would
apparent it the buffer before the EOS.  This resulted in a buffer with
two frames to be queued to the decoder, which subsequently ignores the
second frame.

Fix this by queuing the contents the EOS buffer seperately instead of
appending it.

Change-Id: I198a7485c3bdf0e6181bfedbc0fa6ea91341475a
mm-video: vidc: Flush m_input_free_q when input buffers are freed

Not flushing it might leave dangling pointers to old input buffers,
which end up getting de-referenced, if the component is re-used for
another session.

Change-Id: If232cb3a5d10c4c1fd4634814cf25707fc7b8c90
mm-video: Free frame_parser in component de-init

frame_parser is alloc'ed in component init, it should be accordingly
freed in de-init rather than when input buffers are freed.

Change-Id: I19bb9899b7659eedb286fa5e44f0af901ae764b4
mm-video: vdec: attach proper timestamps to delayed ETBs in EOS

When generating delayed ETBs in EOS case, attach the timestamps
correctly for deferred frames.

Change-Id: I475ea11fac9593cee2c25d2aa7910d5a9165105a
mm-video: Adjust 3 byte start code address, if multiple DMX entries found

- Core is not able to decode bit stream, when three byte start code
  0X000001 is a part of consecutive NAL's provided in single ETB.
- Start address of NAL entry in DMX should be moved one byte backward
  as video core skipping 0X0000 skipping in every NAL bit stream.

Change-Id: Ia816175e7b821dcb30200a3bd934896efd3ea20f
CRs-Fixed: 468664
mm-video: vdec: Fix movie studio crash

This change updates crop information with latest data
available with the driver.

CRs-fixed: 487314
Change-Id: I04a54a47b34442cf38695913f5a97eb5663e36da
mm-video: vdec: Initialize fd values to avoid memory corruption.

When driver open fails, we try to close uninitialized
fds which may contain any junk value. Thus, closing fd
with these junk values may result in memory corruption.

Change-Id: Ie3d4226022567e4ed929ed8c8c0fd44334351450

Conflicts:
	mm-video/vidc/vdec/src/omx_vdec.cpp
mm-video: Add data corrupt flag on output buffers when required

- If non-IDR frames received after seek operation, corrupted YUV frames
  are displayed.
- Add OMX_BUFFERFLAG_DATACORRUPT flag to each output buffer till
  OMX_BUFFERFLAG_SYNCFRAME received.
- IL client can skip rendering if DATACORRUPT flag observed.

Change-Id: I735fb3d5dcfbbfd0efd3c77a59f0323ee7695c10
mm-video: vidc: Enable data corrupt flag for MPEG2 & VC1 only

- Update output buffers with data corrupt flag when required
  for MPEG2 and VC1 decoders only.
- Enable data corrupt flag irrespective of frame type if sync
  frame not received.
- Don't set data corrupt flag at the start of the playback and
  set when seek operation is made and sync frame not received yet.

Change-Id: I9751d41f57af741a0762821a103e8581ce4f8b28
mm-video: vdec: Update output buffer count in thumbnail mode

This change updates the output buffer requirements when thumbnail mode
is enabled. In thumbnail mode the required output buffers equal to 1.
Output Buffer required for thumbnail mode were not updated earlier from
the driver as a result of which allocating memory for default buffer
count failed and thumbnail were not shown for some file formats.

Change-Id: I607a5b0e3bfcad8056ff71557db50d0e268cf348
CRs-Fixed: 513180
libc2dcolorconvert: Fix CTS Failures for 720p Encoding on 8930.

 -CTS testcases testEncodeDecodeVideoFromSurfaceToSurface720p
  and testVideoEdit720p fails because graphic buffer
  stride value is different for 8930.
 -Extra padding is needed for 8930 graphic buffers this case
  needs to be handled in C2D colorconverter before color
  conversion process.
 -Fix is to keep same stride value as of graphic bufer source
  in colorconverter module for 8930.
 CRs-Fixed: 515586

Change-Id: I45cdbd0ad4cad00f3e87c5f32852fc28f279aee9
libc2dcolorconvert: use c2dMapAddr() and c2dUnMapAddr

These apis are the preferred way to map ION memory into C2D,
instead of direct kgsl calls.

Change-Id: I74de60c1a407aa507e3f47edc5074b4df3928da3