mm-core: synchronize OpenMax headers with AOSP counterparts

Update the video headers, retaining the enhancements.
Also use standard coding types (like VP8 instead of VPX)
and map the extended codec-types to standard types wherever
applicable.
Update HEVC profile/level enumeration values to follow the
spec nomenclature.

Change-Id: I1d9f42b91526892f535a76d0760819f4dd41332d
mm-video-v4l2: vdec: Set correct filled-length for color-converted buffers

Query the image-size of color-converted buffer from converter, sans
the padding and alignment.

Change-Id: Ifbe7229b5e963a20538547fe543be019b161db7b
mm-video: Release driver buffers correctly

Release driver buffers when all component buffers are
released. This is needed as component may transition
back to idle state from loaded state, and prepare_buf
will fail if the buffers are not unregistered from
driver.

Change-Id: Ie25eaf7287ff05b5f403d0463eff83020716c9f9
mm-video-v4l2: venc: Correct buffer index selection

meta_mode_enable reflects whether the component is using meta
buffers or the input mem pointer. Use this flag (instead of
mUseProxyColorFormat) when computing the buffer index to ensure
that a valid index is selected.

For non-color-conversion input buffers, the component should return
IL client buffers instead of meta buffers. For opaque input buffers
(which also do not require color-conversion), return meta buffers to
the base layer instead of client buffers.

b/17664960

Author: <lenhardw@codeaurora.org>
Change-Id: I0722edbb739140415b49e183be910730f450766c
mm-video-v4l2: vdec: Retain lock while querying C2D filled length

On port reconfig, c2d is torn down & reopened. This can trigger a
race condition with any c2d call in the component context. Hold
the c2d lock while querying filled length to avoid this race
condition

Bug: 17692582

Author: Leena Winterrowd <lenhardw@codeaurora.org>
Change-Id: Icac85d41e5e39b510728537a980c7096d016358c
mm-video-v4l2: venc: do not send duplicate EBDs in case of an error

In case of an error pushing the input to device layer via
push_input_buffer, EBDs are signalled locally. Do not send
EBD again from the calling method as this will result in a
duplicate EBD.

Bug: 17784012
Change-Id: I20fd48dba6daad4db64d7e7c26b3bc2a5cff85a7
mm-video: venc: Correct a typo in variable name

A kernel variable was to be defined as unsigned long but
it is mistakenly defined as unsigned only, the space is
missing after long. This bug is silent because unsigned
is also a valid data type by itself.
Corresponding to kernel fix, similar correction is done
in userspace code.

Change-Id: Ie58f275149dc9c85553f75e02594113b1a03ddcf
CRs-fixed: 556771
mm-video-v4l2: vidc: allocate bitstream buffers as cached

Encoder's output and decoder's input (bitstream) buffers
are read/written-to respectively by the CPU.
Allocate them as cached for better performance.

Change-Id: I13500237fb56ea066514074633a4702a50f4d59f
mm-video-v4l2: vidc: venc: increase meta-data headers on input port

To help reduce the bottlenecks in 4k camcorder recording, this change
increased the no. of headers. This will not impact the memory much as
this number is used to allocate the buffer headers only.

Change-Id: Ic498834f3fb86370e9519a09ebb65675bbbb430a
mm-video-v4l2: vidc: venc: restrict max meta-data headers on input-port

Restrict metedadata buffers to the count allocated by camera (9),
since allocating more will cause a deadlock in OMXCodec for
camcorder usecase.

Change-Id: Idbc5865096c5732e3a90e38cbebb4bc83b06ef18
mm-video: venc: handle zero-length invalid EOS buffers

Some clients (like GraphicsBufferSource) can queue meta buffer
with invalid handle for EOS, with filled length being empty.
Handle this case by queueing an internal color-conversion
buffer (if available) to propagate the EOS to output.
If a conversion buffer is not available, wait for a buffer
to be returned by the encoder.

Change-Id: Ib30e7063960939e7b764088afe9715f3c3d86d9f