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 751292 - bpmdetect: Provide timestamps together with BPM information
bpmdetect: Provide timestamps together with BPM information
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.5
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-21 18:47 UTC by Kyrylo V. Polezhaiev
Modified: 2018-11-03 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds timestamp to BPM detection event (1023 bytes, patch)
2015-06-21 22:44 UTC, Kyrylo V. Polezhaiev
rejected Details | Review

Description Kyrylo V. Polezhaiev 2015-06-21 18:47:08 UTC
It's always equal to 18446744073709551615 when I try to fetch tags like that (sorry for C++11):

    gst_pad_set_event_function_full(pad, [](GstPad *pad, GstObject *parent, GstEvent *event) -> gboolean
    {
        switch (GST_EVENT_TYPE(event))
        {
        case GST_EVENT_TAG:
            {
                gdouble bpm = 0;
                GstTagList *tag_list = nullptr;
                gst_event_parse_tag(event, &tag_list);
                gst_tag_list_get_double(tag_list, GST_TAG_BEATS_PER_MINUTE, &bpm);
                g_print("BPM change detected: %lf BPM\n", bpm);
                /// What GST_EVENT_TIMESTAMP(event) should show here?
            }
            break;
        default:
            break;
        }
        return true;
    }, nullptr, nullptr);
Comment 1 Kyrylo V. Polezhaiev 2015-06-21 18:51:10 UTC
Can we just take PTS of input buffer and put that into the event?
Comment 2 Kyrylo V. Polezhaiev 2015-06-21 22:44:14 UTC
Created attachment 305790 [details] [review]
Adds timestamp to BPM detection event

Timestamp taken from input buffer
Comment 3 Sebastian Dröge (slomo) 2015-06-22 10:16:32 UTC
Comment on attachment 305790 [details] [review]
Adds timestamp to BPM detection event

We don't put timestamps like this in events really.

I think a better way of handling this is like with the messages posted by e.g. the level and spectrum elements. They contain all the relevant timestamp information you might need.
Comment 4 Kyrylo V. Polezhaiev 2015-06-22 10:31:14 UTC
But bpmdetect doesn't post anything to Bus. It does send events.
What timestamp field in event means (or should mean) then?
Comment 5 Sebastian Dröge (slomo) 2015-06-22 10:55:34 UTC
It probably should post messages :)


The timestamp field in events (and messages, etc) are completely unused. They should probably go away at some point.
Comment 6 Kyrylo V. Polezhaiev 2015-06-27 22:22:28 UTC
Also for GstSceneChange: as I understood, we can not use events to report timestamps of BPM or Scene changes, we should teach GstBpmDetect and GstSceneChange to post to bus,  is that correct?
Comment 7 Tim-Philipp Müller 2016-02-01 18:21:29 UTC
Kyrylo, do you plan on updating the patch?
Comment 8 Kyrylo V. Polezhaiev 2016-02-02 00:01:21 UTC
But it seems we can not put timestamps in events, correct?
Comment 9 Sebastian Dröge (slomo) 2016-02-16 11:18:31 UTC
Sure, events are just a GstStructure. You can put any value you want in there :) Just like e.g. the spectrum element does with the GstMessages it is sending.
Comment 10 GStreamer system administrator 2018-11-03 13:36:24 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-bad/issues/261.