Skip to content

Commit 3488f6d

Browse files
c_sridurkhusika
authored andcommitted
mm-video: venc: do not send duplicate EBDs in case of an error
In case of an error pushing the input to device layer via push_input_buffer, EBDs are signalled locally. Do not send EBD again from the calling method as this will result in a duplicate EBD. Change-Id: Ie9a35047d6f465c287daa804474520a60da9f473
1 parent 69d420e commit 3488f6d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

mm-video/vidc/venc/src/omx_video_base.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4200,7 +4200,7 @@ OMX_ERRORTYPE omx_video::empty_buffer_done(OMX_HANDLETYPE hComp,
42004200

42014201
pending_input_buffers--;
42024202

4203-
if(mUseProxyColorFormat && (buffer_index < m_sInPortDef.nBufferCountActual)) {
4203+
if(mUseProxyColorFormat && ((OMX_U32)buffer_index < m_sInPortDef.nBufferCountActual)) {
42044204
if(!pdest_frame && !input_flush_progress) {
42054205
pdest_frame = buffer;
42064206
DEBUG_PRINT_LOW("\n empty_buffer_done pdest_frame address is %p",pdest_frame);
@@ -4210,6 +4210,7 @@ OMX_ERRORTYPE omx_video::empty_buffer_done(OMX_HANDLETYPE hComp,
42104210
DEBUG_PRINT_LOW("\n empty_buffer_done insert address is %p",buffer);
42114211
if (!m_opq_pmem_q.insert_entry((unsigned int)buffer, 0, 0)) {
42124212
DEBUG_PRINT_ERROR("\n empty_buffer_done: pmem queue is full");
4213+
m_pCallbacks.EmptyBufferDone(hComp, m_app_data, buffer);
42134214
return OMX_ErrorBadParameter;
42144215
}
42154216
}
@@ -4762,14 +4763,11 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_opaque(OMX_IN OMX_HANDLETYPE hComp,
47624763
ret = push_input_buffer(hComp);
47634764
} else {
47644765
if (!m_opq_meta_q.insert_entry((unsigned)buffer,0,0)) {
4766+
m_pCallbacks.EmptyBufferDone(hComp, m_app_data, buffer);
47654767
DEBUG_PRINT_ERROR("\nERROR: ETBProxy: Queue is full");
47664768
ret = OMX_ErrorBadParameter;
47674769
}
47684770
}
4769-
if(ret != OMX_ErrorNone) {
4770-
m_pCallbacks.EmptyBufferDone(hComp,m_app_data,buffer);
4771-
DEBUG_PRINT_LOW("\nERROR: ETBOpaque failed:");
4772-
}
47734771
return ret;
47744772
}
47754773
OMX_ERRORTYPE omx_video::queue_meta_buffer(OMX_HANDLETYPE hComp,
@@ -4801,6 +4799,9 @@ OMX_ERRORTYPE omx_video::queue_meta_buffer(OMX_HANDLETYPE hComp,
48014799
m_opq_meta_q.pop_entry(&address,&p2,&id);
48024800
psource_frame = (OMX_BUFFERHEADERTYPE* ) address;
48034801
}
4802+
} else {
4803+
// there has been an error and source frame has been scheduled for an EBD
4804+
psource_frame = NULL;
48044805
}
48054806
return ret;
48064807
}
@@ -4888,6 +4889,9 @@ OMX_ERRORTYPE omx_video::convert_queue_buffer(OMX_HANDLETYPE hComp,
48884889
pdest_frame = (OMX_BUFFERHEADERTYPE* ) address;
48894890
DEBUG_PRINT_LOW("\n pdest_frame pop address is %p",pdest_frame);
48904891
}
4892+
} else {
4893+
// there has been an error and source frame has been scheduled for an EBD
4894+
psource_frame = NULL;
48914895
}
48924896
return ret;
48934897
}

0 commit comments

Comments
 (0)