After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797117 - debugutilsbad: Add timestamper element
debugutilsbad: Add timestamper element
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-09-10 20:50 UTC by Nicolas Dufresne (ndufresne)
Modified: 2018-11-03 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
debugutilsbad: Add timestamper element (11.24 KB, patch)
2018-09-10 20:50 UTC, Nicolas Dufresne (ndufresne)
reviewed Details | Review

Description Nicolas Dufresne (ndufresne) 2018-09-10 20:50:36 UTC
This is a simple element that simply set timestamp based on fixed duration.
The timestamp method could be enhanced later base on needs. This was written
initially to verify if broken or bad timestamp was directly causing some issues
we where observing. It's also handy in some test when pulling some raw frames
from the disk (e.g. multifilesrc). Currently, there is one property "duration".
Comment 1 Nicolas Dufresne (ndufresne) 2018-09-10 20:50:42 UTC
Created attachment 373593 [details] [review]
debugutilsbad: Add timestamper element

This is a simple element that sets PTS on GstBuffer. For this first
version, the timestamp are simply derived from a configured duration.
Comment 2 Sebastian Dröge (slomo) 2018-09-11 06:32:20 UTC
Review of attachment 373593 [details] [review]:

::: gst/debugutils/gsttimestamper.c
@@ +53,3 @@
+{
+  PROP_0,
+  PROP_DURATION,

A start timestamp property could also be useful, and for odd framerates (30000/1001) or sample rates (44.1kHz) the duration as a fraction could be useful (to prevent accumulating rounding errors)

Also one could think of counting buffers as you do now, or having a byte-rate and switch between both with a property.

@@ +80,3 @@
+    gst_segment_init (&segment, GST_FORMAT_TIME);
+    event = gst_event_new_segment (&segment);
+    gst_pad_push_event (trans->srcpad, event);

Isn't basetransform doing that already? Also how can there be no upstream segment? That would cause a g_warning() :)

@@ +158,3 @@
+      gst_segment_init (&segment, GST_FORMAT_TIME);
+      event = gst_event_new_segment (&segment);
+      gst_event_set_seqnum (event, seqnum);

You probably want to set need_segment=FALSE here? And why do you always replace the segment instead of passing it through, what's the idea behind this?

@@ +208,3 @@
+  g_object_class_install_property (gobject_class, PROP_DURATION,
+      g_param_spec_uint64 ("duration", "Duration",
+          "The duratuion in nanosecond of one buffer. Timestamps will be "

Typo: duration
Comment 3 Nicolas Dufresne (ndufresne) 2018-09-11 12:27:46 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> Review of attachment 373593 [details] [review] [review]:
> 
> ::: gst/debugutils/gsttimestamper.c
> @@ +53,3 @@
> +{
> +  PROP_0,
> +  PROP_DURATION,
> 
> A start timestamp property could also be useful, and for odd framerates
> (30000/1001) or sample rates (44.1kHz) the duration as a fraction could be
> useful (to prevent accumulating rounding errors)
> 
> Also one could think of counting buffers as you do now, or having a
> byte-rate and switch between both with a property.

Sure, I thought about these, and I think it can be added as needed later. You simply add a timestamping-mode enum, and depending on that enum, different properties / method can be used.

> 
> @@ +80,3 @@
> +    gst_segment_init (&segment, GST_FORMAT_TIME);
> +    event = gst_event_new_segment (&segment);
> +    gst_pad_push_event (trans->srcpad, event);
> 
> Isn't basetransform doing that already? Also how can there be no upstream
> segment? That would cause a g_warning() :)

I didn't see it, and didn't see a g_warning either. I want to drop upstream segment completely, I can recheck the code, I thought it was handled.
> 
> @@ +158,3 @@
> +      gst_segment_init (&segment, GST_FORMAT_TIME);
> +      event = gst_event_new_segment (&segment);
> +      gst_event_set_seqnum (event, seqnum);
> 
> You probably want to set need_segment=FALSE here? And why do you always
> replace the segment instead of passing it through, what's the idea behind
> this?

I'm completely replacing the timestamp, there is no point in using upstream segments.

> 
> @@ +208,3 @@
> +  g_object_class_install_property (gobject_class, PROP_DURATION,
> +      g_param_spec_uint64 ("duration", "Duration",
> +          "The duratuion in nanosecond of one buffer. Timestamps will be "
> 
> Typo: duration

Will fix.
Comment 4 GStreamer system administrator 2018-11-03 14:31:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/783.