Commit 9cc68b95 authored by Martin Storsjö's avatar Martin Storsjö

omxil: Factorize event debug printing to a separate function

Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 369a7322
......@@ -1565,33 +1565,14 @@ static OMX_ERRORTYPE OmxEventHandler( OMX_HANDLETYPE omx_handle,
unsigned int i;
(void)omx_handle;
PrintOmxEvent((vlc_object_t *) p_dec, event, data_1, data_2, event_data);
switch (event)
{
case OMX_EventCmdComplete:
switch ((OMX_STATETYPE)data_1)
{
case OMX_CommandStateSet:
msg_Dbg( p_dec, "OmxEventHandler (%s, %s, %s)", EventToString(event),
CommandToString(data_1), StateToString(data_2) );
break;
default:
msg_Dbg( p_dec, "OmxEventHandler (%s, %s, %u)", EventToString(event),
CommandToString(data_1), (unsigned int)data_2 );
break;
}
break;
case OMX_EventError:
msg_Dbg( p_dec, "OmxEventHandler (%s, %s, %u, %s)", EventToString(event),
ErrorToString((OMX_ERRORTYPE)data_1), (unsigned int)data_2,
(const char *)event_data);
//p_sys->b_error = true;
break;
case OMX_EventPortSettingsChanged:
msg_Dbg( p_dec, "OmxEventHandler (%s, %u, %u)", EventToString(event),
(unsigned int)data_1, (unsigned int)data_2 );
if( data_2 == 0 || data_2 == OMX_IndexParamPortDefinition )
{
OMX_BUFFERHEADERTYPE *sentinel;
......@@ -1617,8 +1598,6 @@ static OMX_ERRORTYPE OmxEventHandler( OMX_HANDLETYPE omx_handle,
break;
default:
msg_Dbg( p_dec, "OmxEventHandler (%s, %u, %u)", EventToString(event),
(unsigned int)data_1, (unsigned int)data_2 );
break;
}
......
......@@ -158,6 +158,8 @@ OMX_ERRORTYPE WaitForOmxEvent(decoder_t *p_dec, OMX_EVENTTYPE *event,
OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec,
OMX_EVENTTYPE specific_event, OMX_U32 *data_1, OMX_U32 *data_2,
OMX_PTR *event_data);
void PrintOmxEvent(vlc_object_t *p_this, OMX_EVENTTYPE event, OMX_U32 data_1,
OMX_U32 data_2, OMX_PTR event_data);
/*****************************************************************************
* Picture utility functions
......
......@@ -116,6 +116,39 @@ OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec,
return OMX_ErrorNone;
}
void PrintOmxEvent(vlc_object_t *p_this, OMX_EVENTTYPE event, OMX_U32 data_1,
OMX_U32 data_2, OMX_PTR event_data)
{
switch (event)
{
case OMX_EventCmdComplete:
switch ((OMX_STATETYPE)data_1)
{
case OMX_CommandStateSet:
msg_Dbg( p_this, "OmxEventHandler (%s, %s, %s)", EventToString(event),
CommandToString(data_1), StateToString(data_2) );
break;
default:
msg_Dbg( p_this, "OmxEventHandler (%s, %s, %u)", EventToString(event),
CommandToString(data_1), (unsigned int)data_2 );
break;
}
break;
case OMX_EventError:
msg_Dbg( p_this, "OmxEventHandler (%s, %s, %u, %s)", EventToString(event),
ErrorToString((OMX_ERRORTYPE)data_1), (unsigned int)data_2,
(const char *)event_data);
break;
default:
msg_Dbg( p_this, "OmxEventHandler (%s, %u, %u)", EventToString(event),
(unsigned int)data_1, (unsigned int)data_2 );
break;
}
}
/*****************************************************************************
* Picture utility functions
*****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment