avtp: Fix log format macros

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2145>
This commit is contained in:
Doug Nazar 2021-04-07 01:03:15 -04:00
parent 4373535bb5
commit dbff4c6f06
3 changed files with 17 additions and 14 deletions

View file

@ -333,7 +333,8 @@ gst_avtp_cvf_depay_validate_avtpdu (GstAvtpCvfDepay * avtpcvfdepay,
g_assert (r == 0); g_assert (r == 0);
if (G_UNLIKELY (val != 1)) { if (G_UNLIKELY (val != 1)) {
GST_DEBUG_OBJECT (avtpcvfdepay, GST_DEBUG_OBJECT (avtpcvfdepay,
"Unexpected AVTP header stream valid %ld, expected %d", val, 1); "Unexpected AVTP header stream valid %" G_GUINT64_FORMAT
", expected %d", val, 1);
goto end; goto end;
} }
@ -341,7 +342,8 @@ gst_avtp_cvf_depay_validate_avtpdu (GstAvtpCvfDepay * avtpcvfdepay,
g_assert (r == 0); g_assert (r == 0);
if (val != avtpbasedepayload->streamid) { if (val != avtpbasedepayload->streamid) {
GST_DEBUG_OBJECT (avtpcvfdepay, GST_DEBUG_OBJECT (avtpcvfdepay,
"Unexpected AVTP header stream id 0x%lx, expected 0x%lx", val, "Unexpected AVTP header stream id 0x%" G_GINT64_MODIFIER
"x, expected 0x%" G_GINT64_MODIFIER "x", val,
avtpbasedepayload->streamid); avtpbasedepayload->streamid);
goto end; goto end;
} }
@ -350,7 +352,7 @@ gst_avtp_cvf_depay_validate_avtpdu (GstAvtpCvfDepay * avtpcvfdepay,
g_assert (r == 0); g_assert (r == 0);
if (G_UNLIKELY (val != AVTP_CVF_FORMAT_RFC)) { if (G_UNLIKELY (val != AVTP_CVF_FORMAT_RFC)) {
GST_DEBUG_OBJECT (avtpcvfdepay, GST_DEBUG_OBJECT (avtpcvfdepay,
"Unexpected AVTP header format %ld, expected %d", val, "Unexpected AVTP header format %" G_GUINT64_FORMAT ", expected %d", val,
AVTP_CVF_FORMAT_RFC); AVTP_CVF_FORMAT_RFC);
goto end; goto end;
} }
@ -359,7 +361,7 @@ gst_avtp_cvf_depay_validate_avtpdu (GstAvtpCvfDepay * avtpcvfdepay,
g_assert (r == 0); g_assert (r == 0);
if (G_UNLIKELY (val != AVTP_CVF_FORMAT_SUBTYPE_H264)) { if (G_UNLIKELY (val != AVTP_CVF_FORMAT_SUBTYPE_H264)) {
GST_DEBUG_OBJECT (avtpcvfdepay, GST_DEBUG_OBJECT (avtpcvfdepay,
"Unsupported AVTP header format subtype %ld", val); "Unsupported AVTP header format subtype %" G_GUINT64_FORMAT, val);
goto end; goto end;
} }
@ -367,8 +369,9 @@ gst_avtp_cvf_depay_validate_avtpdu (GstAvtpCvfDepay * avtpcvfdepay,
g_assert (r == 0); g_assert (r == 0);
if (G_UNLIKELY (map->size < sizeof (*pdu) + val)) { if (G_UNLIKELY (map->size < sizeof (*pdu) + val)) {
GST_DEBUG_OBJECT (avtpcvfdepay, GST_DEBUG_OBJECT (avtpcvfdepay,
"AVTP packet size %ld too small, expected at least %" G_GUINT64_FORMAT, "AVTP packet size %" G_GSIZE_FORMAT " too small, expected at least %"
map->size - AVTP_CVF_H264_HEADER_SIZE, sizeof (*pdu) + val); G_GUINT64_FORMAT, map->size - AVTP_CVF_H264_HEADER_SIZE,
sizeof (*pdu) + val);
goto end; goto end;
} }
@ -449,8 +452,8 @@ gst_avtp_cvf_depay_internal_push (GstAvtpCvfDepay * avtpcvfdepay,
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;
GST_LOG_OBJECT (avtpcvfdepay, GST_LOG_OBJECT (avtpcvfdepay,
"Adding buffer of size %" G_GUINT64_FORMAT " (nalu size %" "Adding buffer of size %" G_GSIZE_FORMAT " (nalu size %"
G_GUINT64_FORMAT ") to out_buffer", gst_buffer_get_size (buffer), G_GSIZE_FORMAT ") to out_buffer", gst_buffer_get_size (buffer),
gst_buffer_get_size (buffer) - sizeof (guint32)); gst_buffer_get_size (buffer) - sizeof (guint32));
if (avtpcvfdepay->out_buffer) { if (avtpcvfdepay->out_buffer) {
@ -571,7 +574,7 @@ gst_avtp_cvf_depay_handle_fu_a (GstAvtpCvfDepay * avtpcvfdepay,
if (G_UNLIKELY (map->size - AVTP_CVF_H264_HEADER_SIZE < 2)) { if (G_UNLIKELY (map->size - AVTP_CVF_H264_HEADER_SIZE < 2)) {
GST_ERROR_OBJECT (avtpcvfdepay, GST_ERROR_OBJECT (avtpcvfdepay,
"Buffer too small to contain fragment headers, size: %" "Buffer too small to contain fragment headers, size: %"
G_GUINT64_FORMAT, map->size - AVTP_CVF_H264_HEADER_SIZE); G_GSIZE_FORMAT, map->size - AVTP_CVF_H264_HEADER_SIZE);
ret = gst_avtp_cvf_depay_push_and_discard (avtpcvfdepay); ret = gst_avtp_cvf_depay_push_and_discard (avtpcvfdepay);
goto end; goto end;
} }

View file

@ -350,7 +350,7 @@ gst_avtpcvpay_fragment_nal (GstAvtpCvfPay * avtpcvfpay, GstBuffer * nal,
*last_fragment = TRUE; *last_fragment = TRUE;
*offset = nal_size; *offset = nal_size;
GST_DEBUG_OBJECT (avtpcvfpay, GST_DEBUG_OBJECT (avtpcvfpay,
"Generated fragment with size %" G_GUINT64_FORMAT, nal_size); "Generated fragment with size %" G_GSIZE_FORMAT, nal_size);
return gst_buffer_ref (nal); return gst_buffer_ref (nal);
} }
@ -406,7 +406,7 @@ gst_avtpcvpay_fragment_nal (GstAvtpCvfPay * avtpcvfpay, GstBuffer * nal,
*offset += fragment_size; *offset += fragment_size;
GST_DEBUG_OBJECT (avtpcvfpay, GST_DEBUG_OBJECT (avtpcvfpay,
"Generated fragment with size %" G_GUINT64_FORMAT, fragment_size); "Generated fragment with size %" G_GSIZE_FORMAT, fragment_size);
return fragment; return fragment;
} }
@ -536,7 +536,7 @@ gst_avtp_cvf_pay_prepare_avtp_packets (GstAvtpCvfPay * avtpcvfpay,
nal = g_ptr_array_index (nals, i); nal = g_ptr_array_index (nals, i);
GST_LOG_OBJECT (avtpcvfpay, GST_LOG_OBJECT (avtpcvfpay,
"Preparing AVTP packets for NAL whose size is %" G_GUINT64_FORMAT, "Preparing AVTP packets for NAL whose size is %" G_GSIZE_FORMAT,
gst_buffer_get_size (nal)); gst_buffer_get_size (nal));
/* Calculate timestamps. Note that we do it twice, one using DTS as base, /* Calculate timestamps. Note that we do it twice, one using DTS as base,
@ -665,7 +665,7 @@ gst_avtp_cvf_pay_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;
GST_LOG_OBJECT (avtpcvfpay, GST_LOG_OBJECT (avtpcvfpay,
"Incoming buffer size: %" G_GUINT64_FORMAT " PTS: %" GST_TIME_FORMAT "Incoming buffer size: %" G_GSIZE_FORMAT " PTS: %" GST_TIME_FORMAT
" DTS: %" GST_TIME_FORMAT, gst_buffer_get_size (buffer), " DTS: %" GST_TIME_FORMAT, gst_buffer_get_size (buffer),
GST_TIME_ARGS (GST_BUFFER_PTS (buffer)), GST_TIME_ARGS (GST_BUFFER_PTS (buffer)),
GST_TIME_ARGS (GST_BUFFER_DTS (buffer))); GST_TIME_ARGS (GST_BUFFER_DTS (buffer)));

View file

@ -277,7 +277,7 @@ gst_avtp_src_fill (GstPushSrc * pushsrc, GstBuffer * buffer)
buffer_size = gst_buffer_get_size (buffer); buffer_size = gst_buffer_get_size (buffer);
if (G_UNLIKELY (buffer_size < MAX_AVTPDU_SIZE)) { if (G_UNLIKELY (buffer_size < MAX_AVTPDU_SIZE)) {
GST_WARNING_OBJECT (avtpsrc, GST_WARNING_OBJECT (avtpsrc,
"Buffer size (%" G_GUINT64_FORMAT "Buffer size (%" G_GSIZE_FORMAT
") may not be enough to hold AVTPDU (max AVTPDU size %d)", buffer_size, ") may not be enough to hold AVTPDU (max AVTPDU size %d)", buffer_size,
MAX_AVTPDU_SIZE); MAX_AVTPDU_SIZE);
n = buffer_size; n = buffer_size;