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 767105 - timeoverlay: Add time-line property options "clock-time" and "render-time"
timeoverlay: Add time-line property options "clock-time" and "render-time"
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-01 11:58 UTC by Will Manley
Modified: 2018-11-03 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch 1/3 (2.88 KB, patch)
2016-06-01 11:58 UTC, Will Manley
none Details | Review
patch 2/3 (6.69 KB, patch)
2016-06-01 11:58 UTC, Will Manley
none Details | Review
patch 3/3 (978 bytes, patch)
2016-06-01 11:59 UTC, Will Manley
none Details | Review

Description Will Manley 2016-06-01 11:58:14 UTC
Created attachment 328880 [details] [review]
patch 1/3

timeoverlay: Add time-line property options "clock-time" and "render-time"

These are useful for debugging and latency measurements:

* clock-time is the time on the `GstPipeline` clock.
* render-time is the clock time at which the frame will actually be
  displayed taking into account the latency of the pipeline.  This is
  relevant for live pipelines.

My use-case for this is measuring the latency of video-capture devices and
TVs.  By using a `GstSystemClock` with a `CLOCK_REALTIME` clock running on
a Raspberry Pi I'm hoping to take latency measurements.

I couldn't think of a way to create an automated test for this without
introducing a bunch of unacceptable dependencies (in stb-tester we would use
OCR), so I've tested manually with the below program:

    int main(int argc, char* argv[])
    {
      GstElement * epipeline;
      GstPipeline * pipeline;
      GstClock* clock;
      struct timespec ts;
      int res;
    
      gst_init(&argc, &argv);
    
      epipeline = gst_parse_launch(
          "videotestsrc is-live=true pattern=white "
          "! video/x-raw,width=1280,height=720 "
          "! timeoverlay time-mode=render-time "
          "! timeoverlay deltay=30 time-mode=clock-time "
          "! xvimagesink", NULL);
    
      g_return_val_if_fail (epipeline != NULL, 1);
      pipeline = GST_PIPELINE(epipeline);
    
      gst_element_set_state(epipeline, GST_STATE_READY);
    
      clock = g_object_new (GST_TYPE_SYSTEM_CLOCK, "clock-type",
          GST_CLOCK_TYPE_REALTIME, NULL);
      gst_pipeline_use_clock(pipeline, clock);
      gst_pipeline_set_latency(pipeline, GST_SECOND);
    
      res = clock_gettime(CLOCK_REALTIME, &ts);
      g_return_val_if_fail (res == 0, 1);
    
      printf("Start time: %i:%02i:%02i.%03i\n", ts.tv_sec / 60 / 60,
          ts.tv_sec / 60 % 60, ts.tv_sec % 60, ts.tv_nsec / 1000000);
      gst_element_set_state(epipeline, GST_STATE_PLAYING);
    
      usleep(30*1000000);
      gst_element_set_state(epipeline, GST_STATE_NULL);
    }
Comment 1 Will Manley 2016-06-01 11:58:49 UTC
Created attachment 328881 [details] [review]
patch 2/3
Comment 2 Will Manley 2016-06-01 11:59:08 UTC
Created attachment 328882 [details] [review]
patch 3/3
Comment 3 GStreamer system administrator 2018-11-03 11:46:47 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-base/issues/271.