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 628284 - [rsvgdec] all buffer timestamps are set to zero
[rsvgdec] all buffer timestamps are set to zero
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-30 06:58 UTC by Nicolas Bingham
Modified: 2011-08-23 08:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (916 bytes, patch)
2010-08-30 11:03 UTC, Nicolas Bingham
needs-work Details | Review
Test case for 628284 (630 bytes, text/x-python)
2010-09-06 14:15 UTC, Nicolas Bingham
  Details
rsvgdec: use input buffer timings if possible (3.62 KB, patch)
2011-08-18 12:22 UTC, Vincent Penquerc'h
needs-work Details | Review
rsvgdec: use input buffer timings if possible (3.68 KB, patch)
2011-08-19 10:38 UTC, Vincent Penquerc'h
none Details | Review
rsvgdec: use input buffer timings if possible (3.85 KB, patch)
2011-08-19 10:42 UTC, Vincent Penquerc'h
committed Details | Review

Description Nicolas Bingham 2010-08-30 06:58:13 UTC
When the framerate specified in the caps is zero (such as when a variable framerate source is used), rsvgdec sets all buffer timestamps to zero. I believe a more correct behavior would be to forward the existing buffer timestamps (and durations) in this case. I have attached a patch with the proposed fix.
Comment 1 Sebastian Dröge (slomo) 2010-08-30 07:35:38 UTC
You forgot to attach the patch :)

But yes, timestamps from upstream should always be preferred, not only in the 0/1 framerate case. Only if upstream provides no timestamps, rsvgdec should provide its own.
Comment 2 Nicolas Bingham 2010-08-30 11:03:38 UTC
Created attachment 169046 [details] [review]
patch
Comment 3 Nicolas Bingham 2010-08-30 11:06:17 UTC
However, if upstream timestamps are always preferred then perhaps more comprehensive changes are required. Thanks for investigating this anyway.
Comment 4 Tim-Philipp Müller 2010-09-06 10:07:34 UTC
Do you have a test file at hand by any chance?
Comment 5 Nicolas Bingham 2010-09-06 14:15:34 UTC
Created attachment 169578 [details]
Test case for 628284

This example demonstrates that rsvgdec does not forward buffer timestamps and durations. If you remove rsvgdec from the pipeline, the timestamp and duration pass unscathed.
Comment 6 Sebastian Dröge (slomo) 2010-09-10 19:12:19 UTC
Comment on attachment 169046 [details] [review]
patch

yes, this won't work in most cases. it would require to always have a timestamp

the correct way to do this would be, to keep track of the upstream timestamps (if any) by something like gst_adapter_get_prev_timestamp() and something similar for the duration.
Comment 7 Stefan Friesel 2011-05-30 13:57:33 UTC
Another variation of this bug is, when there are no upstream time-stamps but a framerate. Example:

gst-launch -v multifilesrc location="%05d.svg" ! "image/svg,framerate=30/1" ! rsvgdec ! fakesink

rsvgdec changes the framerate, duration and all timestamps to 0
Comment 8 Vincent Penquerc'h 2011-08-18 12:12:23 UTC
It seems that the SVG data can come im multiple buffers.
When this is so, it is not clear what timestamps make the most sense.
My first guess would be from the timestamp of the first buffer to the end time of the last buffer, but then this would add quite some latency, as the output buffer can only be pushed when the last buffer comes in, but with a timestamp from the past (from the first buffer).
Comment 9 Vincent Penquerc'h 2011-08-18 12:22:39 UTC
Created attachment 194123 [details] [review]
rsvgdec: use input buffer timings if possible

SVG data may come through multiple buffers, so keep track of the
timestamp of the first buffer, and use it in preference.
Comment 10 Vincent Penquerc'h 2011-08-18 12:24:36 UTC
Note that I needed https://bugzilla.gnome.org/attachment.cgi?id=194122 as librsvg crashes with the python test case above.
Comment 11 Sebastian Dröge (slomo) 2011-08-19 07:38:36 UTC
Review of attachment 194123 [details] [review]:

Looks good except:

::: ext/rsvg/gstrsvgdec.c
@@ +393,3 @@
+        if (GST_BUFFER_DURATION_IS_VALID (buffer))
+          end += GST_BUFFER_DURATION (buffer);
+        GST_BUFFER_DURATION (outbuf) = end - GST_BUFFER_TIMESTAMP (outbuf);

You should set the duration to GST_CLOCK_TIME_NONE if no framerate is provided and the input buffer has no duration either
Comment 12 Vincent Penquerc'h 2011-08-19 10:38:37 UTC
Created attachment 194210 [details] [review]
rsvgdec: use input buffer timings if possible

SVG data may come through multiple buffers, so keep track of the
timestamp of the first buffer, and use it in preference.
Comment 13 Vincent Penquerc'h 2011-08-19 10:42:36 UTC
Created attachment 194212 [details] [review]
rsvgdec: use input buffer timings if possible

SVG data may come through multiple buffers, so keep track of the
timestamp of the first buffer, and use it in preference.
Comment 14 Sebastian Dröge (slomo) 2011-08-23 08:21:25 UTC
commit e323efc35345f8cc4942fd2598a08d97aeb023f0
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Thu Aug 18 13:21:18 2011 +0100

    rsvgdec: use input buffer timings if possible
    
    SVG data may come through multiple buffers, so keep track of the
    timestamp of the first buffer, and use it in preference.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=628284