mm-video-v4l2: vidc: Enforce non-negative timestamp deltas

When in display order, timestamps should never step backwards during
normal playback, but this may occur if timestamp adjustment
overestimates the frame interval. In such cases, return the previous
timestamp again.

Change-Id: If04d2fc98eed517ceda2300a1463dc65d641348f
Merge "mm-video-v4l2: vidc: Enforce non-negative timestamp deltas"
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.

Change-Id: Icac85d41e5e39b510728537a980c7096d016358c
mm-video: vidc: Possibly send not-coded-VOPs to the driver

Previously we were dropping the not coded VOPs in the component because
the legacy hardware didn't support decoding it.  Since the hardware now
supports decoding N-C-VOPs, send it to the hardware if the client
insists on it being decoded.  A side effect of this is FBDs which have
duplicate YUVs and timestamps.  The client is expected deal with this
side effect.

CRs-Fixed: 714038
Change-Id: I44aa4f1f26568cf59cc76751802b8aa2373fcb69
mm-video: vidc: Ignore not coded VOPs only for DIVX content

Set the defaults for processing not coded VOPs based on the specs of
each codec.

CRs-Fixed: 714038
Change-Id: I8577cbe54efe1f12c1c0d59f75ed18c38755bc92
Merge "mm-video-v4l2: vdec: Retain lock while querying C2D filled length"
Merge "mm-video: vidc: Possibly send not-coded-VOPs to the driver"
Merge "mm-video: vidc: Ignore not coded VOPs only for DIVX content"
mm-video: Recognise "OMX.qcom.video.decoder.divx4" when setting role

Setting the component role for the "OMX.qcom.video.decoder.divx4"
component triggered an incorrect claiming that the component wasn't
recognised. This is a valid component.

Change-Id: Ib58ef8d74dcaaf6bde4bc4a07adca400822e0a11
CRs-Fixed: 759443
mm_video: vidc: Update buffer geometry with stride and scanline

Update buffer geometry dimensions using stride and snanline.
Earlier it was updated conditionally to handle downscalar case.
Now component is fetching all updated dimensions in case of
crop event, so stride and scanline can be used for the same.

Change-Id: If44a6df8498bff2ce39c9428b3708adbee7b8542
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-v4l2: vidc: move flush waiting logic to appropriate place

If a flush arrives while codec-config buffers are in the ETB queue,
both flush and ETB are sent to the video driver which can cause
corruption in output frames. Move flush waiting logic so that flush
is deferred until the headers are consumed

Change-Id: Id0647bfc749ac7e4af975530ac82210cc93023f2
CRs-Fixed: 703100
mm-video-v4l2: vdec: skip fillbuffer in port reconfiguration

Sometimes when port reconfiguration is under progress
hybrid decoder calls fillbuffer when emptybuffer arrives
which results in failures.
Resolve the problem by skipping fillbufer in port reconfiguration.

Change-Id: If900acbde8887d41134103b42f764d8018bd82e6
audio E_AC3_JOC definition

Add extern defintion for JOC format

CRs-Fixed: 761339
Change-Id: I7e007f8bbce18479986def3526986b5f1b6e9c05
Merge "mm_video: vidc: Update buffer geometry with stride and scanline"
mm-video-v4l2: vdec: streamoff while freeing first output buffer

Streaoff is being skipped if client sends commands loaded ->
idle -> allocate output buffers -> loaded -> free output buffers ->
get buffer requirements and results in failure.
Do streamoff while client frees the first output buffer to
resolve the issue.

Change-Id: I6e0391a22069219e54002d238bc6e347d1147aeb
Merge "audio E_AC3_JOC definition"
Merge "mm-video-v4l2: vdec: streamoff while freeing first output buffer"
Merge "mm-video: Recognise "OMX.qcom.video.decoder.divx4" when setting role"
mm-video: vidc: Make buffer state bitmap 64 bits

Previously the buffer state bitmap (which indicates if the given buffer
at an index is free or allocated) was unsigned int, which was typically
32 bits.  However if the client wants more than 32 buffers, the state
can't be held within the 32-bit bitmap.  Hence change it to uint64_t.

Change-Id: I8403c1331352bb96570577362a46444600d88448