summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2013-04-18 22:07:28 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2013-04-18 23:10:13 +0100
commit2cbbab3128f300afc87c3a98b405b594fb09700d (patch)
tree0314b9517501cb88179f8956faa998644f2eed57
parent82807bd9dd1d0a5d070b87f7ca889804081c737e (diff)
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.
-rw-r--r--omx/gstomx.c30
-rw-r--r--omx/gstomxaudioenc.c12
-rw-r--r--omx/gstomxh263enc.c5
-rw-r--r--omx/gstomxh264enc.c5
-rw-r--r--omx/gstomxmpeg4videoenc.c5
-rw-r--r--omx/gstomxvideodec.c44
-rw-r--r--omx/gstomxvideoenc.c24
7 files changed, 65 insertions, 60 deletions
diff --git a/omx/gstomx.c b/omx/gstomx.c
index 6a9a052..a2945ed 100644
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -289,8 +289,8 @@ gst_omx_component_handle_messages (GstOMXComponent * comp)
OMX_U32 index = msg->content.port_settings_changed.port;
GList *outports = NULL, *l, *k;
- GST_DEBUG_OBJECT (comp->parent, "%s settings changed (port %lu)",
- comp->name, index);
+ GST_DEBUG_OBJECT (comp->parent, "%s settings changed (port %u)",
+ comp->name, (guint) index);
/* FIXME: This probably can be done better */
@@ -335,8 +335,8 @@ gst_omx_component_handle_messages (GstOMXComponent * comp)
if (!port)
break;
- GST_DEBUG_OBJECT (comp->parent, "%s port %u got buffer flags 0x%08lx",
- comp->name, port->index, flags);
+ GST_DEBUG_OBJECT (comp->parent, "%s port %u got buffer flags 0x%08x",
+ comp->name, port->index, (guint) flags);
if ((flags & OMX_BUFFERFLAG_EOS)
&& port->port_def.eDir == OMX_DirOutput)
port->eos = TRUE;
@@ -440,8 +440,8 @@ EventHandler (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent,
msg->type = GST_OMX_MESSAGE_FLUSH;
msg->content.flush.port = nData2;
- GST_DEBUG_OBJECT (comp->parent, "%s port %lu flushed", comp->name,
- msg->content.flush.port);
+ GST_DEBUG_OBJECT (comp->parent, "%s port %u flushed", comp->name,
+ (guint) msg->content.flush.port);
gst_omx_component_send_message (comp, msg);
break;
@@ -453,8 +453,8 @@ EventHandler (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent,
msg->type = GST_OMX_MESSAGE_PORT_ENABLE;
msg->content.port_enable.port = nData2;
msg->content.port_enable.enable = (cmd == OMX_CommandPortEnable);
- GST_DEBUG_OBJECT (comp->parent, "%s port %lu %s", comp->name,
- msg->content.port_enable.port,
+ GST_DEBUG_OBJECT (comp->parent, "%s port %u %s", comp->name,
+ (guint) msg->content.port_enable.port,
(msg->content.port_enable.enable ? "enabled" : "disabled"));
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->content.port_settings_changed.port = index;
- GST_DEBUG_OBJECT (comp->parent, "%s settings changed (port index: %lu)",
- comp->name, msg->content.port_settings_changed.port);
+ GST_DEBUG_OBJECT (comp->parent, "%s settings changed (port index: %u)",
+ comp->name, (guint) msg->content.port_settings_changed.port);
gst_omx_component_send_message (comp, msg);
break;
@@ -519,9 +519,9 @@ EventHandler (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent,
msg->type = GST_OMX_MESSAGE_BUFFER_FLAG;
msg->content.buffer_flag.port = nData1;
msg->content.buffer_flag.flags = nData2;
- GST_DEBUG_OBJECT (comp->parent, "%s port %lu got buffer flags 0x%08lx",
- comp->name, msg->content.buffer_flag.port,
- msg->content.buffer_flag.flags);
+ GST_DEBUG_OBJECT (comp->parent, "%s port %u got buffer flags 0x%08x",
+ comp->name, (guint) msg->content.buffer_flag.port,
+ (guint) msg->content.buffer_flag.flags);
gst_omx_component_send_message (comp, msg);
break;
@@ -1629,8 +1629,8 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port,
OMX_ErrorBadParameter);
GST_INFO_OBJECT (comp->parent,
- "Allocating %d buffers of size %lu for %s port %u", n,
- port->port_def.nBufferSize, comp->name, port->index);
+ "Allocating %d buffers of size %zu for %s port %u", n,
+ port->port_def.nBufferSize, comp->name, (guint) port->index);
if (!port->buffers)
port->buffers = g_ptr_array_sized_new (n);
diff --git a/omx/gstomxaudioenc.c b/omx/gstomxaudioenc.c
index 6866eeb..36cf6a8 100644
--- a/omx/gstomxaudioenc.c
+++ b/omx/gstomxaudioenc.c
@@ -137,8 +137,8 @@ gst_omx_audio_enc_open (GstOMXAudioEnc * self)
in_port_index = 0;
out_port_index = 1;
} else {
- GST_DEBUG_OBJECT (self, "Detected %lu ports, starting at %lu",
- param.nPorts, param.nStartPortNumber);
+ GST_DEBUG_OBJECT (self, "Detected %u ports, starting at %u",
+ (guint) param.nPorts, (guint) param.nStartPortNumber);
in_port_index = param.nStartPortNumber + 0;
out_port_index = param.nStartPortNumber + 1;
}
@@ -381,8 +381,8 @@ gst_omx_audio_enc_loop (GstOMXAudioEnc * self)
goto eos;
}
- GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08lx %" G_GUINT64_FORMAT,
- buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
+ GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08x %" G_GUINT64_FORMAT,
+ (guint) buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
/* This prevents a deadlock between the srcpad stream
* lock and the videocodec stream lock, if ::reset()
@@ -1018,8 +1018,8 @@ gst_omx_audio_enc_handle_frame (GstAudioEncoder * encoder, GstBuffer * inbuf)
full_buffer:
{
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
- ("Got OpenMAX buffer with no free space (%p, %lu/%lu)", buf,
- buf->omx_buf->nOffset, buf->omx_buf->nAllocLen));
+ ("Got OpenMAX buffer with no free space (%p, %u/%u)", buf,
+ (guint) buf->omx_buf->nOffset, (guint) buf->omx_buf->nAllocLen));
return GST_FLOW_ERROR;
}
component_error:
diff --git a/omx/gstomxh263enc.c b/omx/gstomxh263enc.c
index c3987f0..8385372 100644
--- a/omx/gstomxh263enc.c
+++ b/omx/gstomxh263enc.c
@@ -189,8 +189,9 @@ gst_omx_h263_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
"Setting profile/level not supported by component");
} else if (err != OMX_ErrorNone) {
GST_ERROR_OBJECT (self,
- "Error setting profile %lu and level %lu: %s (0x%08x)", param.eProfile,
- param.eLevel, gst_omx_error_to_string (err), err);
+ "Error setting profile %u and level %u: %s (0x%08x)",
+ (guint) param.eProfile, (guint) param.eLevel,
+ gst_omx_error_to_string (err), err);
return FALSE;
}
diff --git a/omx/gstomxh264enc.c b/omx/gstomxh264enc.c
index 04fff0a..109e173 100644
--- a/omx/gstomxh264enc.c
+++ b/omx/gstomxh264enc.c
@@ -192,8 +192,9 @@ gst_omx_h264_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
"Setting profile/level not supported by component");
} else if (err != OMX_ErrorNone) {
GST_ERROR_OBJECT (self,
- "Error setting profile %lu and level %lu: %s (0x%08x)", param.eProfile,
- param.eLevel, gst_omx_error_to_string (err), err);
+ "Error setting profile %u and level %u: %s (0x%08x)",
+ (guint) param.eProfile, (guint) param.eLevel,
+ gst_omx_error_to_string (err), err);
return FALSE;
}
diff --git a/omx/gstomxmpeg4videoenc.c b/omx/gstomxmpeg4videoenc.c
index 5e9ef84..f5eaa0a 100644
--- a/omx/gstomxmpeg4videoenc.c
+++ b/omx/gstomxmpeg4videoenc.c
@@ -199,8 +199,9 @@ gst_omx_mpeg4_video_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
"Setting profile/level not supported by component");
} else if (err != OMX_ErrorNone) {
GST_ERROR_OBJECT (self,
- "Error setting profile %lu and level %lu: %s (0x%08x)", param.eProfile,
- param.eLevel, gst_omx_error_to_string (err), err);
+ "Error setting profile %u and level %u: %s (0x%08x)",
+ (guint) param.eProfile, (guint) param.eLevel,
+ gst_omx_error_to_string (err), err);
return FALSE;
}
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
index 7cfedbf..51ecd53 100644
--- a/omx/gstomxvideodec.c
+++ b/omx/gstomxvideodec.c
@@ -780,8 +780,8 @@ gst_omx_video_dec_open (GstVideoDecoder * decoder)
in_port_index = 0;
out_port_index = 1;
} else {
- GST_DEBUG_OBJECT (self, "Detected %lu ports, starting at %lu",
- param.nPorts, param.nStartPortNumber);
+ GST_DEBUG_OBJECT (self, "Detected %u ports, starting at %u",
+ (guint) param.nPorts, (guint) param.nStartPortNumber);
in_port_index = param.nStartPortNumber + 0;
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 ||
vinfo->height != port_def->format.video.nFrameHeight) {
- GST_ERROR_OBJECT (self, "Resolution do not match: port=%lux%lu vinfo=%dx%d",
- port_def->format.video.nFrameWidth, port_def->format.video.nFrameHeight,
+ GST_ERROR_OBJECT (self, "Resolution do not match: port=%ux%u vinfo=%dx%d",
+ (guint) port_def->format.video.nFrameWidth,
+ (guint) port_def->format.video.nFrameHeight,
vinfo->width, vinfo->height);
goto done;
}
@@ -1814,9 +1815,10 @@ gst_omx_video_dec_reconfigure_output_port (GstOMXVideoDec * 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),
- 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),
format, port_def.format.video.nFrameWidth,
@@ -1943,10 +1945,10 @@ gst_omx_video_dec_loop (GstOMXVideoDec * 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),
- 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),
format, port_def.format.video.nFrameWidth,
@@ -1984,8 +1986,8 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self)
goto flushing;
}
- GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08lx %" G_GUINT64_FORMAT,
- buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
+ GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08x %" G_GUINT64_FORMAT,
+ (guint) buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
GST_VIDEO_DECODER_STREAM_LOCK (self);
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->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m);
- GST_DEBUG_OBJECT (self, "Component supports I420 (%d) at index %lu",
- param.eColorFormat, param.nIndex);
+ GST_DEBUG_OBJECT (self, "Component supports I420 (%d) at index %u",
+ param.eColorFormat, (guint) param.nIndex);
break;
case OMX_COLOR_FormatYUV420SemiPlanar:
m = g_slice_new (VideoNegotiationMap);
m->format = GST_VIDEO_FORMAT_NV12;
m->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m);
- GST_DEBUG_OBJECT (self, "Component supports NV12 (%d) at index %lu",
- param.eColorFormat, param.nIndex);
+ GST_DEBUG_OBJECT (self, "Component supports NV12 (%d) at index %u",
+ param.eColorFormat, (guint) param.nIndex);
break;
default:
GST_DEBUG_OBJECT (self,
- "Component supports unsupported color format %d at index %lu",
- param.eColorFormat, param.nIndex);
+ "Component supports unsupported color format %d at index %u",
+ param.eColorFormat, (guint) param.nIndex);
break;
}
}
@@ -3007,8 +3009,8 @@ full_buffer:
{
gst_video_codec_frame_unref (frame);
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
- ("Got OpenMAX buffer with no free space (%p, %lu/%lu)", buf,
- buf->omx_buf->nOffset, buf->omx_buf->nAllocLen));
+ ("Got OpenMAX buffer with no free space (%p, %u/%u)", buf,
+ (guint) buf->omx_buf->nOffset, (guint) buf->omx_buf->nAllocLen));
return GST_FLOW_ERROR;
}
@@ -3023,9 +3025,9 @@ too_large_codec_data:
{
gst_video_codec_frame_unref (frame);
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),
- self->dec_in_port->port_def.nBufferSize));
+ (guint) self->dec_in_port->port_def.nBufferSize));
return GST_FLOW_ERROR;
}
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 0e8bcb6..15a9d51 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -252,8 +252,8 @@ gst_omx_video_enc_open (GstVideoEncoder * encoder)
in_port_index = 0;
out_port_index = 1;
} else {
- GST_DEBUG_OBJECT (self, "Detected %lu ports, starting at %lu",
- param.nPorts, param.nStartPortNumber);
+ GST_DEBUG_OBJECT (self, "Detected %u ports, starting at %u",
+ (guint) param.nPorts, (guint) param.nStartPortNumber);
in_port_index = param.nStartPortNumber + 0;
out_port_index = param.nStartPortNumber + 1;
}
@@ -846,8 +846,8 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self)
goto flushing;
}
- GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08lx %" G_GUINT64_FORMAT,
- buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
+ GST_DEBUG_OBJECT (self, "Handling buffer: 0x%08x %" G_GUINT64_FORMAT,
+ (guint) buf->omx_buf->nFlags, (guint64) buf->omx_buf->nTimeStamp);
GST_VIDEO_ENCODER_STREAM_LOCK (self);
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->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m);
- GST_DEBUG_OBJECT (self, "Component supports I420 (%d) at index %ld",
- param.eColorFormat, param.nIndex);
+ GST_DEBUG_OBJECT (self, "Component supports I420 (%d) at index %u",
+ param.eColorFormat, (guint) param.nIndex);
break;
case OMX_COLOR_FormatYUV420SemiPlanar:
m = g_slice_new (VideoNegotiationMap);
m->format = GST_VIDEO_FORMAT_NV12;
m->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m);
- GST_DEBUG_OBJECT (self, "Component supports NV12 (%d) at index %ld",
- param.eColorFormat, param.nIndex);
+ GST_DEBUG_OBJECT (self, "Component supports NV12 (%d) at index %u",
+ param.eColorFormat, (guint) param.nIndex);
break;
default:
GST_DEBUG_OBJECT (self,
- "Component supports unsupported color format %d at index %ld",
- param.eColorFormat, param.nIndex);
+ "Component supports unsupported color format %d at index %u",
+ param.eColorFormat, (guint) param.nIndex);
break;
}
}
@@ -1680,8 +1680,8 @@ gst_omx_video_enc_handle_frame (GstVideoEncoder * encoder,
full_buffer:
{
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
- ("Got OpenMAX buffer with no free space (%p, %lu/%lu)", buf,
- buf->omx_buf->nOffset, buf->omx_buf->nAllocLen));
+ ("Got OpenMAX buffer with no free space (%p, %u/%u)", buf,
+ (guint) buf->omx_buf->nOffset, (guint) buf->omx_buf->nAllocLen));
gst_video_codec_frame_unref (frame);
return GST_FLOW_ERROR;
}