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 777048 - timecodestamper: Post element message with current timecode
timecodestamper: Post element message with current timecode
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-09 15:56 UTC by Vivia Nikolaidou
Modified: 2017-01-09 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-timecodestamper-Post-element-message-with-current-ti.patch (2.65 KB, patch)
2017-01-09 15:56 UTC, Vivia Nikolaidou
none Details | Review
0001-timecodestamper-Post-element-message-with-current-ti.patch (5.42 KB, patch)
2017-01-09 16:18 UTC, Vivia Nikolaidou
none Details | Review
0001-timecodestamper-Post-element-message-with-current-ti.patch (5.97 KB, patch)
2017-01-09 16:27 UTC, Vivia Nikolaidou
none Details | Review
0001-timecodestamper-Post-element-message-with-current-ti.patch (5.97 KB, patch)
2017-01-09 16:39 UTC, Vivia Nikolaidou
committed Details | Review

Description Vivia Nikolaidou 2017-01-09 15:56:23 UTC
timecodestamper will post an element message which contains the current
    timecode it just stamped. If a timecode was already found and not
    replaced, it will still post it in a message.
Comment 1 Vivia Nikolaidou 2017-01-09 15:56:59 UTC
Created attachment 343159 [details] [review]
0001-timecodestamper-Post-element-message-with-current-ti.patch
Comment 2 Sebastian Dröge (slomo) 2017-01-09 16:08:34 UTC
Review of attachment 343159 [details] [review]:

::: gst/timecode/gsttimecodestamper.c
@@ +446,3 @@
+      gst_util_uint64_scale_int (GST_SECOND, timecodestamper->vinfo.fps_d,
+      timecodestamper->vinfo.fps_n);
+  s = gst_structure_new ("timecodestamper", "running-time", G_TYPE_UINT64,

Maybe stream-time too? What does level/spectrum do?

Also should the name be more generic or is it ok like that? Suggestions?

@@ +447,3 @@
+      timecodestamper->vinfo.fps_n);
+  s = gst_structure_new ("timecodestamper", "running-time", G_TYPE_UINT64,
+      ref_time, "duration", G_TYPE_UINT64, duration, "timecode", G_TYPE_STRING,

It would make more sense to put the actual GstVideoTimeCode in here instead of a string

@@ +450,3 @@
+      tc_str, NULL);
+  msg = gst_message_new_element (GST_OBJECT (timecodestamper), s);
+  gst_element_post_message (GST_ELEMENT (timecodestamper), msg);

Might want a property to enable/disable this as that many messages can be expensive
Comment 3 Vivia Nikolaidou 2017-01-09 16:18:54 UTC
Created attachment 343163 [details] [review]
0001-timecodestamper-Post-element-message-with-current-ti.patch

Thanks! Applied the comments, please review again
Comment 4 Sebastian Dröge (slomo) 2017-01-09 16:25:07 UTC
Review of attachment 343163 [details] [review]:

::: gst/timecode/gsttimecodestamper.c
@@ +133,3 @@
           G_TYPE_DATE_TIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+  g_object_class_install_property (gobject_class, PROP_SEND_MSG,
+      g_param_spec_boolean ("send-msg", "Send element message",

In level and spectrum this is called "post-messages"

@@ +455,3 @@
+    running_time =
+        gst_segment_to_running_time (&vfilter->segment, GST_FORMAT_TIME,
+        buffer->pts);

Instead of buffer->pts use GST_BUFFER_PTS(buffer)
Comment 5 Vivia Nikolaidou 2017-01-09 16:27:45 UTC
Created attachment 343166 [details] [review]
0001-timecodestamper-Post-element-message-with-current-ti.patch
Comment 6 Vivia Nikolaidou 2017-01-09 16:39:02 UTC
Created attachment 343167 [details] [review]
0001-timecodestamper-Post-element-message-with-current-ti.patch
Comment 7 Sebastian Dröge (slomo) 2017-01-09 16:53:01 UTC
commit b16cd484bf97fb886d0bf48f75881046827a4a66
Author: Vivia Nikolaidou <vivia@toolsonair.com>
Date:   Mon Jan 9 17:53:38 2017 +0200

    timecodestamper: Post element message with current timecode
    
    timecodestamper will post an element message which contains the current
    timecode it just stamped. If a timecode was already found and not
    replaced, it will still post it in a message.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777048