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 778703 - timecodestamper: Timecode from current system time
timecodestamper: Timecode from current system time
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.11.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 778702
Blocks:
 
 
Reported: 2017-02-15 18:04 UTC by Georg Lippitsch
Modified: 2017-04-14 08:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
timecodestamper: Timecode from current system time (6.74 KB, patch)
2017-02-15 18:04 UTC, Georg Lippitsch
none Details | Review
timecodestamper: Timecode from current system time (7.16 KB, patch)
2017-02-16 15:44 UTC, Georg Lippitsch
needs-work Details | Review
timecodestamper: Timecode from current system time (7.24 KB, patch)
2017-02-16 17:34 UTC, Georg Lippitsch
none Details | Review
timecodestamper: Timecode from current system time (13.08 KB, patch)
2017-02-21 14:06 UTC, Georg Lippitsch
none Details | Review
timecodestamper: First timecode property (5.29 KB, patch)
2017-02-22 21:34 UTC, Georg Lippitsch
committed Details | Review
timecodestamper: First timecode from current system time (4.86 KB, patch)
2017-02-22 21:34 UTC, Georg Lippitsch
committed Details | Review
timecodestamper: Remove clock-source property (7.75 KB, patch)
2017-02-22 21:35 UTC, Georg Lippitsch
committed Details | Review

Description Georg Lippitsch 2017-02-15 18:04:06 UTC
Created attachment 345863 [details] [review]
timecodestamper: Timecode from current system time

Add an new property to start from a given timecode
instead of zero. Also, add a new flag which automatically
sets this first timecode to the current system time in
local time zone.
Comment 1 Georg Lippitsch 2017-02-16 15:44:39 UTC
Created attachment 345953 [details] [review]
timecodestamper: Timecode from current system time
Comment 2 Georg Lippitsch 2017-02-16 17:34:49 UTC
Created attachment 345976 [details] [review]
timecodestamper: Timecode from current system time
Comment 3 Vivia Nikolaidou 2017-02-16 17:39:57 UTC
Review of attachment 345953 [details] [review]:

::: gst/timecode/gsttimecodestamper.c
@@ +142,3 @@
+      g_param_spec_boxed ("first-timecode",
+          "Timecode at the first frame",
+          "If unset, the timecode will start at 0",

You should write a description (and check that it works) about which property overrides which. For instance, it would make sense for one of FIRST_TIMECODE and FIRST_NOW to override the other, and for both to override CLOCK_SOURCE. Maybe you should add a "mode" option that would point to one of {running-time, from-clock, from-date-time, now}, but that would require the user to set two properties. Which solution do you think looks cleaner?

@@ +477,3 @@
     }
+  } else if (timecodestamper->source_clock == NULL &&
+      timecodestamper->first_tc == NULL) {

Add some sanity checks (especially in this function) that the timecodestamper won't act up in case e.g. both source-clock and first-timecode are given.
Comment 4 Vivia Nikolaidou 2017-02-16 17:40:00 UTC
Review of attachment 345953 [details] [review]:

::: gst/timecode/gsttimecodestamper.c
@@ +142,3 @@
+      g_param_spec_boxed ("first-timecode",
+          "Timecode at the first frame",
+          "If unset, the timecode will start at 0",

You should write a description (and check that it works) about which property overrides which. For instance, it would make sense for one of FIRST_TIMECODE and FIRST_NOW to override the other, and for both to override CLOCK_SOURCE. Maybe you should add a "mode" option that would point to one of {running-time, from-clock, from-date-time, now}, but that would require the user to set two properties. Which solution do you think looks cleaner?

@@ +477,3 @@
     }
+  } else if (timecodestamper->source_clock == NULL &&
+      timecodestamper->first_tc == NULL) {

Add some sanity checks (especially in this function) that the timecodestamper won't act up in case e.g. both source-clock and first-timecode are given.
Comment 5 Georg Lippitsch 2017-02-21 14:06:30 UTC
Created attachment 346357 [details] [review]
timecodestamper: Timecode from current system time
Comment 6 Vivia Nikolaidou 2017-02-22 13:21:26 UTC
Review of attachment 346357 [details] [review]:

Looks good to me, thanks!
Comment 7 Sebastian Dröge (slomo) 2017-02-22 18:52:45 UTC
Review of attachment 346357 [details] [review]:

Looks good but please split this into 3 patches. These are 3 separate changes, even your commit message reads like that :)

::: gst/timecode/gsttimecodestamper.c
@@ +304,3 @@
+    timecodestamper->current_tc->minutes = timecodestamper->first_tc->minutes;
+    timecodestamper->current_tc->seconds = timecodestamper->first_tc->seconds;
+    timecodestamper->current_tc->frames = timecodestamper->first_tc->frames;

Should maybe be documented that only these fields are taken (what about field count btw?) and not flags, framerate, etc.
Comment 8 Georg Lippitsch 2017-02-22 21:34:12 UTC
Created attachment 346514 [details] [review]
timecodestamper: First timecode property
Comment 9 Georg Lippitsch 2017-02-22 21:34:40 UTC
Created attachment 346515 [details] [review]
timecodestamper: First timecode from current system time
Comment 10 Georg Lippitsch 2017-02-22 21:35:08 UTC
Created attachment 346516 [details] [review]
timecodestamper: Remove clock-source property
Comment 11 Sebastian Dröge (slomo) 2017-02-23 18:01:05 UTC
Attachment 346514 [details] pushed as 290f3ca - timecodestamper: First timecode property
Attachment 346515 [details] pushed as 2cc6264 - timecodestamper: First timecode from current system time
Attachment 346516 [details] pushed as fc2ca69 - timecodestamper: Remove clock-source property
Comment 12 Tim-Philipp Müller 2017-04-13 11:57:48 UTC
I wonder if "first-time-from-systemtime" or such would be better than "first-time-from-now"? I find the "now" part confusing. Does it refer to the moment when the property is set to TRUE? Or rather the moment the first buffer comes in?
Comment 13 Georg Lippitsch 2017-04-14 08:46:19 UTC
The "now" was chosen based on the function it uses:
g_date_time_new_now_local ();

It is set at the first GST_EVENT_SEGMENT
Comment 14 Tim-Philipp Müller 2017-04-14 08:57:10 UTC
Sure, but are you saying you don't see why it would be confusing? :)