mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 13:56:32 +00:00
plugins/elements/gstidentity.*: Emit bus message if check-perfect is true and we encounter a non-perfect stream betwe...
Original commit message from CVS: 2007-03-07 Zaheer Abbas Merali <zaheerabbas at merali dot org> * plugins/elements/gstidentity.c: (gst_identity_check_perfect), (gst_identity_start): * plugins/elements/gstidentity.h: Emit bus message if check-perfect is true and we encounter a non-perfect stream between 2 consecutive buffers. Fixes #415394.
This commit is contained in:
parent
b1f78eff4e
commit
ae43843436
3 changed files with 40 additions and 0 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2007-03-07 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
|
* plugins/elements/gstidentity.c: (gst_identity_check_perfect),
|
||||||
|
(gst_identity_start):
|
||||||
|
* plugins/elements/gstidentity.h:
|
||||||
|
Emit bus message if check-perfect is true and we encounter a
|
||||||
|
non-perfect stream between 2 consecutive buffers.
|
||||||
|
Fixes #415394.
|
||||||
|
|
||||||
2007-03-07 Jan Schmidt <thaytan@mad.scientist.com>
|
2007-03-07 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -334,6 +334,34 @@ gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf)
|
||||||
GST_TIME_ARGS (identity->prev_duration), GST_TIME_ARGS (timestamp),
|
GST_TIME_ARGS (identity->prev_duration), GST_TIME_ARGS (timestamp),
|
||||||
GST_TIME_ARGS (t_expected), (dt < 0) ? '-' : '+',
|
GST_TIME_ARGS (t_expected), (dt < 0) ? '-' : '+',
|
||||||
GST_TIME_ARGS ((dt < 0) ? (GstClockTime) (-dt) : dt));
|
GST_TIME_ARGS ((dt < 0) ? (GstClockTime) (-dt) : dt));
|
||||||
|
/*
|
||||||
|
* "non-perfect" bus message:
|
||||||
|
* @identity: the identity instance
|
||||||
|
* @prev-timestamp: the previous buffer timestamp
|
||||||
|
* @prev-duration: the previous buffer duration
|
||||||
|
* @prev-offset: the previous buffer offset
|
||||||
|
* @prev-offset-end: the previous buffer offset end
|
||||||
|
* @cur-timestamp: the current buffer timestamp
|
||||||
|
* @cur-duration: the current buffer duration
|
||||||
|
* @cur-offset: the current buffer offset
|
||||||
|
* @cur-offset_end: the current buffer offset end
|
||||||
|
*
|
||||||
|
* This bus message gets emitted if check-perfect property is set and
|
||||||
|
* a non perfect stream is detected between the last buffer and
|
||||||
|
* the newly received buffer.
|
||||||
|
*/
|
||||||
|
gst_element_post_message (GST_ELEMENT (identity),
|
||||||
|
gst_message_new_element (GST_OBJECT (identity),
|
||||||
|
gst_structure_new ("non-perfect", "prev-timestamp",
|
||||||
|
G_TYPE_UINT64, identity->prev_timestamp, "prev-duration",
|
||||||
|
G_TYPE_UINT64, identity->prev_duration, "prev-offset",
|
||||||
|
G_TYPE_UINT64, identity->prev_offset, "prev-offset-end",
|
||||||
|
G_TYPE_UINT64, identity->prev_offset_end, "cur-timestamp",
|
||||||
|
G_TYPE_UINT64, timestamp, "cur-duration", 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_END (buf), NULL)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = GST_BUFFER_OFFSET (buf);
|
offset = GST_BUFFER_OFFSET (buf);
|
||||||
|
@ -352,6 +380,7 @@ gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf)
|
||||||
identity->prev_timestamp = timestamp;
|
identity->prev_timestamp = timestamp;
|
||||||
identity->prev_duration = GST_BUFFER_DURATION (buf);
|
identity->prev_duration = GST_BUFFER_DURATION (buf);
|
||||||
identity->prev_offset_end = GST_BUFFER_OFFSET_END (buf);
|
identity->prev_offset_end = GST_BUFFER_OFFSET_END (buf);
|
||||||
|
identity->prev_offset = GST_BUFFER_OFFSET (buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,6 +605,7 @@ gst_identity_start (GstBaseTransform * trans)
|
||||||
identity->prev_timestamp = GST_CLOCK_TIME_NONE;
|
identity->prev_timestamp = GST_CLOCK_TIME_NONE;
|
||||||
identity->prev_duration = GST_CLOCK_TIME_NONE;
|
identity->prev_duration = GST_CLOCK_TIME_NONE;
|
||||||
identity->prev_offset_end = -1;
|
identity->prev_offset_end = -1;
|
||||||
|
identity->prev_offset = -1;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ struct _GstIdentity {
|
||||||
gboolean single_segment;
|
gboolean single_segment;
|
||||||
GstClockTime prev_timestamp;
|
GstClockTime prev_timestamp;
|
||||||
GstClockTime prev_duration;
|
GstClockTime prev_duration;
|
||||||
|
guint64 prev_offset;
|
||||||
guint64 prev_offset_end;
|
guint64 prev_offset_end;
|
||||||
gchar *last_message;
|
gchar *last_message;
|
||||||
guint64 offset;
|
guint64 offset;
|
||||||
|
|
Loading…
Reference in a new issue