mm-video-v4l2: vidc: vdec: handle codec config ETB's properly

Change semaphore wait logic to handle codec config buffers
properly. Due to quick context switch between msg and async
threads, component is unnecessarily waiting for input buffer
which is already returned by driver. Following points are
taken into consideration while code modification

1. Do not use semaphore for counting/condition check, instead
   use m_queued_codec_config_count under atomic operation.
2. Use semaphore just once to wait for all EBD's with codec
   config flag.
3. Post semaphore only if we get all EBD's back from driver.
4. Move component state to flush deferred, to avoid
   unnecessary sem_post operation, as it will mess-up with
   semaphore counter state.

Change-Id: Ie3b0dd9e3479e5e2831233bc31a5abd35140750d
2 files changed