Commit 55c0c8ed authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

gst/elements/: Beautify 'last-message' output: print 'none' for buffer...

gst/elements/: Beautify 'last-message' output: print 'none' for buffer timestamps and durations if none is set; impro...

Original commit message from CVS:
* gst/elements/gstfakesink.c: (gst_fake_sink_render):
* gst/elements/gstfakesrc.c: (gst_fake_src_create):
Beautify 'last-message' output: print 'none' for buffer timestamps
and durations if none is set; improve alignment with next messages.
parent 45258dbc
2005-10-14 Tim-Philipp Müller <tim at centricular dot net>
* gst/elements/gstfakesink.c: (gst_fake_sink_render):
* gst/elements/gstfakesrc.c: (gst_fake_src_create):
Beautify 'last-message' output: print 'none' for buffer timestamps
and durations if none is set; improve alignment with next messages.
2005-10-14 Tim-Philipp Müller <tim at centricular dot net>
* gst/gstpluginfeature.c: (gst_plugin_feature_check_version):
......
......@@ -342,17 +342,31 @@ gst_fake_sink_render (GstBaseSink * bsink, GstBuffer * buf)
GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (!sink->silent) {
gchar ts_str[64], dur_str[64];
GST_LOCK (sink);
g_free (sink->last_message);
if (GST_BUFFER_TIMESTAMP (buf) != GST_CLOCK_TIME_NONE) {
g_snprintf (ts_str, sizeof (ts_str), "%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
} else {
g_strlcpy (ts_str, "none", sizeof (ts_str));
}
if (GST_BUFFER_DURATION (buf) != GST_CLOCK_TIME_NONE) {
g_snprintf (dur_str, sizeof (dur_str), "%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
} else {
g_strlcpy (dur_str, "none", sizeof (dur_str));
}
sink->last_message =
g_strdup_printf ("chain ******* < (%d bytes, timestamp: %"
GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
G_GINT64_FORMAT ", offset_end: %" G_GINT64_FORMAT ", flags: %d) %p",
GST_BUFFER_SIZE (buf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
GST_BUFFER_OFFSET_END (buf), GST_MINI_OBJECT (buf)->flags, buf);
g_strdup_printf ("chain ******* < (%5d bytes, timestamp: %s"
", duration: %s, offset: %" G_GINT64_FORMAT ", offset_end: %"
G_GINT64_FORMAT ", flags: %d) %p", GST_BUFFER_SIZE (buf), ts_str,
dur_str, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET_END (buf),
GST_MINI_OBJECT (buf)->flags, buf);
GST_UNLOCK (sink);
g_object_notify (G_OBJECT (sink), "last_message");
......
......@@ -706,17 +706,31 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
GST_BUFFER_TIMESTAMP (buf) = time;
if (!src->silent) {
gchar ts_str[64], dur_str[64];
GST_LOCK (src);
g_free (src->last_message);
if (GST_BUFFER_TIMESTAMP (buf) != GST_CLOCK_TIME_NONE) {
g_snprintf (ts_str, sizeof (ts_str), "%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
} else {
g_strlcpy (ts_str, "none", sizeof (ts_str));
}
if (GST_BUFFER_DURATION (buf) != GST_CLOCK_TIME_NONE) {
g_snprintf (dur_str, sizeof (dur_str), "%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
} else {
g_strlcpy (dur_str, "none", sizeof (dur_str));
}
src->last_message =
g_strdup_printf ("get ******* > (%d bytes, timestamp: %"
GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
G_GINT64_FORMAT ", offset_end: %" G_GINT64_FORMAT ", flags: %d) %p",
GST_BUFFER_SIZE (buf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
GST_BUFFER_OFFSET_END (buf), GST_MINI_OBJECT (buf)->flags, buf);
g_strdup_printf ("get ******* > (%5d bytes, timestamp: %s"
", duration: %s, offset: %" G_GINT64_FORMAT ", offset_end: %"
G_GINT64_FORMAT ", flags: %d) %p", GST_BUFFER_SIZE (buf), ts_str,
dur_str, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET_END (buf),
GST_MINI_OBJECT (buf)->flags, buf);
GST_UNLOCK (src);
g_object_notify (G_OBJECT (src), "last_message");
......
......@@ -342,17 +342,31 @@ gst_fake_sink_render (GstBaseSink * bsink, GstBuffer * buf)
GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (!sink->silent) {
gchar ts_str[64], dur_str[64];
GST_LOCK (sink);
g_free (sink->last_message);
if (GST_BUFFER_TIMESTAMP (buf) != GST_CLOCK_TIME_NONE) {
g_snprintf (ts_str, sizeof (ts_str), "%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
} else {
g_strlcpy (ts_str, "none", sizeof (ts_str));
}
if (GST_BUFFER_DURATION (buf) != GST_CLOCK_TIME_NONE) {
g_snprintf (dur_str, sizeof (dur_str), "%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
} else {
g_strlcpy (dur_str, "none", sizeof (dur_str));
}
sink->last_message =
g_strdup_printf ("chain ******* < (%d bytes, timestamp: %"
GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
G_GINT64_FORMAT ", offset_end: %" G_GINT64_FORMAT ", flags: %d) %p",
GST_BUFFER_SIZE (buf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
GST_BUFFER_OFFSET_END (buf), GST_MINI_OBJECT (buf)->flags, buf);
g_strdup_printf ("chain ******* < (%5d bytes, timestamp: %s"
", duration: %s, offset: %" G_GINT64_FORMAT ", offset_end: %"
G_GINT64_FORMAT ", flags: %d) %p", GST_BUFFER_SIZE (buf), ts_str,
dur_str, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET_END (buf),
GST_MINI_OBJECT (buf)->flags, buf);
GST_UNLOCK (sink);
g_object_notify (G_OBJECT (sink), "last_message");
......
......@@ -706,17 +706,31 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
GST_BUFFER_TIMESTAMP (buf) = time;
if (!src->silent) {
gchar ts_str[64], dur_str[64];
GST_LOCK (src);
g_free (src->last_message);
if (GST_BUFFER_TIMESTAMP (buf) != GST_CLOCK_TIME_NONE) {
g_snprintf (ts_str, sizeof (ts_str), "%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
} else {
g_strlcpy (ts_str, "none", sizeof (ts_str));
}
if (GST_BUFFER_DURATION (buf) != GST_CLOCK_TIME_NONE) {
g_snprintf (dur_str, sizeof (dur_str), "%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
} else {
g_strlcpy (dur_str, "none", sizeof (dur_str));
}
src->last_message =
g_strdup_printf ("get ******* > (%d bytes, timestamp: %"
GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
G_GINT64_FORMAT ", offset_end: %" G_GINT64_FORMAT ", flags: %d) %p",
GST_BUFFER_SIZE (buf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
GST_BUFFER_OFFSET_END (buf), GST_MINI_OBJECT (buf)->flags, buf);
g_strdup_printf ("get ******* > (%5d bytes, timestamp: %s"
", duration: %s, offset: %" G_GINT64_FORMAT ", offset_end: %"
G_GINT64_FORMAT ", flags: %d) %p", GST_BUFFER_SIZE (buf), ts_str,
dur_str, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET_END (buf),
GST_MINI_OBJECT (buf)->flags, buf);
GST_UNLOCK (src);
g_object_notify (G_OBJECT (src), "last_message");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment