summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Menon <avmenon@codeaurora.org>2015-12-14 17:47:56 -0800
committerArun Menon <avmenon@codeaurora.org>2015-12-22 18:29:39 -0800
commit755ec08ddc74feaf0e9c07ee1cb6590cb5ed9780 (patch)
tree914cc6e1159a8d91c5b0ffcc3cff4063c7f4937e
parentb73dcba5eac3688bb06fdf8ace3168494c686d3d (diff)
downloadandroid_hardware_qcom_media-755ec08ddc74feaf0e9c07ee1cb6590cb5ed9780.tar.gz
android_hardware_qcom_media-755ec08ddc74feaf0e9c07ee1cb6590cb5ed9780.tar.bz2
android_hardware_qcom_media-755ec08ddc74feaf0e9c07ee1cb6590cb5ed9780.zip
mm-video-v4l2: vidc: Do not queue output buffer if flush is in progress
Skip queuing of output buffer to driver if output flush is in progress. Without this change, there is an issue when a output FBD with drop flag is received by omx component and requeued back to the driver and never returned. This change will fix the issue and avoid losing the output buffer when flush is in progress. Change-Id: I3560914f526066f7570d7784d7ac635bdc70ef29
-rw-r--r--mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
index dcccc411..19873865 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -7259,8 +7259,8 @@ OMX_ERRORTYPE omx_vdec::fill_this_buffer_proxy(
}
buf.m.planes = plane;
buf.length = drv_ctx.num_planes;
- DEBUG_PRINT_LOW("SENDING FTB TO F/W - fd[0] = %d fd[1] = %d offset[1] = %d",
- plane[0].reserved[0],plane[extra_idx].reserved[0], plane[extra_idx].reserved[1]);
+ DEBUG_PRINT_LOW("SENDING FTB TO F/W - fd[0] = %d fd[1] = %d offset[1] = %d in_flush = %d",
+ plane[0].reserved[0],plane[extra_idx].reserved[0], plane[extra_idx].reserved[1], output_flush_progress);
rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_QBUF, &buf);
if (rc) {
@@ -8291,6 +8291,7 @@ int omx_vdec::async_message_process (void *context, void* message)
}
if (omxhdr && (v4l2_buf_ptr->flags & V4L2_QCOM_BUF_DROP_FRAME) &&
+ !omx->output_flush_progress &&
!(v4l2_buf_ptr->flags & V4L2_QCOM_BUF_FLAG_DECODEONLY) &&
!(v4l2_buf_ptr->flags & V4L2_QCOM_BUF_FLAG_EOS)) {
unsigned int index = v4l2_buf_ptr->index;
@@ -8322,6 +8323,8 @@ int omx_vdec::async_message_process (void *context, void* message)
return -1;
}
+ DEBUG_PRINT_LOW("SENDING FTB TO F/W from async_message_process - fd[0] = %d fd[1] = %d offset[1] = %d in_flush = %d",
+ plane[0].reserved[0],plane[extra_idx].reserved[0], plane[extra_idx].reserved[1], omx->output_flush_progress);
if(ioctl(omx->drv_ctx.video_driver_fd, VIDIOC_QBUF, v4l2_buf_ptr)) {
DEBUG_PRINT_ERROR("Failed to queue buffer back to driver: %d, %d, %d", v4l2_buf_ptr->length, v4l2_buf_ptr->m.planes[0].reserved[0], v4l2_buf_ptr->m.planes[1].reserved[0]);
return -1;