[Bug 759869] glimagesink: navigation messages are not posted on the bus

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sat Dec 26 14:47:00 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=759869

--- Comment #6 from Florent Thiery <florent.thiery at ubicast.eu> ---
(In reply to Florent Thiery from comment #4)
> Is it normal that messages are of type GST_MESSAGE_ELEMENT and not
> GST_MESSAGE_NAVIGATION ?

Okay, so after some fiddling i found how to get the data from the element
message; it's a bit sad that we can't just bus.connect('message::navigation',
self._on_navigation_evt), and it's pretty convoluted to get the actual event
itself, and to distinguish key presses from pointer activity, but i do now
understand that the navigation event is simply posted to the bus as is, as a
regular element message.

This means that to extract the actual content (key press for instance), it is
required to do the following (python); please let me know if i got it right:

    def _on_message(self, bus, message):
        if message.type == Gst.MessageType.ELEMENT:
            m_struct = message.get_structure()
            m_name = struct.get_name()
            if m_name == 'GstNavigationMessage':
                event = struct.get_value('event')
                e_struct = event.get_structure()
                if e_struct.has_field('key'):
                    key = e_struct.get_value('key')
                elif e_struct.has_field('pointer_x'):
                    x = e_struct.get_value('pointer_x')
                    y = e_struct.get_value('pointer_y')

I'm interested in better ways to separate cursor events from key presses,
because the event field name takes quite a lot of different values; for
instance, for cursor events, it can have "mouse-move", "mouse-button-press",
"mouse-button-release". Having an additional field could help (e.g.
"event-type" = "mouse" or "key").

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list