GstVideo.Navigation

g GObject.GInterface GObject.GInterface GstVideo.Navigation GstVideo.Navigation GObject.GInterface->GstVideo.Navigation

Implementations:

None

Methods

class

event_get_coordinates (event)

class

event_get_type (event)

class

event_new_command (command)

class

event_new_key_press (key, state)

class

event_new_key_release (key, state)

class

event_new_mouse_button_press (button, x, y, state)

class

event_new_mouse_button_release (button, x, y, state)

class

event_new_mouse_move (x, y, state)

class

event_new_mouse_scroll (x, y, delta_x, delta_y, state)

class

event_new_touch_cancel (state)

class

event_new_touch_down (identifier, x, y, pressure, state)

class

event_new_touch_frame (state)

class

event_new_touch_motion (identifier, x, y, pressure, state)

class

event_new_touch_up (identifier, x, y, state)

class

event_parse_command (event)

class

event_parse_key_event (event)

class

event_parse_modifier_state (event, state)

class

event_parse_mouse_button_event (event)

class

event_parse_mouse_move_event (event)

class

event_parse_mouse_scroll_event (event)

class

event_parse_touch_event (event)

class

event_parse_touch_up_event (event)

class

event_set_coordinates (event, x, y)

class

message_get_type (message)

class

message_new_angles_changed (src, cur_angle, n_angles)

class

message_new_commands_changed (src)

class

message_new_event (src, event)

class

message_new_mouse_over (src, active)

class

message_parse_angles_changed (message)

class

message_parse_event (message)

class

message_parse_mouse_over (message)

class

query_get_type (query)

class

query_new_angles ()

class

query_new_commands ()

class

query_parse_angles (query)

class

query_parse_commands_length (query)

class

query_parse_commands_nth (query, nth)

class

query_set_angles (query, cur_angle, n_angles)

class

query_set_commandsv (query, cmds)

send_command (command)

send_event (structure)

send_event_simple (event)

send_key_event (event, key)

send_mouse_event (event, button, x, y)

send_mouse_scroll_event (x, y, delta_x, delta_y)

Virtual Methods

do_send_event (structure)

do_send_event_simple (event)

Properties

None

Signals

None

Fields

None

Class Details

class GstVideo.Navigation
Bases:

GObject.GInterface

Structure:

GstVideo.NavigationInterface

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 GstVideo.Navigation interface, implemented by elements which provide an application with the ability to create and inject navigation events into the pipeline.

  • GstVideo.Navigation event handling API. GstVideo.Navigation events are created in response to calls on a GstVideo.Navigation interface implementation, and sent in the pipeline. Upstream elements can use the navigation event API functions to parse the contents of received messages.

  • GstVideo.Navigation message handling API. GstVideo.Navigation 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 GstVideo.Navigation message functions provide functions for creating and parsing custom bus messages for signaling GstVideo.Navigation changes.

classmethod event_get_coordinates(event)[source]
Parameters:

event (Gst.Event) – The Gst.Event to inspect.

Returns:

A boolean indicating success.

x:

Pointer to a float to receive the x coordinate of the navigation event.

y:

Pointer to a float to receive the y coordinate of the navigation event.

Return type:

(bool, x: float, y: float)

Try to retrieve x and y coordinates of a GstVideo.Navigation event.

New in version 1.22.

classmethod event_get_type(event)[source]
Parameters:

event (Gst.Event) – A Gst.Event to inspect.

Return type:

GstVideo.NavigationEventType

Inspect a Gst.Event and return the GstVideo.NavigationEventType of the event, or GstVideo.NavigationEventType.INVALID if the event is not a GstVideo.Navigation event.

classmethod event_new_command(command)[source]
Parameters:

command (GstVideo.NavigationCommand) – The navigation command to use.

Returns:

a new Gst.Event

Return type:

Gst.Event

Create a new navigation event given navigation command..

New in version 1.22.

classmethod event_new_key_press(key, state)[source]
Parameters:
  • key (str) – A string identifying the key press.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

Create a new navigation event for the given key press.

New in version 1.22.

classmethod event_new_key_release(key, state)[source]
Parameters:
  • key (str) – A string identifying the released key.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

Create a new navigation event for the given key release.

New in version 1.22.

classmethod event_new_mouse_button_press(button, x, y, state)[source]
Parameters:
  • button (int) – The number of the pressed mouse button.

  • x (float) – The x coordinate of the mouse cursor.

  • y (float) – The y coordinate of the mouse cursor.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

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

New in version 1.22.

classmethod event_new_mouse_button_release(button, x, y, state)[source]
Parameters:
  • button (int) – The number of the released mouse button.

  • x (float) – The x coordinate of the mouse cursor.

  • y (float) – The y coordinate of the mouse cursor.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

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

New in version 1.22.

classmethod event_new_mouse_move(x, y, state)[source]
Parameters:
  • x (float) – The x coordinate of the mouse cursor.

  • y (float) – The y coordinate of the mouse cursor.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

Create a new navigation event for the new mouse location.

New in version 1.22.

classmethod event_new_mouse_scroll(x, y, delta_x, delta_y, state)[source]
Parameters:
  • x (float) – The x coordinate of the mouse cursor.

  • y (float) – The y coordinate of the mouse cursor.

  • delta_x (float) – The x component of the scroll movement.

  • delta_y (float) – The y component of the scroll movement.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

Create a new navigation event for the mouse scroll.

New in version 1.22.

classmethod event_new_touch_cancel(state)[source]
Parameters:

state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

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.

New in version 1.22.

classmethod event_new_touch_down(identifier, x, y, pressure, state)[source]
Parameters:
  • identifier (int) – A number uniquely identifying this touch point. It must stay unique to this touch point at least until an up event is sent for the same identifier, or all touch points are cancelled.

  • x (float) – The x coordinate of the new touch point.

  • y (float) – The y coordinate of the new touch point.

  • pressure (float) – Pressure data of the touch point, from 0.0 to 1.0, or NaN if no data is available.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

Create a new navigation event for an added touch point.

New in version 1.22.

classmethod event_new_touch_frame(state)[source]
Parameters:

state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

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.

New in version 1.22.

classmethod event_new_touch_motion(identifier, x, y, pressure, state)[source]
Parameters:
  • identifier (int) – A number uniquely identifying this touch point. It must correlate to exactly one previous touch_start event.

  • x (float) – The x coordinate of the touch point.

  • y (float) – The y coordinate of the touch point.

  • pressure (float) – Pressure data of the touch point, from 0.0 to 1.0, or NaN if no data is available.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

Create a new navigation event for a moved touch point.

New in version 1.22.

classmethod event_new_touch_up(identifier, x, y, state)[source]
Parameters:
  • identifier (int) – A number uniquely identifying this touch point. It must correlate to exactly one previous down event, but can be reused after sending this event.

  • x (float) – The x coordinate of the touch point.

  • y (float) – The y coordinate of the touch point.

  • state (GstVideo.NavigationModifierType) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).

Returns:

a new Gst.Event

Return type:

Gst.Event

Create a new navigation event for a removed touch point.

New in version 1.22.

classmethod event_parse_command(event)[source]
Parameters:

event (Gst.Event) – A Gst.Event to inspect.

Returns:

True if the navigation command could be extracted, otherwise False.

command:

Pointer to GstVideo.NavigationCommand to receive the type of the navigation event.

Return type:

(bool, command: GstVideo.NavigationCommand)

Inspect a GstVideo.Navigation command event and retrieve the enum value of the associated command.

classmethod event_parse_key_event(event)[source]
Parameters:

event (Gst.Event) – A Gst.Event to inspect.

Returns:

key:

A pointer to a location to receive the string identifying the key press. The returned string is owned by the event, and valid only until the event is unreffed.

Return type:

(bool, key: str)

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

classmethod event_parse_modifier_state(event, state)[source]
Parameters:
Returns:

True if the event is a GstVideo.Navigation event with associated modifiers state, otherwise False.

Return type:

bool

New in version 1.22.

classmethod event_parse_mouse_button_event(event)[source]
Parameters:

event (Gst.Event) – A Gst.Event to inspect.

Returns:

True if the button number and both coordinates could be extracted, otherwise False.

button:

Pointer to a int that will receive the button number associated with the event.

x:

Pointer to a float to receive the x coordinate of the mouse button event.

y:

Pointer to a float to receive the y coordinate of the mouse button event.

Return type:

(bool, button: int, x: float, y: float)

Retrieve the details of either a GstVideo.Navigation mouse button press event or a mouse button release event. Determine which type the event is using GstVideo.Navigation.event_get_type() to retrieve the GstVideo.NavigationEventType.

classmethod event_parse_mouse_move_event(event)[source]
Parameters:

event (Gst.Event) – A Gst.Event to inspect.

Returns:

True if both coordinates could be extracted, otherwise False.

x:

Pointer to a float to receive the x coordinate of the mouse movement.

y:

Pointer to a float to receive the y coordinate of the mouse movement.

Return type:

(bool, x: float, y: float)

Inspect a GstVideo.Navigation mouse movement event and extract the coordinates of the event.

classmethod event_parse_mouse_scroll_event(event)[source]
Parameters:

event (Gst.Event) – A Gst.Event to inspect.

Returns:

True if all coordinates could be extracted, otherwise False.

x:

Pointer to a float to receive the x coordinate of the mouse movement.

y:

Pointer to a float to receive the y coordinate of the mouse movement.

delta_x:

Pointer to a float to receive the delta_x coordinate of the mouse movement.

delta_y:

Pointer to a float to receive the delta_y coordinate of the mouse movement.

Return type:

(bool, x: float, y: float, delta_x: float, delta_y: float)

Inspect a GstVideo.Navigation mouse scroll event and extract the coordinates of the event.

New in version 1.18.

classmethod event_parse_touch_event(event)[source]
Parameters:

event (Gst.Event) – A Gst.Event to inspect.

Returns:

True if all details could be extracted, otherwise False.

identifier:

Pointer to a int that will receive the identifier unique to this touch point.

x:

Pointer to a float that will receive the x coordinate of the touch event.

y:

Pointer to a float that will receive the y coordinate of the touch event.

pressure:

Pointer to a float that will receive the force of the touch event, in the range from 0.0 to 1.0. If pressure data is not available, NaN will be set instead.

Return type:

(bool, identifier: int, x: float, y: float, pressure: float)

Retrieve the details of a GstVideo.Navigation touch-down or touch-motion event. Determine which type the event is using GstVideo.Navigation.event_get_type() to retrieve the GstVideo.NavigationEventType.

New in version 1.22.

classmethod event_parse_touch_up_event(event)[source]
Parameters:

event (Gst.Event) – A Gst.Event to inspect.

Returns:

True if all details could be extracted, otherwise False.

identifier:

Pointer to a int that will receive the identifier unique to this touch point.

x:

Pointer to a float that will receive the x coordinate of the touch event.

y:

Pointer to a float that will receive the y coordinate of the touch event.

Return type:

(bool, identifier: int, x: float, y: float)

Retrieve the details of a GstVideo.Navigation touch-up event.

New in version 1.22.

classmethod event_set_coordinates(event, x, y)[source]
Parameters:
Returns:

A boolean indicating success.

Return type:

bool

Try to set x and y coordinates on a GstVideo.Navigation event. The event must be writable.

New in version 1.22.

classmethod message_get_type(message)[source]
Parameters:

message (Gst.Message) – A Gst.Message to inspect.

Returns:

The type of the Gst.Message, or GstVideo.NavigationMessageType.INVALID if the message is not a GstVideo.Navigation notification.

Return type:

GstVideo.NavigationMessageType

Check a bus message to see if it is a GstVideo.Navigation event, and return the GstVideo.NavigationMessageType identifying the type of the message if so.

classmethod message_new_angles_changed(src, cur_angle, n_angles)[source]
Parameters:
  • src (Gst.Object) – A Gst.Object to set as source of the new message.

  • cur_angle (int) – The currently selected angle.

  • n_angles (int) – The number of viewing angles now available.

Returns:

The new Gst.Message.

Return type:

Gst.Message

Creates a new GstVideo.Navigation message with type GstVideo.NavigationMessageType.ANGLES_CHANGED for notifying an application that the current angle, or current number of angles available in a multiangle video has changed.

classmethod message_new_commands_changed(src)[source]
Parameters:

src (Gst.Object) – A Gst.Object to set as source of the new message.

Returns:

The new Gst.Message.

Return type:

Gst.Message

Creates a new GstVideo.Navigation message with type GstVideo.NavigationMessageType.COMMANDS_CHANGED

classmethod message_new_event(src, event)[source]
Parameters:
Returns:

The new Gst.Message.

Return type:

Gst.Message

Creates a new GstVideo.Navigation message with type GstVideo.NavigationMessageType.EVENT.

New in version 1.6.

classmethod message_new_mouse_over(src, active)[source]
Parameters:
  • src (Gst.Object) – A Gst.Object to set as source of the new message.

  • active (bool) – True if the mouse has entered a clickable area of the display. False if it over a non-clickable area.

Returns:

The new Gst.Message.

Return type:

Gst.Message

Creates a new GstVideo.Navigation message with type GstVideo.NavigationMessageType.MOUSE_OVER.

classmethod message_parse_angles_changed(message)[source]
Parameters:

message (Gst.Message) – A Gst.Message to inspect.

Returns:

True if the message could be successfully parsed. False if not.

cur_angle:

A pointer to a int to receive the new current angle number, or None

n_angles:

A pointer to a int to receive the new angle count, or None.

Return type:

(bool, cur_angle: int, n_angles: int)

Parse a GstVideo.Navigation message of type GstVideo.NavigationMessageType.ANGLES_CHANGED and extract the cur_angle and n_angles parameters.

classmethod message_parse_event(message)[source]
Parameters:

message (Gst.Message) – A Gst.Message to inspect.

Returns:

True if the message could be successfully parsed. False if not.

event:

a pointer to a Gst.Event to receive the contained navigation event.

Return type:

(bool, event: Gst.Event)

Parse a GstVideo.Navigation message of type GstVideo.NavigationMessageType.EVENT and extract contained Gst.Event. The caller must unref the event when done with it.

New in version 1.6.

classmethod message_parse_mouse_over(message)[source]
Parameters:

message (Gst.Message) – A Gst.Message to inspect.

Returns:

True if the message could be successfully parsed. False if not.

active:

A pointer to a bool to receive the active/inactive state, or None.

Return type:

(bool, active: bool)

Parse a GstVideo.Navigation message of type GstVideo.NavigationMessageType.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.

classmethod query_get_type(query)[source]
Parameters:

query (Gst.Query) – The query to inspect

Returns:

The GstVideo.NavigationQueryType of the query, or GstVideo.NavigationQueryType.INVALID

Return type:

GstVideo.NavigationQueryType

Inspect a Gst.Query and return the GstVideo.NavigationQueryType associated with it if it is a GstVideo.Navigation query.

classmethod query_new_angles()[source]
Returns:

The new query.

Return type:

Gst.Query

Create a new GstVideo.Navigation 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.

classmethod query_new_commands()[source]
Returns:

The new query.

Return type:

Gst.Query

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

classmethod query_parse_angles(query)[source]
Parameters:

query (Gst.Query) – a Gst.Query

Returns:

True if the query could be successfully parsed. False if not.

cur_angle:

Pointer to a int into which to store the currently selected angle value from the query, or None

n_angles:

Pointer to a int into which to store the number of angles value from the query, or None

Return type:

(bool, cur_angle: int, n_angles: int)

Parse the current angle number in the GstVideo.Navigation angles query into the int pointed to by the cur_angle variable, and the number of available angles into the int pointed to by the n_angles variable.

classmethod query_parse_commands_length(query)[source]
Parameters:

query (Gst.Query) – a Gst.Query

Returns:

True if the query could be successfully parsed. False if not.

n_cmds:

the number of commands in this query.

Return type:

(bool, n_cmds: int)

Parse the number of commands in the GstVideo.Navigation commands query.

classmethod query_parse_commands_nth(query, nth)[source]
Parameters:
Returns:

True if the query could be successfully parsed. False if not.

cmd:

a pointer to store the nth command into.

Return type:

(bool, cmd: GstVideo.NavigationCommand)

Parse the GstVideo.Navigation command query and retrieve the nth command from it into cmd. If the list contains less elements than nth, cmd will be set to GstVideo.NavigationCommand.INVALID.

classmethod query_set_angles(query, cur_angle, n_angles)[source]
Parameters:
  • query (Gst.Query) – a Gst.Query

  • cur_angle (int) – the current viewing angle to set.

  • n_angles (int) – the number of viewing angles to set.

Set the GstVideo.Navigation angles query result field in query.

classmethod query_set_commandsv(query, cmds)[source]
Parameters:

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

send_command(command)[source]
Parameters:

command (GstVideo.NavigationCommand) – The command to issue

Sends the indicated command to the navigation interface.

send_event(structure)[source]
Parameters:

structure (Gst.Structure) –

send_event_simple(event)[source]
Parameters:

event (Gst.Event) – The event to send

Sends an event to the navigation interface.

New in version 1.22.

send_key_event(event, key)[source]
Parameters:
  • event (str) – The type of the key event. Recognised values are “key-press” and “key-release”

  • key (str) – Character representation of the key. This is typically as produced by XKeysymToString.

send_mouse_event(event, button, x, y)[source]
Parameters:
  • event (str) – The type of mouse event, as a text string. Recognised values are “mouse-button-press”, “mouse-button-release” and “mouse-move”.

  • button (int) – The button number of the button being pressed or released. Pass 0 for mouse-move events.

  • x (float) – The x coordinate of the mouse event.

  • y (float) – The y coordinate of the mouse event.

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 GstVideo.Navigation interface.

send_mouse_scroll_event(x, y, delta_x, delta_y)[source]
Parameters:
  • x (float) – The x coordinate of the mouse event.

  • y (float) – The y coordinate of the mouse event.

  • delta_x (float) – The delta_x coordinate of the mouse event.

  • delta_y (float) – The delta_y coordinate of the mouse event.

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 GstVideo.Navigation interface.

New in version 1.18.

do_send_event(structure) virtual
Parameters:

structure (Gst.Structure) –

sending a navigation event.

Deprecated since version 1.22: Use GstVideo.Navigation.do_send_event_simple() instead.

do_send_event_simple(event) virtual
Parameters:

event (Gst.Event) – The event to send

Sends an event to the navigation interface.

New in version 1.22.