GNOME Bugzilla – Bug 702842
basesrc: operate in time mode if do-timestamp is true
Last modified: 2014-04-23 10:09:16 UTC
shmsrc uses the default format for GstBaseSrc, which is GST_FORMAT_BYTES. When shmsrc is set to live mode format should be changed to GST_FORMAT_TIME. Otherwise we get errors (e.g. in rtph264payload): (lt-test-launch:10562): GStreamer-CRITICAL **: gst_segment_to_running_time: assertion `segment->format == format' failed
+ Trace 232126
Created attachment 247502 [details] [review] operate in time mode if source is live This fixes the problem for live sources. However, I am not sure if it should always be set to GST_FORMAT_TIME in all cases.
Don't you actually want to set the "do-timestamp" property to true ?
(In reply to comment #2) > Don't you actually want to set the "do-timestamp" property to true ? I already do that. But that doesn't seem to change the format. If I understand correctly from gstbasesrc.c it's only used to set the timestamps in buffer.
Also, the patch from comment 1 would not work if it is possible to change from live to non-live mode. This would be better: gst_base_src_set_format (GST_BASE_SRC (object), islive ? GST_FORMAT_TIME : GST_FORMAT_BYTES); However, in my short experience I've never seen it. Is it possible? Thanks!
Imho, it's not depending on live-ness, but on the do-timestamp property, as the timestamps are not set otherwise.. And I wonder if it should not be in basesrc instead.
(In reply to comment #5) > Imho, it's not depending on live-ness, but on the do-timestamp property, as the > timestamps are not set otherwise.. And I wonder if it should not be in basesrc > instead. Agree on the live-ness, but I don't know what makes more sense, basesrc or subclasses. The few plugins that set do_timestamp to true, they also set the format to GST_FORMAT_TIME. Does it make sense to set do-timestamp to true but still use GST_FORMAT_BYTES?
Created attachment 248265 [details] [review] operate in time mode if do-timestamp is true In case it doesn't belong to basesrc, here's a small patch to set it in shmsrc when do-timestamp is true.
Created attachment 248267 [details] [review] basesrc: Set format to TIME if do-timestamp is TRUE And here is the basesrc edition of the patch.
Any idea what's the best way to go?
FWIW I have applied the basesrc patch to my cerbero 1.2 tree and that has solved my particular problem with a videorate element downstream from a shmsrc complaining that it "Got segment but doesn't have GST_FORMAT_TIME value". I can't say which approach (patching basesrc or shmsrc) is more correct, though.
Olivier, do you think it makes sense to apply the patch for shmsrc and then open a new bug for basesrc? It won't hurt even if we do it in basesrc later and it will get fixed.
Comment on attachment 248265 [details] [review] operate in time mode if do-timestamp is true Wim said to push the basesrc patch.
Pushed the basesrc patch upstream. commit 68697682ce92155bcbea90b42d313258649dd4ca Author: Olivier Crête <olivier.crete@collabora.com> Date: Tue Jul 2 20:27:59 2013 -0400 basesrc: Set format to TIME if do-timestamp is TRUE https://bugzilla.gnome.org/show_bug.cgi?id=702842
What is the planned release date for this bugfix? I can see below, that it's planned for 1.3.1 version, but I haven't found any roadmap for this year online.
1.3.1 should be released really soon now