Navigation

The Navigation interface is used for creating and injecting navigation related events such as mouse button presses, cursor motion and key presses. The associated library also provides methods for parsing received events, and for sending and receiving navigation related bus events. One main usecase is DVD menu navigation.

The main parts of the API are:

  • The GstNavigation interface, implemented by elements which provide an application with the ability to create and inject navigation events into the pipeline.
  • GstNavigation event handling API. GstNavigation events are created in response to calls on a GstNavigation interface implementation, and sent in the pipeline. Upstream elements can use the navigation event API functions to parse the contents of received messages.
  • GstNavigation message handling API. GstNavigation messages may be sent on the message bus to inform applications of navigation related changes in the pipeline, such as the mouse moving over a clickable region, or the set of available angles changing.

The GstNavigation message functions provide functions for creating and parsing custom bus messages for signaling GstNavigation changes.

interface Navigation {}

Members

Functions

sendCommand
void sendCommand(gstvideo.types.NavigationCommand command)

Sends the indicated command to the navigation interface.

sendEvent
void sendEvent(gst.structure.Structure structure)
sendEventSimple
void sendEventSimple(gst.event.Event event)

Sends an event to the navigation interface.

sendKeyEvent
void sendKeyEvent(string event, string key)
sendMouseEvent
void sendMouseEvent(string event, int button, double x, double y)

Sends a mouse event to the navigation interface. Mouse event coordinates are sent relative to the display space of the related output area. This is usually the size in pixels of the window associated with the element implementing the #GstNavigation interface.

sendMouseScrollEvent
void sendMouseScrollEvent(double x, double y, double deltaX, double deltaY)

Sends a mouse scroll event to the navigation interface. Mouse event coordinates are sent relative to the display space of the related output area. This is usually the size in pixels of the window associated with the element implementing the #GstNavigation interface.

Static functions

eventGetCoordinates
bool eventGetCoordinates(gst.event.Event event, double x, double y)

Try to retrieve x and y coordinates of a #GstNavigation event.

eventGetType
gstvideo.types.NavigationEventType eventGetType(gst.event.Event event)

Inspect a #GstEvent and return the #GstNavigationEventType of the event, or #GST_NAVIGATION_EVENT_INVALID if the event is not a #GstNavigation event.

eventNewCommand
gst.event.Event eventNewCommand(gstvideo.types.NavigationCommand command)

Create a new navigation event given navigation command..

eventNewKeyPress
gst.event.Event eventNewKeyPress(string key, gstvideo.types.NavigationModifierType state)

Create a new navigation event for the given key press.

eventNewKeyRelease
gst.event.Event eventNewKeyRelease(string key, gstvideo.types.NavigationModifierType state)

Create a new navigation event for the given key release.

eventNewMouseButtonPress
gst.event.Event eventNewMouseButtonPress(int button, double x, double y, gstvideo.types.NavigationModifierType state)

Create a new navigation event for the given key mouse button press.

eventNewMouseButtonRelease
gst.event.Event eventNewMouseButtonRelease(int button, double x, double y, gstvideo.types.NavigationModifierType state)

Create a new navigation event for the given key mouse button release.

eventNewMouseMove
gst.event.Event eventNewMouseMove(double x, double y, gstvideo.types.NavigationModifierType state)

Create a new navigation event for the new mouse location.

eventNewMouseScroll
gst.event.Event eventNewMouseScroll(double x, double y, double deltaX, double deltaY, gstvideo.types.NavigationModifierType state)

Create a new navigation event for the mouse scroll.

eventNewTouchCancel
gst.event.Event eventNewTouchCancel(gstvideo.types.NavigationModifierType state)

Create a new navigation event signalling that all currently active touch points are cancelled and should be discarded. For example, under Wayland this event might be sent when a swipe passes the threshold to be recognized as a gesture by the compositor.

eventNewTouchDown
gst.event.Event eventNewTouchDown(uint identifier, double x, double y, double pressure, gstvideo.types.NavigationModifierType state)

Create a new navigation event for an added touch point.

eventNewTouchFrame
gst.event.Event eventNewTouchFrame(gstvideo.types.NavigationModifierType state)

Create a new navigation event signalling the end of a touch frame. Touch frames signal that all previous down, motion and up events not followed by another touch frame event already should be considered simultaneous.

eventNewTouchMotion
gst.event.Event eventNewTouchMotion(uint identifier, double x, double y, double pressure, gstvideo.types.NavigationModifierType state)

Create a new navigation event for a moved touch point.

eventNewTouchUp
gst.event.Event eventNewTouchUp(uint identifier, double x, double y, gstvideo.types.NavigationModifierType state)

Create a new navigation event for a removed touch point.

eventParseCommand
bool eventParseCommand(gst.event.Event event, gstvideo.types.NavigationCommand command)

Inspect a #GstNavigation command event and retrieve the enum value of the associated command.

eventParseKeyEvent
bool eventParseKeyEvent(gst.event.Event event, string key)

Note: Modifier keys (as defined in #GstNavigationModifierType) press and release events are generated even if those states are present on all other related events

eventParseModifierState
bool eventParseModifierState(gst.event.Event event, gstvideo.types.NavigationModifierType state)
eventParseMouseButtonEvent
bool eventParseMouseButtonEvent(gst.event.Event event, int button, double x, double y)

Retrieve the details of either a #GstNavigation mouse button press event or a mouse button release event. Determine which type the event is using gstvideo.navigation.Navigation.eventGetType to retrieve the #GstNavigationEventType.

eventParseMouseMoveEvent
bool eventParseMouseMoveEvent(gst.event.Event event, double x, double y)

Inspect a #GstNavigation mouse movement event and extract the coordinates of the event.

eventParseMouseScrollEvent
bool eventParseMouseScrollEvent(gst.event.Event event, double x, double y, double deltaX, double deltaY)

Inspect a #GstNavigation mouse scroll event and extract the coordinates of the event.

eventParseTouchEvent
bool eventParseTouchEvent(gst.event.Event event, uint identifier, double x, double y, double pressure)

Retrieve the details of a #GstNavigation touch-down or touch-motion event. Determine which type the event is using gstvideo.navigation.Navigation.eventGetType to retrieve the #GstNavigationEventType.

eventParseTouchUpEvent
bool eventParseTouchUpEvent(gst.event.Event event, uint identifier, double x, double y)

Retrieve the details of a #GstNavigation touch-up event.

eventSetCoordinates
bool eventSetCoordinates(gst.event.Event event, double x, double y)

Try to set x and y coordinates on a #GstNavigation event. The event must be writable.

messageGetType
gstvideo.types.NavigationMessageType messageGetType(gst.message.Message message)

Check a bus message to see if it is a #GstNavigation event, and return the #GstNavigationMessageType identifying the type of the message if so.

messageNewAnglesChanged
gst.message.Message messageNewAnglesChanged(gst.object.ObjectGst src, uint curAngle, uint nAngles)

Creates a new #GstNavigation message with type #GST_NAVIGATION_MESSAGE_ANGLES_CHANGED for notifying an application that the current angle, or current number of angles available in a multiangle video has changed.

messageNewCommandsChanged
gst.message.Message messageNewCommandsChanged(gst.object.ObjectGst src)

Creates a new #GstNavigation message with type #GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED

messageNewEvent
gst.message.Message messageNewEvent(gst.object.ObjectGst src, gst.event.Event event)

Creates a new #GstNavigation message with type #GST_NAVIGATION_MESSAGE_EVENT.

messageNewMouseOver
gst.message.Message messageNewMouseOver(gst.object.ObjectGst src, bool active)

Creates a new #GstNavigation message with type #GST_NAVIGATION_MESSAGE_MOUSE_OVER.

messageParseAnglesChanged
bool messageParseAnglesChanged(gst.message.Message message, uint curAngle, uint nAngles)

Parse a #GstNavigation message of type GST_NAVIGATION_MESSAGE_ANGLES_CHANGED and extract the cur_angle and n_angles parameters.

messageParseEvent
bool messageParseEvent(gst.message.Message message, gst.event.Event event)

Parse a #GstNavigation message of type #GST_NAVIGATION_MESSAGE_EVENT and extract contained #GstEvent. The caller must unref the event when done with it.

messageParseMouseOver
bool messageParseMouseOver(gst.message.Message message, bool active)

Parse a #GstNavigation message of type #GST_NAVIGATION_MESSAGE_MOUSE_OVER and extract the active/inactive flag. If the mouse over event is marked active, it indicates that the mouse is over a clickable area.

queryGetType
gstvideo.types.NavigationQueryType queryGetType(gst.query.Query query)

Inspect a #GstQuery and return the #GstNavigationQueryType associated with it if it is a #GstNavigation query.

queryNewAngles
gst.query.Query queryNewAngles()

Create a new #GstNavigation angles query. When executed, it will query the pipeline for the set of currently available angles, which may be greater than one in a multiangle video.

queryNewCommands
gst.query.Query queryNewCommands()

Create a new #GstNavigation commands query. When executed, it will query the pipeline for the set of currently available commands.

queryParseAngles
bool queryParseAngles(gst.query.Query query, uint curAngle, uint nAngles)

Parse the current angle number in the #GstNavigation angles query into the #guint pointed to by the cur_angle variable, and the number of available angles into the #guint pointed to by the n_angles variable.

queryParseCommandsLength
bool queryParseCommandsLength(gst.query.Query query, uint nCmds)

Parse the number of commands in the #GstNavigation commands query.

queryParseCommandsNth
bool queryParseCommandsNth(gst.query.Query query, uint nth, gstvideo.types.NavigationCommand cmd)

Parse the #GstNavigation command query and retrieve the nth command from it into cmd. If the list contains less elements than nth, cmd will be set to #GST_NAVIGATION_COMMAND_INVALID.

querySetAngles
void querySetAngles(gst.query.Query query, uint curAngle, uint nAngles)

Set the #GstNavigation angles query result field in query.

querySetCommandsv
void querySetCommandsv(gst.query.Query query, gstvideo.types.NavigationCommand[] cmds)

Set the #GstNavigation command query result fields in query. The number of commands passed must be equal to n_commands.