basevideo: make printf formats portable

This commit is contained in:
David Schleef 2010-06-02 12:16:56 -07:00
parent 772a6a4abd
commit 9564562fe8
4 changed files with 33 additions and 25 deletions

View file

@ -263,7 +263,7 @@ gst_base_video_codec_src_query (GstPad * pad, GstQuery * query)
time = gst_util_uint64_scale (base_codec->system_frame_number,
base_codec->state.fps_n, base_codec->state.fps_d);
time += base_codec->state.segment.time;
GST_DEBUG ("query position %lld", time);
GST_DEBUG ("query position %" GST_TIME_FORMAT, GST_TIME_ARGS (time));
res = gst_base_video_encoded_video_convert (&base_codec->state,
GST_FORMAT_TIME, time, &format, &value);
if (!res)
@ -462,7 +462,8 @@ gst_base_video_codec_sink_event (GstPad * pad, GstEvent * event)
if (rate <= 0.0)
goto newseg_wrong_rate;
GST_DEBUG ("newsegment %lld %lld", start, time);
GST_DEBUG ("newsegment %" GST_TIME_FORMAT " %" GST_TIME_FORMAT,
GST_TIME_ARGS (start), GST_TIME_ARGS (time));
gst_segment_set_newsegment (&base_video_codec->state.segment, update,
rate, format, start, stop, time);

View file

@ -661,8 +661,8 @@ gst_base_video_decoder_add_timestamp (GstBaseVideoDecoder * base_video_decoder,
ts = g_malloc (sizeof (Timestamp));
GST_DEBUG ("adding timestamp %lld %" GST_TIME_FORMAT,
base_video_decoder->input_offset,
GST_DEBUG ("adding timestamp %" GST_TIME_FORMAT " %" GST_TIME_FORMAT,
GST_TIME_ARGS (base_video_decoder->input_offset),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)));
ts->offset = base_video_decoder->input_offset;
@ -699,8 +699,8 @@ gst_base_video_decoder_get_timestamp_at_offset (GstBaseVideoDecoder *
}
}
GST_DEBUG ("got timestamp %lld %" GST_TIME_FORMAT,
offset, GST_TIME_ARGS (*timestamp));
GST_DEBUG ("got timestamp %" GST_TIME_FORMAT " %" GST_TIME_FORMAT,
GST_TIME_ARGS (offset), GST_TIME_ARGS (*timestamp));
}
static void
@ -814,7 +814,8 @@ gst_base_video_decoder_chain (GstPad * pad, GstBuffer * buf)
#if 0
if (base_video_decoder->timestamp_offset == GST_CLOCK_TIME_NONE &&
GST_BUFFER_TIMESTAMP (buf) != GST_CLOCK_TIME_NONE) {
GST_DEBUG ("got new offset %lld", GST_BUFFER_TIMESTAMP (buf));
GST_DEBUG ("got new offset %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
base_video_decoder->timestamp_offset = GST_BUFFER_TIMESTAMP (buf);
}
#endif
@ -951,14 +952,15 @@ gst_base_video_decoder_finish_frame (GstBaseVideoDecoder * base_video_decoder,
base_video_decoder_class =
GST_BASE_VIDEO_DECODER_GET_CLASS (base_video_decoder);
GST_DEBUG ("finish frame sync=%d pts=%lld", frame->is_sync_point,
frame->presentation_timestamp);
GST_DEBUG ("finish frame sync=%d pts=%" GST_TIME_FORMAT, frame->is_sync_point,
GST_TIME_ARGS (frame->presentation_timestamp));
if (GST_CLOCK_TIME_IS_VALID (frame->presentation_timestamp)) {
if (frame->presentation_timestamp != base_video_decoder->timestamp_offset) {
GST_DEBUG ("sync timestamp %lld diff %lld",
frame->presentation_timestamp,
frame->presentation_timestamp - base_video_decoder->segment.start);
GST_DEBUG ("sync timestamp %" GST_TIME_FORMAT " diff %" GST_TIME_FORMAT,
GST_TIME_ARGS (frame->presentation_timestamp),
GST_TIME_ARGS (frame->presentation_timestamp -
base_video_decoder->segment.start));
base_video_decoder->timestamp_offset = frame->presentation_timestamp;
base_video_decoder->field_index = 0;
} else {
@ -999,8 +1001,9 @@ gst_base_video_decoder_finish_frame (GstBaseVideoDecoder * base_video_decoder,
if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->last_timestamp)) {
if (frame->presentation_timestamp < base_video_decoder->last_timestamp) {
GST_WARNING ("decreasing timestamp (%lld < %lld)",
frame->presentation_timestamp, base_video_decoder->last_timestamp);
GST_WARNING ("decreasing timestamp (%" GST_TIME_FORMAT " < %"
GST_TIME_FORMAT ")", GST_TIME_ARGS (frame->presentation_timestamp),
GST_TIME_ARGS (base_video_decoder->last_timestamp));
}
}
base_video_decoder->last_timestamp = frame->presentation_timestamp;
@ -1107,14 +1110,15 @@ gst_base_video_decoder_skip_frame (GstBaseVideoDecoder * base_video_decoder,
base_video_decoder_class =
GST_BASE_VIDEO_DECODER_GET_CLASS (base_video_decoder);
GST_DEBUG ("finish frame sync=%d pts=%lld", frame->is_sync_point,
frame->presentation_timestamp);
GST_DEBUG ("finish frame sync=%d pts=%" GST_TIME_FORMAT, frame->is_sync_point,
GST_TIME_ARGS (frame->presentation_timestamp));
if (GST_CLOCK_TIME_IS_VALID (frame->presentation_timestamp)) {
if (frame->presentation_timestamp != base_video_decoder->timestamp_offset) {
GST_DEBUG ("sync timestamp %lld diff %lld",
frame->presentation_timestamp,
frame->presentation_timestamp - base_video_decoder->segment.start);
GST_DEBUG ("sync timestamp %" GST_TIME_FORMAT " diff %" GST_TIME_FORMAT,
GST_TIME_ARGS (frame->presentation_timestamp),
GST_TIME_ARGS (frame->presentation_timestamp -
base_video_decoder->segment.start));
base_video_decoder->timestamp_offset = frame->presentation_timestamp;
base_video_decoder->field_index = 0;
} else {

View file

@ -181,7 +181,8 @@ gst_base_video_encoder_sink_event (GstPad * pad, GstEvent * event)
if (format != GST_FORMAT_TIME)
goto newseg_wrong_format;
GST_DEBUG ("new segment %lld %lld", start, position);
GST_DEBUG ("new segment %" GST_TIME_FORMAT " %" GST_TIME_FORMAT,
GST_TIME_ARGS (start), GST_TIME_ARGS (position));
gst_segment_set_newsegment_full (&base_video_encoder->segment,
update, rate, applied_rate, format, start, stop, position);

View file

@ -279,7 +279,7 @@ gst_base_video_parse_src_query (GstPad * pad, GstQuery * query)
time = gst_util_uint64_scale (base_parse->presentation_frame_number,
base_parse->state.fps_n, base_parse->state.fps_d);
time += base_parse->segment.time;
GST_DEBUG ("query position %lld", time);
GST_DEBUG ("query position %" GST_TIME_FORMAT, GST_TIME_ARGS (time));
res = gst_base_video_encoded_video_convert (&base_parse->state,
GST_FORMAT_TIME, time, &format, &value);
if (!res)
@ -484,7 +484,8 @@ gst_base_video_parse_sink_event (GstPad * pad, GstEvent * event)
if (rate <= 0.0)
goto newseg_wrong_rate;
GST_DEBUG ("newsegment %lld %lld", start, time);
GST_DEBUG ("newsegment %" GST_TIME_FORMAT " %" GST_TIME_FORMAT,
GST_TIME_ARGS (start), GST_TIME_ARGS (time));
gst_segment_set_newsegment (&base_video_parse->segment, update,
rate, format, start, stop, time);
@ -847,9 +848,10 @@ gst_base_video_parse_push (GstBaseVideoParse * base_video_parse,
}
gst_buffer_set_caps (buffer, base_video_parse->caps);
GST_DEBUG ("pushing ts=%lld dur=%lld off=%lld off_end=%lld",
GST_BUFFER_TIMESTAMP (buffer),
GST_BUFFER_DURATION (buffer),
GST_DEBUG ("pushing ts=%" GST_TIME_FORMAT " dur=%" GST_TIME_FORMAT
" off=%" G_GUINT64_FORMAT " off_end=%" G_GUINT64_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)),
GST_BUFFER_OFFSET (buffer), GST_BUFFER_OFFSET_END (buffer));
if (base_video_parse->discont) {