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 702842 - basesrc: operate in time mode if do-timestamp is true
basesrc: operate in time mode if do-timestamp is true
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-22 01:02 UTC by Aleix Conchillo Flaqué
Modified: 2014-04-23 10:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
operate in time mode if source is live (1.53 KB, patch)
2013-06-22 01:11 UTC, Aleix Conchillo Flaqué
none Details | Review
operate in time mode if do-timestamp is true (795 bytes, patch)
2013-07-03 00:03 UTC, Aleix Conchillo Flaqué
rejected Details | Review
basesrc: Set format to TIME if do-timestamp is TRUE (804 bytes, patch)
2013-07-03 00:29 UTC, Olivier Crête
committed Details | Review

Description Aleix Conchillo Flaqué 2013-06-22 01:02:49 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

  • #0 g_logv
    at gmessages.c line 765
  • #1 g_log
    at gmessages.c line 792
  • #2 gst_segment_to_running_time
    at gstsegment.c line 486
  • #3 gst_rtp_base_payload_prepare_push
    at gstrtpbasepayload.c line 845
  • #4 gst_rtp_base_payload_push_list
    at gstrtpbasepayload.c line 920
  • #5 gst_rtp_h264_pay_payload_nal
    at gstrtph264pay.c line 954
  • #6 gst_rtp_h264_pay_handle_buffer
    at gstrtph264pay.c line 1129
  • #7 gst_pad_chain_data_unchecked
    at gstpad.c line 3708

Comment 1 Aleix Conchillo Flaqué 2013-06-22 01:11:22 UTC
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.
Comment 2 Olivier Crête 2013-06-22 01:23:11 UTC
Don't you actually want to set the "do-timestamp" property to true ?
Comment 3 Aleix Conchillo Flaqué 2013-06-22 04:43:12 UTC
(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.
Comment 4 Aleix Conchillo Flaqué 2013-06-22 04:49:35 UTC
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!
Comment 5 Olivier Crête 2013-07-02 14:03:14 UTC
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.
Comment 6 Aleix Conchillo Flaqué 2013-07-02 22:07:36 UTC
(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?
Comment 7 Aleix Conchillo Flaqué 2013-07-03 00:03:34 UTC
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.
Comment 8 Olivier Crête 2013-07-03 00:29:08 UTC
Created attachment 248267 [details] [review]
basesrc: Set format to TIME if do-timestamp is TRUE

And here is the basesrc edition of the patch.
Comment 9 Aleix Conchillo Flaqué 2013-07-15 22:22:37 UTC
Any idea what's the best way to go?
Comment 10 Mark Howell 2013-10-24 02:16:38 UTC
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.
Comment 11 Aleix Conchillo Flaqué 2013-10-30 14:46:16 UTC
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 12 Olivier Crête 2013-12-05 18:29:42 UTC
Comment on attachment 248265 [details] [review]
operate in time mode if do-timestamp is true

Wim said to push the basesrc patch.
Comment 13 Olivier Crête 2013-12-05 19:45:25 UTC
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
Comment 14 Krzysztof Borowczyk 2014-04-23 10:02:31 UTC
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.
Comment 15 Sebastian Dröge (slomo) 2014-04-23 10:09:16 UTC
1.3.1 should be released really soon now