summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-12-28 09:52:49 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-12-28 09:52:49 -0800
commit5bea69b872cef37d811fc083d332cfcd29f336af (patch)
tree11c2681f29cb3d7ac627b2af17a3630680f54432
parentf99c0c18cdc6780c0137f1ed1ddde459d093d956 (diff)
parentbe01085501bf0f11aac8b525679c96d9f435b072 (diff)
downloadandroid_hardware_qcom_media-5bea69b872cef37d811fc083d332cfcd29f336af.tar.gz
android_hardware_qcom_media-5bea69b872cef37d811fc083d332cfcd29f336af.tar.bz2
android_hardware_qcom_media-5bea69b872cef37d811fc083d332cfcd29f336af.zip
Merge "mm-video-v4l2: vidc: venc: handle empty EOS buffer"
-rw-r--r--mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h1
-rw-r--r--mm-video-v4l2/vidc/venc/inc/omx_video_base.h1
-rwxr-xr-xmm-video-v4l2/vidc/venc/inc/omx_video_encoder.h1
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp18
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_video_base.cpp13
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp5
6 files changed, 39 insertions, 0 deletions
diff --git a/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h b/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h
index 871bf546..7d826353 100644
--- a/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h
+++ b/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h
@@ -117,6 +117,7 @@ class omx_venc: public omx_video
OMX_U32 dev_resume(void);
OMX_U32 dev_start_done(void);
OMX_U32 dev_set_message_thread_id(pthread_t);
+ bool dev_handle_empty_eos_buffer(void);
bool dev_use_buf( void *,unsigned,unsigned);
bool dev_free_buf( void *,unsigned);
bool dev_empty_buf(void *, void *,unsigned,unsigned);
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 cc51359f..f325678e 100644
--- a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
+++ b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
@@ -237,6 +237,7 @@ class omx_video: public qc_omx_component
virtual OMX_U32 dev_resume(void) = 0;
virtual OMX_U32 dev_start_done(void) = 0;
virtual OMX_U32 dev_set_message_thread_id(pthread_t) = 0;
+ virtual bool dev_handle_empty_eos_buffer(void) = 0;
virtual bool dev_use_buf(void *,unsigned,unsigned) = 0;
virtual bool dev_free_buf(void *,unsigned) = 0;
virtual bool dev_empty_buf(void *, void *,unsigned,unsigned) = 0;
diff --git a/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h b/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
index c0f18d9e..24d97066 100755
--- a/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
+++ b/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
@@ -65,6 +65,7 @@ class omx_venc: public omx_video
OMX_U32 dev_resume(void);
OMX_U32 dev_start_done(void);
OMX_U32 dev_set_message_thread_id(pthread_t);
+ bool dev_handle_empty_eos_buffer(void);
bool dev_use_buf( void *,unsigned,unsigned);
bool dev_free_buf( void *,unsigned);
bool dev_empty_buf(void *, void *,unsigned,unsigned);
diff --git a/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp b/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp
index fc4a2cf3..2f72020c 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp
@@ -1758,6 +1758,24 @@ OMX_U32 omx_venc::dev_set_message_thread_id(pthread_t tid)
RETURN(true);
}
+bool omx_venc::dev_handle_empty_eos_buffer(void)
+{
+ ENTER_FUNC();
+ SWVENC_STATUS Ret;
+ SWVENC_IPBUFFER ipbuffer;
+ ipbuffer.p_buffer = NULL;
+ ipbuffer.filled_length = 0;
+ ipbuffer.flags = SWVENC_FLAG_EOS;
+ Ret = swvenc_emptythisbuffer(m_hSwVenc, &ipbuffer);
+ if (Ret != SWVENC_S_SUCCESS)
+ {
+ DEBUG_PRINT_ERROR("%s, swvenc_emptythisbuffer failed (%d)",
+ __FUNCTION__, Ret);
+ RETURN(false);
+ }
+ RETURN(true);
+}
+
bool omx_venc::dev_use_buf(void *buf_addr,unsigned port,unsigned index)
{
ENTER_FUNC();
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 74a574d9..c0c697a1 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -3953,6 +3953,19 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE hComp,
}
}
+ if (meta_mode_enable && !mUsesColorConversion) {
+ VideoGrallocMetadata *media_buffer = (VideoGrallocMetadata *)meta_buffer_hdr[nBufIndex].pBuffer;
+ if (buffer->nFilledLen == 0 && (buffer->nFlags & OMX_BUFFERFLAG_EOS) && !media_buffer->pHandle) {
+ DEBUG_PRINT_LOW("Zero length EOS buffer");
+ if(!dev_handle_empty_eos_buffer())
+ return OMX_ErrorHardware;
+ else {
+ post_event((unsigned long)buffer, 0, OMX_COMPONENT_GENERATE_EBD);
+ return OMX_ErrorNone;
+ }
+ }
+ }
+
pending_input_buffers++;
VIDC_TRACE_INT_LOW("ETB-pending", pending_input_buffers);
if (input_flush_progress == true) {
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 72280682..ac5bfff8 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
@@ -2499,6 +2499,11 @@ OMX_U32 omx_venc::dev_set_message_thread_id(pthread_t tid)
return handle->venc_set_message_thread_id(tid);
}
+bool omx_venc::dev_handle_empty_eos_buffer(void)
+{
+ return true;
+}
+
bool omx_venc::dev_use_buf(void *buf_addr,unsigned port,unsigned index)
{
return handle->venc_use_buf(buf_addr,port,index);