mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
plugins/elements/gstidentity.c: Only post bus message at max, once per buffer received.
Original commit message from CVS: 2007-03-07 Zaheer Abbas Merali <zaheerabbas at merali dot org> * plugins/elements/gstidentity.c: (gst_identity_check_perfect): Only post bus message at max, once per buffer received.
This commit is contained in:
parent
88be8ba00f
commit
beefb6c9cd
2 changed files with 20 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2007-03-07 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
|
* plugins/elements/gstidentity.c: (gst_identity_check_perfect):
|
||||||
|
Only post bus message at max, once per buffer received.
|
||||||
|
|
||||||
2007-03-07 Wim Taymans <wim@fluendo.com>
|
2007-03-07 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* docs/design/Makefile.am:
|
* docs/design/Makefile.am:
|
||||||
|
|
|
@ -311,6 +311,7 @@ static void
|
||||||
gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf)
|
gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstClockTime timestamp;
|
GstClockTime timestamp;
|
||||||
|
gboolean posted_bus_message = FALSE;
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
||||||
|
|
||||||
|
@ -361,6 +362,7 @@ gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf)
|
||||||
GST_BUFFER_DURATION (buf), "cur-offset", G_TYPE_UINT64,
|
GST_BUFFER_DURATION (buf), "cur-offset", G_TYPE_UINT64,
|
||||||
GST_BUFFER_OFFSET (buf), "cur-offset-end", G_TYPE_UINT64,
|
GST_BUFFER_OFFSET (buf), "cur-offset-end", G_TYPE_UINT64,
|
||||||
GST_BUFFER_OFFSET_END (buf), NULL)));
|
GST_BUFFER_OFFSET_END (buf), NULL)));
|
||||||
|
posted_bus_message = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = GST_BUFFER_OFFSET (buf);
|
offset = GST_BUFFER_OFFSET (buf);
|
||||||
|
@ -369,17 +371,19 @@ gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf)
|
||||||
"Buffer not data-contiguous with previous one: "
|
"Buffer not data-contiguous with previous one: "
|
||||||
"prev offset_end %" G_GINT64_FORMAT ", new offset %"
|
"prev offset_end %" G_GINT64_FORMAT ", new offset %"
|
||||||
G_GINT64_FORMAT, identity->prev_offset_end, offset);
|
G_GINT64_FORMAT, identity->prev_offset_end, offset);
|
||||||
gst_element_post_message (GST_ELEMENT (identity),
|
if (!posted_bus_message) {
|
||||||
gst_message_new_element (GST_OBJECT (identity),
|
gst_element_post_message (GST_ELEMENT (identity),
|
||||||
gst_structure_new ("imperfect", "prev-timestamp", G_TYPE_UINT64,
|
gst_message_new_element (GST_OBJECT (identity),
|
||||||
identity->prev_timestamp, "prev-duration", G_TYPE_UINT64,
|
gst_structure_new ("imperfect", "prev-timestamp",
|
||||||
identity->prev_duration, "prev-offset", G_TYPE_UINT64,
|
G_TYPE_UINT64, identity->prev_timestamp, "prev-duration",
|
||||||
identity->prev_offset, "prev-offset-end", G_TYPE_UINT64,
|
G_TYPE_UINT64, identity->prev_duration, "prev-offset",
|
||||||
identity->prev_offset_end, "cur-timestamp", G_TYPE_UINT64,
|
G_TYPE_UINT64, identity->prev_offset, "prev-offset-end",
|
||||||
timestamp, "cur-duration", G_TYPE_UINT64,
|
G_TYPE_UINT64, identity->prev_offset_end, "cur-timestamp",
|
||||||
GST_BUFFER_DURATION (buf), "cur-offset", G_TYPE_UINT64,
|
G_TYPE_UINT64, timestamp, "cur-duration", G_TYPE_UINT64,
|
||||||
GST_BUFFER_OFFSET (buf), "cur-offset-end", G_TYPE_UINT64,
|
GST_BUFFER_DURATION (buf), "cur-offset", G_TYPE_UINT64,
|
||||||
GST_BUFFER_OFFSET_END (buf), NULL)));
|
GST_BUFFER_OFFSET (buf), "cur-offset-end", G_TYPE_UINT64,
|
||||||
|
GST_BUFFER_OFFSET_END (buf), NULL)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (identity, "can't check time-contiguity, no timestamp "
|
GST_DEBUG_OBJECT (identity, "can't check time-contiguity, no timestamp "
|
||||||
|
|
Loading…
Reference in a new issue