mm-audio: omx: post error to omx during SSR
Add support to post error to omx component for NT mode session during SSR Change-Id: I768793331e8dd79a886b80a3bcac8173e5da73ea
This commit is contained in:
parent
4dcf1f45cc
commit
28cdd2ebac
|
@ -4070,6 +4070,8 @@ OMX_ERRORTYPE omx_aac_aenc::empty_this_buffer_proxy
|
|||
//The total length of the data to be transcoded
|
||||
srcStart = buffer->pBuffer;
|
||||
OMX_U8 *data = NULL;
|
||||
ssize_t bytes = 0;
|
||||
|
||||
PrintFrameHdr(OMX_COMPONENT_GENERATE_ETB,buffer);
|
||||
memset(&meta_in,0,sizeof(meta_in));
|
||||
if ( search_input_bufhdr(buffer) == false )
|
||||
|
@ -4104,7 +4106,22 @@ OMX_ERRORTYPE omx_aac_aenc::empty_this_buffer_proxy
|
|||
}
|
||||
|
||||
memcpy(&data[sizeof(META_IN)],buffer->pBuffer,buffer->nFilledLen);
|
||||
write(m_drv_fd, data, buffer->nFilledLen+sizeof(META_IN));
|
||||
bytes = write(m_drv_fd, data, buffer->nFilledLen+sizeof(META_IN));
|
||||
if (bytes <= 0) {
|
||||
frame_done_cb((OMX_BUFFERHEADERTYPE *)buffer);
|
||||
|
||||
if (errno == ENETRESET)
|
||||
{
|
||||
ALOGE("In SSR, return error to close the session");
|
||||
m_cb.EventHandler(&m_cmp,
|
||||
m_app_data,
|
||||
OMX_EventError,
|
||||
OMX_ErrorHardware,
|
||||
0, NULL );
|
||||
}
|
||||
return OMX_ErrorNone;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&m_state_lock);
|
||||
get_state(&m_cmp, &state);
|
||||
pthread_mutex_unlock(&m_state_lock);
|
||||
|
|
|
@ -3974,6 +3974,8 @@ OMX_ERRORTYPE omx_evrc_aenc::empty_this_buffer_proxy
|
|||
//The total length of the data to be transcoded
|
||||
srcStart = buffer->pBuffer;
|
||||
OMX_U8 *data = NULL;
|
||||
ssize_t bytes = 0;
|
||||
|
||||
PrintFrameHdr(OMX_COMPONENT_GENERATE_ETB,buffer);
|
||||
memset(&meta_in,0,sizeof(meta_in));
|
||||
if ( search_input_bufhdr(buffer) == false )
|
||||
|
@ -4003,7 +4005,21 @@ OMX_ERRORTYPE omx_evrc_aenc::empty_this_buffer_proxy
|
|||
}
|
||||
|
||||
memcpy(&data[sizeof(META_IN)],buffer->pBuffer,buffer->nFilledLen);
|
||||
write(m_drv_fd, data, buffer->nFilledLen+sizeof(META_IN));
|
||||
bytes = write(m_drv_fd, data, buffer->nFilledLen+sizeof(META_IN));
|
||||
if (bytes <= 0) {
|
||||
frame_done_cb((OMX_BUFFERHEADERTYPE *)buffer);
|
||||
|
||||
if (errno == ENETRESET)
|
||||
{
|
||||
ALOGE("In SSR, return error to close the session");
|
||||
m_cb.EventHandler(&m_cmp,
|
||||
m_app_data,
|
||||
OMX_EventError,
|
||||
OMX_ErrorHardware,
|
||||
0, NULL );
|
||||
}
|
||||
return OMX_ErrorNone;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&m_state_lock);
|
||||
get_state(&m_cmp, &state);
|
||||
|
@ -4045,11 +4061,21 @@ OMX_ERRORTYPE omx_evrc_aenc::fill_this_buffer_proxy
|
|||
buffer->nAllocLen,buffer->pBuffer,
|
||||
nReadbytes,nNumOutputBuf);
|
||||
if (nReadbytes <= 0) {
|
||||
buffer->nFilledLen = 0;
|
||||
buffer->nFilledLen = 0;
|
||||
buffer->nOffset = 0;
|
||||
buffer->nTimeStamp = nTimestamp;
|
||||
frame_done_cb((OMX_BUFFERHEADERTYPE *)buffer);
|
||||
return OMX_ErrorNone;
|
||||
buffer->nTimeStamp = nTimestamp;
|
||||
frame_done_cb((OMX_BUFFERHEADERTYPE *)buffer);
|
||||
|
||||
if (errno == ENETRESET)
|
||||
{
|
||||
ALOGE("In SSR, return error to close the session");
|
||||
m_cb.EventHandler(&m_cmp,
|
||||
m_app_data,
|
||||
OMX_EventError,
|
||||
OMX_ErrorHardware,
|
||||
0, NULL );
|
||||
}
|
||||
return OMX_ErrorNone;
|
||||
} else
|
||||
DEBUG_PRINT("Read bytes %d\n",nReadbytes);
|
||||
// Buffer from Driver will have
|
||||
|
|
|
@ -3972,6 +3972,8 @@ OMX_ERRORTYPE omx_qcelp13_aenc::empty_this_buffer_proxy
|
|||
//The total length of the data to be transcoded
|
||||
srcStart = buffer->pBuffer;
|
||||
OMX_U8 *data = NULL;
|
||||
ssize_t bytes = 0;
|
||||
|
||||
PrintFrameHdr(OMX_COMPONENT_GENERATE_ETB,buffer);
|
||||
memset(&meta_in,0,sizeof(meta_in));
|
||||
if ( search_input_bufhdr(buffer) == false )
|
||||
|
@ -4001,7 +4003,21 @@ OMX_ERRORTYPE omx_qcelp13_aenc::empty_this_buffer_proxy
|
|||
}
|
||||
|
||||
memcpy(&data[sizeof(META_IN)],buffer->pBuffer,buffer->nFilledLen);
|
||||
write(m_drv_fd, data, buffer->nFilledLen+sizeof(META_IN));
|
||||
bytes = write(m_drv_fd, data, buffer->nFilledLen+sizeof(META_IN));
|
||||
if (bytes <= 0) {
|
||||
frame_done_cb((OMX_BUFFERHEADERTYPE *)buffer);
|
||||
|
||||
if (errno == ENETRESET)
|
||||
{
|
||||
ALOGE("In SSR, return error to close the session");
|
||||
m_cb.EventHandler(&m_cmp,
|
||||
m_app_data,
|
||||
OMX_EventError,
|
||||
OMX_ErrorHardware,
|
||||
0, NULL );
|
||||
}
|
||||
return OMX_ErrorNone;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&m_state_lock);
|
||||
get_state(&m_cmp, &state);
|
||||
|
@ -4043,11 +4059,21 @@ OMX_ERRORTYPE omx_qcelp13_aenc::fill_this_buffer_proxy
|
|||
buffer->nAllocLen,buffer->pBuffer,
|
||||
nReadbytes,nNumOutputBuf);
|
||||
if (nReadbytes <= 0) {
|
||||
buffer->nFilledLen = 0;
|
||||
buffer->nFilledLen = 0;
|
||||
buffer->nOffset = 0;
|
||||
buffer->nTimeStamp = nTimestamp;
|
||||
frame_done_cb((OMX_BUFFERHEADERTYPE *)buffer);
|
||||
return OMX_ErrorNone;
|
||||
buffer->nTimeStamp = nTimestamp;
|
||||
frame_done_cb((OMX_BUFFERHEADERTYPE *)buffer);
|
||||
|
||||
if (errno == ENETRESET)
|
||||
{
|
||||
ALOGE("In SSR, return error to close the session");
|
||||
m_cb.EventHandler(&m_cmp,
|
||||
m_app_data,
|
||||
OMX_EventError,
|
||||
OMX_ErrorHardware,
|
||||
0, NULL );
|
||||
}
|
||||
return OMX_ErrorNone;
|
||||
} else
|
||||
DEBUG_PRINT("Read bytes %d\n",nReadbytes);
|
||||
|
||||
|
|
Loading…
Reference in New Issue