summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2021-09-16 09:50:00 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2021-09-16 09:49:59 -0700
commitffa05f19e1ff765b6d345a079241217537b7ccb6 (patch)
treecf7a1fa2598f92a870cb225d0c28ed3f7b13a223
parenta01ee45c38209322f50c7031c9da67e8f14347a9 (diff)
parent85db8fcd8d6682768574273c0a7af6f3ff3e2d69 (diff)
Merge "mm-video-v4l2: venc: Reject ETB during stop in progress"
-rw-r--r--mm-video-v4l2/vidc/venc/inc/omx_video_base.h1
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_video_base.cpp15
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp1
3 files changed, 17 insertions, 0 deletions
diff --git a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
index a63edd54..9b892351 100644
--- a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
+++ b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
@@ -232,6 +232,7 @@ class omx_video: public qc_omx_component
ColorConvertFormat mC2dDestFmt;
OMX_U32 mC2DFrameHeight;
OMX_U32 mC2DFrameWidth;
+ bool is_stop_in_progress;
omx_video(); // constructor
virtual ~omx_video(); // destructor
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index 3532f505..60951d45 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -287,6 +287,7 @@ omx_video::omx_video():
async_thread_created = false;
msg_thread_created = false;
msg_thread_stop = false;
+ is_stop_in_progress = false;
OMX_INIT_STRUCT(&m_blurInfo, OMX_QTI_VIDEO_CONFIG_BLURINFO);
m_blurInfo.nPortIndex == (OMX_U32)PORT_INDEX_IN;
@@ -663,6 +664,7 @@ void omx_video::process_event_cb(void *ctxt)
}
}
+ is_stop_in_progress = false;
break;
case OMX_COMPONENT_GENERATE_HARDWARE_ERROR:
@@ -4064,6 +4066,14 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_ERROR("ERROR: ETBProxy: Input flush in progress");
return OMX_ErrorNone;
}
+
+ if (is_stop_in_progress == true) {
+ post_event ((unsigned long)buffer,0,
+ OMX_COMPONENT_GENERATE_EBD);
+ DEBUG_PRINT_ERROR("ERROR: ETBProxy: stop in progress");
+ return OMX_ErrorNone;
+ }
+
if (!meta_mode_enable) {
fd = m_pInput_pmem[nBufIndex].fd;
}
@@ -4893,6 +4903,11 @@ bool omx_video::alloc_map_ion_memory(int size, venc_ion *ion_info, int flag)
return false;
}
+ if (is_stop_in_progress) {
+ DEBUG_PRINT_ERROR("Stop in progress: do not allocate any memory");
+ return false;
+ }
+
ion_info->data_fd = -1;
ion_info->dev_fd = ion_open();
if (ion_info->dev_fd <= 0) {
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
index fb93713f..b4607450 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
@@ -2444,6 +2444,7 @@ int omx_venc::async_message_process (void *context, void* message)
OMX_COMPONENT_GENERATE_START_DONE);
break;
case VEN_MSG_STOP:
+ omx->is_stop_in_progress = true;
omx->post_event (0,m_sVenc_msg->statuscode,\
OMX_COMPONENT_GENERATE_STOP_DONE);
break;