omx: more printf format fixes

Fix printf formats again, so that gst-omx compiles warning-
free on the Raspberry Pi as well. Unfortunately OMX_UINT32
maybe be typedefed to uint32_t or unsigned long, which
doesn't work well with our debugging printf format strings,
so just use %u for those and cast to guint.
This commit is contained in:
Tim-Philipp Müller 2013-04-18 22:07:28 +00:00
parent 82807bd9dd
commit 2cbbab3128
7 changed files with 65 additions and 60 deletions

View file

@ -289,8 +289,8 @@ gst_omx_component_handle_messages (GstOMXComponent * comp)
OMX_U32 index = msg->content.port_settings_changed.port; OMX_U32 index = msg->content.port_settings_changed.port;
GList *outports = NULL, *l, *k; GList *outports = NULL, *l, *k;
GST_DEBUG_OBJECT (comp->parent, "%s settings changed (port %lu)", GST_DEBUG_OBJECT (comp->parent, "%s settings changed (port %u)",
comp->name, index); comp->name, (guint) index);
/* FIXME: This probably can be done better */ /* FIXME: This probably can be done better */
@ -335,8 +335,8 @@ gst_omx_component_handle_messages (GstOMXComponent * comp)
if (!port) if (!port)
break; break;
GST_DEBUG_OBJECT (comp->parent, "%s port %u got buffer flags 0x%08lx", GST_DEBUG_OBJECT (comp->parent, "%s port %u got buffer flags 0x%08x",
comp->name, port->index, flags); comp->name, port->index, (guint) flags);
if ((flags & OMX_BUFFERFLAG_EOS) if ((flags & OMX_BUFFERFLAG_EOS)
&& port->port_def.eDir == OMX_DirOutput) && port->port_def.eDir == OMX_DirOutput)
port->eos = TRUE; port->eos = TRUE;
@ -440,8 +440,8 @@ EventHandler (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent,
msg->type = GST_OMX_MESSAGE_FLUSH; msg->type = GST_OMX_MESSAGE_FLUSH;
msg->content.flush.port = nData2; msg->content.flush.port = nData2;
GST_DEBUG_OBJECT (comp->parent, "%s port %lu flushed", comp->name, GST_DEBUG_OBJECT (comp->parent, "%s port %u flushed", comp->name,
msg->content.flush.port); (guint) msg->content.flush.port);
gst_omx_component_send_message (comp, msg); gst_omx_component_send_message (comp, msg);
break; break;
@ -453,8 +453,8 @@ EventHandler (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent,
msg->type = GST_OMX_MESSAGE_PORT_ENABLE; msg->type = GST_OMX_MESSAGE_PORT_ENABLE;
msg->content.port_enable.port = nData2; msg->content.port_enable.port = nData2;
msg->content.port_enable.enable = (cmd == OMX_CommandPortEnable); msg->content.port_enable.enable = (cmd == OMX_CommandPortEnable);
GST_DEBUG_OBJECT (comp->parent, "%s port %lu %s", comp->name, GST_DEBUG_OBJECT (comp->parent, "%s port %u %s", comp->name,
msg->content.port_enable.port, (guint) msg->content.port_enable.port,
(msg->content.port_enable.enable ? "enabled" : "disabled")); (msg->content.port_enable.enable ? "enabled" : "disabled"));
gst_omx_component_send_message (comp, msg); gst_omx_component_send_message (comp, msg);
@ -505,8 +505,8 @@ EventHandler (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent,
msg->type = GST_OMX_MESSAGE_PORT_SETTINGS_CHANGED; msg->type = GST_OMX_MESSAGE_PORT_SETTINGS_CHANGED;
msg->content.port_settings_changed.port = index; msg->content.port_settings_changed.port = index;
GST_DEBUG_OBJECT (comp->parent, "%s settings changed (port index: %lu)", GST_DEBUG_OBJECT (comp->parent, "%s settings changed (port index: %u)",
comp->name, msg->content.port_settings_changed.port); comp->name, (guint) msg->content.port_settings_changed.port);
gst_omx_component_send_message (comp, msg); gst_omx_component_send_message (comp, msg);
break; break;
@ -519,9 +519,9 @@ EventHandler (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent,
msg->type = GST_OMX_MESSAGE_BUFFER_FLAG; msg->type = GST_OMX_MESSAGE_BUFFER_FLAG;
msg->content.buffer_flag.port = nData1; msg->content.buffer_flag.port = nData1;
msg->content.buffer_flag.flags = nData2; msg->content.buffer_flag.flags = nData2;
GST_DEBUG_OBJECT (comp->parent, "%s port %lu got buffer flags 0x%08lx", GST_DEBUG_OBJECT (comp->parent, "%s port %u got buffer flags 0x%08x",
comp->name, msg->content.buffer_flag.port, comp->name, (guint) msg->content.buffer_flag.port,
msg->content.buffer_flag.flags); (guint) msg->content.buffer_flag.flags);
gst_omx_component_send_message (comp, msg); gst_omx_component_send_message (comp, msg);
break; break;
@ -1629,8 +1629,8 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port,
OMX_ErrorBadParameter); OMX_ErrorBadParameter);
GST_INFO_OBJECT (comp->parent, GST_INFO_OBJECT (comp->parent,
"Allocating %d buffers of size %lu for %s port %u", n, "Allocating %d buffers of size %zu for %s port %u", n,
port->port_def.nBufferSize, comp->name, port->index); port->port_def.nBufferSize, comp->name, (guint) port->index);
if (!port->buffers) if (!port->buffers)
port->buffers = g_ptr_array_sized_new (n); port->buffers = g_ptr_array_sized_new (n);

View file

@ -137,8 +137,8 @@ gst_omx_audio_enc_open (GstOMXAudioEnc * self)
in_port_index = 0; in_port_index = 0;
out_port_index = 1; out_port_index = 1;
} else { } else {
GST_DEBUG_OBJECT (self, "Detected %lu ports, starting at %lu", GST_DEBUG_OBJECT (self, "Detected %u ports, starting at %u",
param.nPorts, param.nStartPortNumber); (guint) param.nPorts, (guint) param.nStartPortNumber);
in_port_index = param.nStartPortNumber + 0; in_port_index = param.nStartPortNumber + 0;
out_port_index = param.nStartPortNumber + 1; out_port_index = param.nStartPortNumber + 1;
} }
@ -381,8 +381,8 @@ gst_omx_audio_enc_loop (GstOMXAudioEnc * self)
goto eos; goto eos;
} }
GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08lx %" G_GUINT64_FORMAT, GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08x %" G_GUINT64_FORMAT,
buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp); (guint) buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
/* This prevents a deadlock between the srcpad stream /* This prevents a deadlock between the srcpad stream
* lock and the videocodec stream lock, if ::reset() * lock and the videocodec stream lock, if ::reset()
@ -1018,8 +1018,8 @@ gst_omx_audio_enc_handle_frame (GstAudioEncoder * encoder, GstBuffer * inbuf)
full_buffer: full_buffer:
{ {
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL), GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
("Got OpenMAX buffer with no free space (%p, %lu/%lu)", buf, ("Got OpenMAX buffer with no free space (%p, %u/%u)", buf,
buf->omx_buf->nOffset, buf->omx_buf->nAllocLen)); (guint) buf->omx_buf->nOffset, (guint) buf->omx_buf->nAllocLen));
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
component_error: component_error:

View file

@ -189,8 +189,9 @@ gst_omx_h263_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
"Setting profile/level not supported by component"); "Setting profile/level not supported by component");
} else if (err != OMX_ErrorNone) { } else if (err != OMX_ErrorNone) {
GST_ERROR_OBJECT (self, GST_ERROR_OBJECT (self,
"Error setting profile %lu and level %lu: %s (0x%08x)", param.eProfile, "Error setting profile %u and level %u: %s (0x%08x)",
param.eLevel, gst_omx_error_to_string (err), err); (guint) param.eProfile, (guint) param.eLevel,
gst_omx_error_to_string (err), err);
return FALSE; return FALSE;
} }

View file

@ -192,8 +192,9 @@ gst_omx_h264_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
"Setting profile/level not supported by component"); "Setting profile/level not supported by component");
} else if (err != OMX_ErrorNone) { } else if (err != OMX_ErrorNone) {
GST_ERROR_OBJECT (self, GST_ERROR_OBJECT (self,
"Error setting profile %lu and level %lu: %s (0x%08x)", param.eProfile, "Error setting profile %u and level %u: %s (0x%08x)",
param.eLevel, gst_omx_error_to_string (err), err); (guint) param.eProfile, (guint) param.eLevel,
gst_omx_error_to_string (err), err);
return FALSE; return FALSE;
} }

View file

@ -199,8 +199,9 @@ gst_omx_mpeg4_video_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
"Setting profile/level not supported by component"); "Setting profile/level not supported by component");
} else if (err != OMX_ErrorNone) { } else if (err != OMX_ErrorNone) {
GST_ERROR_OBJECT (self, GST_ERROR_OBJECT (self,
"Error setting profile %lu and level %lu: %s (0x%08x)", param.eProfile, "Error setting profile %u and level %u: %s (0x%08x)",
param.eLevel, gst_omx_error_to_string (err), err); (guint) param.eProfile, (guint) param.eLevel,
gst_omx_error_to_string (err), err);
return FALSE; return FALSE;
} }

View file

@ -780,8 +780,8 @@ gst_omx_video_dec_open (GstVideoDecoder * decoder)
in_port_index = 0; in_port_index = 0;
out_port_index = 1; out_port_index = 1;
} else { } else {
GST_DEBUG_OBJECT (self, "Detected %lu ports, starting at %lu", GST_DEBUG_OBJECT (self, "Detected %u ports, starting at %u",
param.nPorts, param.nStartPortNumber); (guint) param.nPorts, (guint) param.nStartPortNumber);
in_port_index = param.nStartPortNumber + 0; in_port_index = param.nStartPortNumber + 0;
out_port_index = param.nStartPortNumber + 1; out_port_index = param.nStartPortNumber + 1;
} }
@ -1112,8 +1112,9 @@ gst_omx_video_dec_fill_buffer (GstOMXVideoDec * self,
if (vinfo->width != port_def->format.video.nFrameWidth || if (vinfo->width != port_def->format.video.nFrameWidth ||
vinfo->height != port_def->format.video.nFrameHeight) { vinfo->height != port_def->format.video.nFrameHeight) {
GST_ERROR_OBJECT (self, "Resolution do not match: port=%lux%lu vinfo=%dx%d", GST_ERROR_OBJECT (self, "Resolution do not match: port=%ux%u vinfo=%dx%d",
port_def->format.video.nFrameWidth, port_def->format.video.nFrameHeight, (guint) port_def->format.video.nFrameWidth,
(guint) port_def->format.video.nFrameHeight,
vinfo->width, vinfo->height); vinfo->width, vinfo->height);
goto done; goto done;
} }
@ -1814,9 +1815,10 @@ gst_omx_video_dec_reconfigure_output_port (GstOMXVideoDec * self)
} }
GST_DEBUG_OBJECT (self, GST_DEBUG_OBJECT (self,
"Setting output state: format %s, width %lu, height %lu", "Setting output state: format %s, width %u, height %u",
gst_video_format_to_string (format), gst_video_format_to_string (format),
port_def.format.video.nFrameWidth, port_def.format.video.nFrameHeight); (guint) port_def.format.video.nFrameWidth,
(guint) port_def.format.video.nFrameHeight);
state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (self), state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (self),
format, port_def.format.video.nFrameWidth, format, port_def.format.video.nFrameWidth,
@ -1943,10 +1945,10 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self)
} }
GST_DEBUG_OBJECT (self, GST_DEBUG_OBJECT (self,
"Setting output state: format %s, width %lu, height %lu", "Setting output state: format %s, width %u, height %u",
gst_video_format_to_string (format), gst_video_format_to_string (format),
port_def.format.video.nFrameWidth, (guint) port_def.format.video.nFrameWidth,
port_def.format.video.nFrameHeight); (guint) port_def.format.video.nFrameHeight);
state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (self), state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (self),
format, port_def.format.video.nFrameWidth, format, port_def.format.video.nFrameWidth,
@ -1984,8 +1986,8 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self)
goto flushing; goto flushing;
} }
GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08lx %" G_GUINT64_FORMAT, GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08x %" G_GUINT64_FORMAT,
buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp); (guint) buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
GST_VIDEO_DECODER_STREAM_LOCK (self); GST_VIDEO_DECODER_STREAM_LOCK (self);
frame = _find_nearest_frame (self, buf); frame = _find_nearest_frame (self, buf);
@ -2352,21 +2354,21 @@ gst_omx_video_dec_get_supported_colorformats (GstOMXVideoDec * self)
m->format = GST_VIDEO_FORMAT_I420; m->format = GST_VIDEO_FORMAT_I420;
m->type = param.eColorFormat; m->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m); negotiation_map = g_list_append (negotiation_map, m);
GST_DEBUG_OBJECT (self, "Component supports I420 (%d) at index %lu", GST_DEBUG_OBJECT (self, "Component supports I420 (%d) at index %u",
param.eColorFormat, param.nIndex); param.eColorFormat, (guint) param.nIndex);
break; break;
case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420SemiPlanar:
m = g_slice_new (VideoNegotiationMap); m = g_slice_new (VideoNegotiationMap);
m->format = GST_VIDEO_FORMAT_NV12; m->format = GST_VIDEO_FORMAT_NV12;
m->type = param.eColorFormat; m->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m); negotiation_map = g_list_append (negotiation_map, m);
GST_DEBUG_OBJECT (self, "Component supports NV12 (%d) at index %lu", GST_DEBUG_OBJECT (self, "Component supports NV12 (%d) at index %u",
param.eColorFormat, param.nIndex); param.eColorFormat, (guint) param.nIndex);
break; break;
default: default:
GST_DEBUG_OBJECT (self, GST_DEBUG_OBJECT (self,
"Component supports unsupported color format %d at index %lu", "Component supports unsupported color format %d at index %u",
param.eColorFormat, param.nIndex); param.eColorFormat, (guint) param.nIndex);
break; break;
} }
} }
@ -3007,8 +3009,8 @@ full_buffer:
{ {
gst_video_codec_frame_unref (frame); gst_video_codec_frame_unref (frame);
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL), GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
("Got OpenMAX buffer with no free space (%p, %lu/%lu)", buf, ("Got OpenMAX buffer with no free space (%p, %u/%u)", buf,
buf->omx_buf->nOffset, buf->omx_buf->nAllocLen)); (guint) buf->omx_buf->nOffset, (guint) buf->omx_buf->nAllocLen));
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
@ -3023,9 +3025,9 @@ too_large_codec_data:
{ {
gst_video_codec_frame_unref (frame); gst_video_codec_frame_unref (frame);
GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL), GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL),
("codec_data larger than supported by OpenMAX port (%lu > %lu)", ("codec_data larger than supported by OpenMAX port (%zu > %u)",
gst_buffer_get_size (codec_data), gst_buffer_get_size (codec_data),
self->dec_in_port->port_def.nBufferSize)); (guint) self->dec_in_port->port_def.nBufferSize));
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }

View file

@ -252,8 +252,8 @@ gst_omx_video_enc_open (GstVideoEncoder * encoder)
in_port_index = 0; in_port_index = 0;
out_port_index = 1; out_port_index = 1;
} else { } else {
GST_DEBUG_OBJECT (self, "Detected %lu ports, starting at %lu", GST_DEBUG_OBJECT (self, "Detected %u ports, starting at %u",
param.nPorts, param.nStartPortNumber); (guint) param.nPorts, (guint) param.nStartPortNumber);
in_port_index = param.nStartPortNumber + 0; in_port_index = param.nStartPortNumber + 0;
out_port_index = param.nStartPortNumber + 1; out_port_index = param.nStartPortNumber + 1;
} }
@ -846,8 +846,8 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self)
goto flushing; goto flushing;
} }
GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08lx %" G_GUINT64_FORMAT, GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08x %" G_GUINT64_FORMAT,
buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp); (guint) buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
GST_VIDEO_ENCODER_STREAM_LOCK (self); GST_VIDEO_ENCODER_STREAM_LOCK (self);
frame = _find_nearest_frame (self, buf); frame = _find_nearest_frame (self, buf);
@ -1072,21 +1072,21 @@ gst_omx_video_enc_get_supported_colorformats (GstOMXVideoEnc * self)
m->format = GST_VIDEO_FORMAT_I420; m->format = GST_VIDEO_FORMAT_I420;
m->type = param.eColorFormat; m->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m); negotiation_map = g_list_append (negotiation_map, m);
GST_DEBUG_OBJECT (self, "Component supports I420 (%d) at index %ld", GST_DEBUG_OBJECT (self, "Component supports I420 (%d) at index %u",
param.eColorFormat, param.nIndex); param.eColorFormat, (guint) param.nIndex);
break; break;
case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420SemiPlanar:
m = g_slice_new (VideoNegotiationMap); m = g_slice_new (VideoNegotiationMap);
m->format = GST_VIDEO_FORMAT_NV12; m->format = GST_VIDEO_FORMAT_NV12;
m->type = param.eColorFormat; m->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m); negotiation_map = g_list_append (negotiation_map, m);
GST_DEBUG_OBJECT (self, "Component supports NV12 (%d) at index %ld", GST_DEBUG_OBJECT (self, "Component supports NV12 (%d) at index %u",
param.eColorFormat, param.nIndex); param.eColorFormat, (guint) param.nIndex);
break; break;
default: default:
GST_DEBUG_OBJECT (self, GST_DEBUG_OBJECT (self,
"Component supports unsupported color format %d at index %ld", "Component supports unsupported color format %d at index %u",
param.eColorFormat, param.nIndex); param.eColorFormat, (guint) param.nIndex);
break; break;
} }
} }
@ -1680,8 +1680,8 @@ gst_omx_video_enc_handle_frame (GstVideoEncoder * encoder,
full_buffer: full_buffer:
{ {
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL), GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
("Got OpenMAX buffer with no free space (%p, %lu/%lu)", buf, ("Got OpenMAX buffer with no free space (%p, %u/%u)", buf,
buf->omx_buf->nOffset, buf->omx_buf->nAllocLen)); (guint) buf->omx_buf->nOffset, (guint) buf->omx_buf->nAllocLen));
gst_video_codec_frame_unref (frame); gst_video_codec_frame_unref (frame);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }