summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPushkaraj Patil <ppatil@codeaurora.org>2014-12-03 14:55:19 +0530
committerSteve Kondik <steve@cyngn.com>2015-02-25 01:01:42 -0800
commit7fc90f9bba2c54e8550102e3e04ef6271dd72200 (patch)
treee6d6aa9564161b430c94c45edd2e8d80729fa77c
parent9bb128bcc5103c70aa3250467d2bca7be90661c1 (diff)
downloadandroid_hardware_qcom_media-7fc90f9bba2c54e8550102e3e04ef6271dd72200.tar.gz
android_hardware_qcom_media-7fc90f9bba2c54e8550102e3e04ef6271dd72200.tar.bz2
android_hardware_qcom_media-7fc90f9bba2c54e8550102e3e04ef6271dd72200.zip
mm-video-v4l2: vidc: move pending flush sem release in async thread
Currently flush command is deferred when codec-config ETB's are sent to driver. Component msg thread is blocked for every 2 seconds until codec-config buffers are consumed. The semaphore that unblocks msg thread is set in EBD which is also executed by msg thread. So msg thread is blocked for 2 seconds for CODEC_CONFIG buffers. This might introduce frame drops. Hence move this semaphore release code to async thread. CRs-Fixed: 764704 Change-Id: I9400354efdabfce2f7feebec9197244f234aa5e5
-rw-r--r--mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
index b0a0d9b5..819bdf87 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
@@ -6958,19 +6958,6 @@ OMX_ERRORTYPE omx_vdec::empty_buffer_done(OMX_HANDLETYPE hComp,
DEBUG_PRINT_LOW("empty_buffer_done: bufhdr = %p, bufhdr->pBuffer = %p",
buffer, buffer->pBuffer);
pending_input_buffers--;
- if (buffer->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
- int pending_flush_waiters;
-
- while (pending_flush_waiters = INT_MAX,
- sem_getvalue(&m_safe_flush, &pending_flush_waiters),
- /* 0 == there /are/ waiters depending on POSIX implementation */
- pending_flush_waiters <= 0 ) {
- DEBUG_PRINT_LOW("sem post for %d EBD of CODEC CONFIG buffer", m_queued_codec_config_count);
- sem_post(&m_safe_flush);
- }
-
- android_atomic_and(0, &m_queued_codec_config_count); /* no clearer way to set to 0 */
- }
if (arbitrary_bytes) {
if (pdest_frame == NULL && input_flush_progress == false) {
@@ -7073,6 +7060,20 @@ int omx_vdec::async_message_process (void *context, void* message)
if (v4l2_buf_ptr->flags & V4L2_QCOM_BUF_DATA_CORRUPT) {
vdec_msg->status_code = VDEC_S_INPUT_BITSTREAM_ERR;
}
+ if (omxhdr->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
+ int pending_flush_waiters;
+
+ while (pending_flush_waiters = INT_MAX,
+ sem_getvalue(&omx->m_safe_flush, &pending_flush_waiters),
+ /* 0 == there /are/ waiters depending on POSIX implementation */
+ pending_flush_waiters <= 0 ) {
+ DEBUG_PRINT_LOW("sem post for %d EBD of CODEC CONFIG buffer",
+ omx->m_queued_codec_config_count);
+ sem_post(&omx->m_safe_flush);
+ }
+ android_atomic_and(0, &omx->m_queued_codec_config_count); /* no clearer way to set to 0 */
+ }
+
omx->post_event ((unsigned int)omxhdr,vdec_msg->status_code,
OMX_COMPONENT_GENERATE_EBD);
break;