mm-video: vidc: Missing release of meta buffer at encoder omx component

For 601-709 color conversion, Camera HAL extends one more entry
in native handle to put a flag and sends only when recording starts.
Because of this release of meta buffer fails in OMX video component
causing memory leak. This changes ensures release code for meta buffers.

CRs-Fixed: 627255
Change-Id: If45b2cb7bbfebc8cf791b28eb06c01e64b4991e6
mm-video: vidc: Avoid erroring out if too many corrupt frames

The OMX component indicates corrupt frames to the OMX client. Hence the
client is more than capable to making the decision to error out.

There's no point to make this decision in the component as some OMX
clients (namely WFD) are willing to wait out the corrupt frames in hope
that they will eventually get non-corrupt frames.

CRs-Fixed: 642758
Change-Id: I9475de4ccd18f026977ba7b403e8ccaa40699d04
mm-video: vidc: Missing release of pending input buffers to client

For unsupported contents with codec config buffer flag set, input
buffers in the pending queue are not released back to client
after FLUSH causing native crash. This change ensures that buffers
are released properly during flush in arbitrary mode

CRs-Fixed: 640296
Change-Id: I14b33c4a81d02d3b579de651c737fb531cb62dcc
mm-video: vidc: defer flush until headers are consumed

In case flush arrives while codec-config buffers are sent
to codec, defer sending flush till codec config buffers
are consumed. This fixes CTS tests which issue flush
right after configure (i.e after queueing headers)

Change-Id: I8cfcaecacc79da8d2c75a521b2a616a20aa69099
mm-video: vidc: hevc: Amend fill internal buffers flag correctly

The flag which indicates whether intermediate buffers are
sent to Q6 is not updated at the correct instant. Modify
the code to update it appropriately.

Change-Id: I2d963c54d86466669743e52a27aaf59f4a2864df
mm-video-v4l2: venc: Add setprop support for bframes and entropy

Add support to enable setting bframes and entropy on encoder component
via setprop, "vidc.debug.bframes" and "vidc.debug.entropy".

Change-Id: I8844b42f54bb420e541ab1c745c8f1c8ec983ac0
mm-video: vidc: Honor client's request to set CABAC

"vidc.debug.entropy" should be considered as a footswitch, and not the
determination of which entropy mode to use.  If client requests CABAC,
we should honor it unless "vidc.debug.entropy" is set to 0.

Change-Id: Ic8aad846a4c6cd87f13436eae8a63e938335205b
CRs-Fixed: 595920
mm-video-v4l2: venc: set intra period as per client setting

Intra period value set by the client is being ignored in the
component. Set intra period as per the client settings.

CRs-Fixed: 640410
Change-Id: I06229e3245b4f7987eaa6d9a3daf38b5de621c34
mm-core: Add new mime for QTI FLAC container

Add new mime type for FLAC container that is sniffed by extended
extractor. This is needed for media extractor to determine which
parser to create.

Change-Id: Iad68dbee25bc1d482a2d73447912494a000fa674
mm-video: vdec: fix multiple downscalar issues

-In set_parameter for output port with new resolution,
 ignore buffer size and count mismatch.
-In set_parameter for input port, do not call get_buffer_req
 for output port.
-In update_portdef, port definition values are fetched from
 driver using ioctl.
-Crop rectangle is updated during set param for output port
 instead of during update_res.

CRs-Fixed: 629474
Change-Id: I0d1ca6b8b170ded07bee6c48c5370d7386f0639b
Revert "mm-video: vdec: Set frame rate if computed fps is more than existing fps"

Reverting change-id Ic723d5a35a8709d57b5ff4877ebc9e6ae9aa626a.
The change introduced a bug in the component, whereby once fps is
set to a high value, it won't come down. This impacts power.

Change-Id: Ib50dcb34a5142d77a812714c30c8ea051f4942fe
dashplayer: handle text track error

Propagate text track error returned from
feedMoreTSData call
Change-Id: I726c83182fc87de3e2757ef8483bf74ad86e5304
CRs-Fixed: 639002
QCMetadata: add keys for FLAC meta data

Add FLAC meta data specific keys.

Change-Id: I85f34d01ad4b403e236a5fc2ebf054eb383abbde
mm-video-v4l2: Update video resolution when updating crop

During adaptive playback, crop is changed during resolution
change, and stride and slice height should also be updated

Added change to update output port resolution on updating
crop due to resolution change

CRs-Fixed: 676004
Change-Id: I6c9c68852c57500ec8ceb021fa2f7570149f2d1b
mm-video: vidc: Restore sanity representing buffer sizes in dyn buf mode

nFilledLen and nAllocLen are buffer handle sizes in dynamic buffer mode.
This led to obnoxious checks in multiple places to account for dynamic
buffer mode.  Furthermore it led to basic sanity checks such as
`nFilledLen + nOffset < nAllocLen` failing.

To get around this, overwrite the OMX_BUFFERHEADER's nFilledLen /
nAllocLen parameters on FTB and restore them on FBD.  This localises the
need for the aforementioned irritating check.

CRs-Fixed: 647383
Change-Id: I38d5a1ef88d90f3f12164c48b60ac3bc45d50b0a
mm-video: vidc: Set the output buffer size properly

The output buffer size was considered to be what the driver advertised
to the component.  However, in use buffer mode, the client might have
allocated a bigger size.  To take advantage of the larger buffer, use
the client's advertised buffer size.

CRs-Fixed: 647383
Change-Id: I1778f1767280ecbc6e128eea895e34564ef3a015
mm-video-v4l2: vidc: vdec: implement buffer req for Adaptive SS

As per the new design for smooth streaming implementation,
OMX Component will do the following when adaptive smooth
streaming is enabled -
a. Enable continue data transfer in firmware.
b. Get upper limit buffer count for the smallest resolution
   supported by firmware.
c. Get upper limit for buffer size for supporting the
   max smooth streaming resolution set by client in OMX Component.
d. Set the combination of upper limit buffer count and upper limit
   buffer size in firmware.

Change-Id: Ib777b5ff32e3af0c42e0831bd7c9ba5a43396a77
mm-video: vidc: disable dynamic buffer mode and adaptive playback

Added setprop to disable dynamic buffer mode and adaptive playback
mode and kept is disabled bu default

Change-Id: I05b984199cf5fc932f25dde55317eac7798d46cb
CRs-Fixed: 661260
mm-video-v4l2: vidc: fix bugs reported by code review

Fix bugs reported by peer code review.

Change-Id: I064cbb3a9821c6ad2e282ff05ef6b6a25cc439a0
mm-video: vidc: Stop dropping timestamps on spurious FBDs

The driver might generate spurious FBDs in executing state for no good
reason.  Hence, stop dropping timestamps that we might need in the
future.

CRs-Fixed: 661440
Change-Id: I4220c385f2961c9009e1e03012be1020d1ba14c4