mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
omx: log commands as strings
Makes logs easier to read.
This commit is contained in:
parent
07e6ae99f1
commit
d7862b927c
2 changed files with 28 additions and 2 deletions
28
omx/gstomx.c
28
omx/gstomx.c
|
@ -415,8 +415,8 @@ EventHandler (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent,
|
|||
{
|
||||
OMX_COMMANDTYPE cmd = (OMX_COMMANDTYPE) nData1;
|
||||
|
||||
GST_DEBUG_OBJECT (comp->parent, "%s command %d complete", comp->name,
|
||||
cmd);
|
||||
GST_DEBUG_OBJECT (comp->parent, "%s command %s complete (%d)",
|
||||
comp->name, gst_omx_command_to_string (cmd), cmd);
|
||||
|
||||
switch (cmd) {
|
||||
case OMX_CommandStateSet:{
|
||||
|
@ -2462,6 +2462,30 @@ gst_omx_state_to_string (OMX_STATETYPE state)
|
|||
return "Unknown state";
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gst_omx_command_to_string (OMX_COMMANDTYPE cmd)
|
||||
{
|
||||
switch (cmd) {
|
||||
case OMX_CommandStateSet:
|
||||
return "SetState";
|
||||
case OMX_CommandFlush:
|
||||
return "Flush";
|
||||
case OMX_CommandPortDisable:
|
||||
return "DisablePort";
|
||||
case OMX_CommandPortEnable:
|
||||
return "EnablePort";
|
||||
case OMX_CommandMarkBuffer:
|
||||
return "MarkBuffer";
|
||||
default:
|
||||
if (cmd >= OMX_CommandKhronosExtensions)
|
||||
return "KhronosExtensionCommand";
|
||||
else if (cmd >= OMX_CommandVendorStartUnused)
|
||||
return "VendorExtensionCommand";
|
||||
break;
|
||||
}
|
||||
return "Unknown command";
|
||||
}
|
||||
|
||||
#if defined(USE_OMX_TARGET_RPI)
|
||||
#define DEFAULT_HACKS (GST_OMX_HACK_NO_COMPONENT_ROLE)
|
||||
#else
|
||||
|
|
|
@ -274,6 +274,8 @@ GKeyFile * gst_omx_get_configuration (void);
|
|||
|
||||
const gchar * gst_omx_error_to_string (OMX_ERRORTYPE err);
|
||||
const gchar * gst_omx_state_to_string (OMX_STATETYPE state);
|
||||
const gchar * gst_omx_command_to_string (OMX_COMMANDTYPE cmd);
|
||||
|
||||
guint64 gst_omx_parse_hacks (gchar ** hacks);
|
||||
|
||||
GstOMXCore * gst_omx_core_acquire (const gchar * filename);
|
||||
|
|
Loading…
Reference in a new issue