+2004-06-09 Wim Taymans <wim@fluendo.com>
+
+ * gst/elements/gstfakesink.c: (gst_fakesink_chain):
+ * gst/elements/gstidentity.c: (gst_identity_init),
+ (gst_identity_chain):
+ Print more buffer info in fakesink.
+ Make identity output similar to fakesink.
+
2004-06-07 Daniel Gazard <dany42@free.fr>
reviewed by Benjamin Otte <otte@gnome.org>
fakesink->last_message =
g_strdup_printf ("chain ******* (%s:%s)< (%d bytes, timestamp: %"
GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
- G_GINT64_FORMAT ", flags: %d) %p", GST_DEBUG_PAD_NAME (pad),
- GST_BUFFER_SIZE (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
+ G_GINT64_FORMAT ", offset_end: %" G_GINT64_FORMAT ", flags: %d) %p",
+ GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf),
+ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
- GST_BUFFER_FLAGS (buf), buf);
+ GST_BUFFER_OFFSET_END (buf), GST_BUFFER_FLAGS (buf), buf);
g_object_notify (G_OBJECT (fakesink), "last_message");
}
identity->dump = FALSE;
identity->last_message = NULL;
identity->srccaps = NULL;
+
+ GST_FLAG_SET (identity, GST_ELEMENT_EVENT_AWARE);
}
static void
identity = GST_IDENTITY (gst_pad_get_parent (pad));
+ if (GST_IS_EVENT (buf)) {
+ GstEvent *event = GST_EVENT (buf);
+
+ if (!identity->silent) {
+ g_free (identity->last_message);
+
+ identity->last_message =
+ g_strdup_printf ("chain ******* (%s:%s)E (type: %d) %p",
+ GST_DEBUG_PAD_NAME (pad), GST_EVENT_TYPE (event), event);
+
+ g_object_notify (G_OBJECT (identity), "last_message");
+ }
+ gst_pad_event_default (pad, event);
+ return;
+ }
+
if (identity->error_after >= 0) {
identity->error_after--;
if (identity->error_after == 0) {
if ((gfloat) (1.0 * rand () / (RAND_MAX)) < identity->drop_probability) {
g_free (identity->last_message);
identity->last_message =
- g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %"
- G_GINT64_FORMAT ")", GST_DEBUG_PAD_NAME (identity->sinkpad),
- GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
+ g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, timestamp: %"
+ GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
+ G_GINT64_FORMAT ", flags: %d) %p",
+ GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf),
+ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
+ GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
+ GST_BUFFER_FLAGS (buf), buf);
g_object_notify (G_OBJECT (identity), "last-message");
gst_buffer_unref (buf);
return;
if (!identity->silent) {
g_free (identity->last_message);
identity->last_message =
- g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, ts %"
- GST_TIME_FORMAT ", dur %" GST_TIME_FORMAT ")",
+ g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, timestamp: %"
+ GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
+ G_GINT64_FORMAT ", flags: %d) %p",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
- GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
+ GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
+ GST_BUFFER_FLAGS (buf), buf);
g_object_notify (G_OBJECT (identity), "last-message");
}
fakesink->last_message =
g_strdup_printf ("chain ******* (%s:%s)< (%d bytes, timestamp: %"
GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
- G_GINT64_FORMAT ", flags: %d) %p", GST_DEBUG_PAD_NAME (pad),
- GST_BUFFER_SIZE (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
+ G_GINT64_FORMAT ", offset_end: %" G_GINT64_FORMAT ", flags: %d) %p",
+ GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf),
+ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
- GST_BUFFER_FLAGS (buf), buf);
+ GST_BUFFER_OFFSET_END (buf), GST_BUFFER_FLAGS (buf), buf);
g_object_notify (G_OBJECT (fakesink), "last_message");
}
identity->dump = FALSE;
identity->last_message = NULL;
identity->srccaps = NULL;
+
+ GST_FLAG_SET (identity, GST_ELEMENT_EVENT_AWARE);
}
static void
identity = GST_IDENTITY (gst_pad_get_parent (pad));
+ if (GST_IS_EVENT (buf)) {
+ GstEvent *event = GST_EVENT (buf);
+
+ if (!identity->silent) {
+ g_free (identity->last_message);
+
+ identity->last_message =
+ g_strdup_printf ("chain ******* (%s:%s)E (type: %d) %p",
+ GST_DEBUG_PAD_NAME (pad), GST_EVENT_TYPE (event), event);
+
+ g_object_notify (G_OBJECT (identity), "last_message");
+ }
+ gst_pad_event_default (pad, event);
+ return;
+ }
+
if (identity->error_after >= 0) {
identity->error_after--;
if (identity->error_after == 0) {
if ((gfloat) (1.0 * rand () / (RAND_MAX)) < identity->drop_probability) {
g_free (identity->last_message);
identity->last_message =
- g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %"
- G_GINT64_FORMAT ")", GST_DEBUG_PAD_NAME (identity->sinkpad),
- GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
+ g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, timestamp: %"
+ GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
+ G_GINT64_FORMAT ", flags: %d) %p",
+ GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf),
+ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
+ GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
+ GST_BUFFER_FLAGS (buf), buf);
g_object_notify (G_OBJECT (identity), "last-message");
gst_buffer_unref (buf);
return;
if (!identity->silent) {
g_free (identity->last_message);
identity->last_message =
- g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, ts %"
- GST_TIME_FORMAT ", dur %" GST_TIME_FORMAT ")",
+ g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, timestamp: %"
+ GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
+ G_GINT64_FORMAT ", flags: %d) %p",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
- GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
+ GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
+ GST_BUFFER_FLAGS (buf), buf);
g_object_notify (G_OBJECT (identity), "last-message");
}