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 776601 - rtspsrc: set absolute range headers if only UTC is accepted
rtspsrc: set absolute range headers if only UTC is accepted
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.10.2
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-29 23:01 UTC by dashesy
Modified: 2018-11-03 15:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
USe absolute clock range if only UTC is accepted (2.49 KB, patch)
2016-12-29 23:01 UTC, dashesy
none Details | Review
Add Accept-Ranges header (808 bytes, patch)
2016-12-29 23:02 UTC, dashesy
none Details | Review
rtspsrc to use absolute clock if only UTC accepted (2.89 KB, patch)
2017-01-06 02:35 UTC, dashesy
none Details | Review
rtspsrc to use absolute clock if only UTC accepted (2.91 KB, patch)
2017-01-25 21:29 UTC, dashesy
needs-work Details | Review

Description dashesy 2016-12-29 23:01:25 UTC
Created attachment 342599 [details] [review]
USe absolute clock range if only UTC is accepted

Attached please find 2 patches, one against plugins-good, and one smaller one for plugins-base. 

Basically if during SETUP in the response header we have 'Accept-Ranges':'UTC' then in `gen_range_header` I use absolute time instead of npt. 

This is a requirement when playing back ONVIF streams but would always make sense because if only UTC is accepted the server is waiting to get an absolute time (and not npt). 

Bug 762884 is relevant but the advantage of a generic solution is that it even works with `gst-launch` without the need to set up a signal handler and correct the headers.
Comment 1 dashesy 2016-12-29 23:02:38 UTC
Created attachment 342600 [details] [review]
Add Accept-Ranges header

GST_RTSP_HDR_ACCEPT_RANGES to parse `Accept-Ranges` in the SETUP response
Comment 2 dashesy 2017-01-06 02:18:35 UTC
Comment on attachment 342599 [details] [review]
USe absolute clock range if only UTC is accepted

Replaced with `git format-path`
Comment 3 dashesy 2017-01-06 02:25:29 UTC
Comment on attachment 342599 [details] [review]
USe absolute clock range if only UTC is accepted

replaced with 0001-rtspsrc-Use-absolute-clock-if-only-UTC-is-accepted.patch
Comment 4 dashesy 2017-01-06 02:35:46 UTC
Created attachment 342997 [details] [review]
rtspsrc to use absolute clock if only UTC accepted
Comment 5 dashesy 2017-01-06 02:48:57 UTC
Comment on attachment 342600 [details] [review]
Add Accept-Ranges header

Bug 776929 was created with a patch against gst-plugins-base
Comment 6 dashesy 2017-01-25 21:29:21 UTC
Created attachment 344260 [details] [review]
rtspsrc to use absolute clock if only UTC accepted

use %02d instead of %2d when creating the absolute clock for dates that are 1-digit to be zero-padded.
Comment 7 Sebastian Dröge (slomo) 2017-01-26 13:03:27 UTC
Review of attachment 344260 [details] [review]:

::: gst/rtsp/gstrtspsrc.c
@@ +6264,3 @@
+                                   &respranges, 0);
+      src->need_utc_range = FALSE;
+      if (g_ascii_strcasecmp(respranges, "UTC") == 0) {

Might be NULL, right?

@@ +7192,3 @@
   gchar val_str[G_ASCII_DTOSTR_BUF_SIZE] = { 0, };
 
+  if (src->range && src->need_utc_range && src->range->min.type == GST_RTSP_TIME_UTC && src->range->max.type == GST_RTSP_TIME_UTC) {

Who/how would the range ever be filled with an UTC range?

@@ +7193,3 @@
 
+  if (src->range && src->need_utc_range && src->range->min.type == GST_RTSP_TIME_UTC && src->range->max.type == GST_RTSP_TIME_UTC) {
+    // seconds = ((hours * 60) + mins) * 60 + secs;

No C99/C++ comments

@@ +7204,3 @@
+    return g_strdup_printf("clock=%4d%02d%02dT%02d%02d%02dZ-%4d%02d%02dT%02d%02d%02dZ",
+                            src->range->min2.year, src->range->min2.month, src->range->min2.day, hours1, mins1, secs1,
+                            src->range->max2.year, src->range->max2.month, src->range->max2.day, hours2, mins2, secs2);

Run gst-indent over the code

@@ +7209,1 @@
   if (src->range && src->range->min.type == GST_RTSP_TIME_NOW) {

This should probably become "if (...) { } else if (...) { }" etc, simplified a bit
Comment 8 GStreamer system administrator 2018-11-03 15:15:32 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-good/issues/337.