GstVideo.Navigation¶
- Implementations:
None
Methods¶
Virtual Methods¶
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class GstVideo.Navigation¶
- Bases:
- Structure:
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 aGstVideo.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 signalingGstVideo.Navigation
changes.- classmethod event_get_coordinates(event)[source]¶
- Parameters:
- Returns:
A boolean indicating success.
- Return type:
Try to retrieve x and y coordinates of a
GstVideo.Navigation
event.New in version 1.22.
- classmethod event_get_type(event)[source]¶
- Parameters:
- Return type:
Inspect a
Gst.Event
and return theGstVideo.NavigationEventType
of the event, orGstVideo.NavigationEventType.INVALID
if the event is not aGstVideo.Navigation
event.
- classmethod event_new_command(command)[source]¶
- Parameters:
command (
GstVideo.NavigationCommand
) – The navigation command to use.- Returns:
a new
Gst.Event
- Return type:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
Create a new navigation event for a removed touch point.
New in version 1.22.
- classmethod event_parse_command(event)[source]¶
- Parameters:
- Returns:
True
if the navigation command could be extracted, otherwiseFalse
.- 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:
- 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:
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:
state (
GstVideo.NavigationModifierType
) – a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt).
- Returns:
True
if the event is aGstVideo.Navigation
event with associated modifiers state, otherwiseFalse
.- Return type:
New in version 1.22.
- classmethod event_parse_mouse_button_event(event)[source]¶
- Parameters:
- Returns:
True
if the button number and both coordinates could be extracted, otherwiseFalse
.- Return type:
Retrieve the details of either a
GstVideo.Navigation
mouse button press event or a mouse button release event. Determine which type the event is usingGstVideo.Navigation.event_get_type
() to retrieve theGstVideo.NavigationEventType
.
- classmethod event_parse_mouse_move_event(event)[source]¶
-
Inspect a
GstVideo.Navigation
mouse movement event and extract the coordinates of the event.
- classmethod event_parse_mouse_scroll_event(event)[source]¶
- Parameters:
- Returns:
True
if all coordinates could be extracted, otherwiseFalse
.- 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:
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:
- Returns:
True
if all details could be extracted, otherwiseFalse
.- 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 usingGstVideo.Navigation.event_get_type
() to retrieve theGstVideo.NavigationEventType
.New in version 1.22.
- classmethod event_parse_touch_up_event(event)[source]¶
- Parameters:
- Returns:
- Return type:
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:
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
) – AGst.Message
to inspect.- Returns:
The type of the
Gst.Message
, orGstVideo.NavigationMessageType.INVALID
if the message is not aGstVideo.Navigation
notification.- Return type:
Check a bus message to see if it is a
GstVideo.Navigation
event, and return theGstVideo.NavigationMessageType
identifying the type of the message if so.
- classmethod message_new_angles_changed(src, cur_angle, n_angles)[source]¶
- Parameters:
src (
Gst.Object
) – AGst.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:
Creates a new
GstVideo.Navigation
message with typeGstVideo.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
) – AGst.Object
to set as source of the new message.- Returns:
The new
Gst.Message
.- Return type:
Creates a new
GstVideo.Navigation
message with typeGstVideo.NavigationMessageType.COMMANDS_CHANGED
- classmethod message_new_event(src, event)[source]¶
- Parameters:
src (
Gst.Object
) – AGst.Object
to set as source of the new message.
- Returns:
The new
Gst.Message
.- Return type:
Creates a new
GstVideo.Navigation
message with typeGstVideo.NavigationMessageType.EVENT
.New in version 1.6.
- classmethod message_new_mouse_over(src, active)[source]¶
- Parameters:
src (
Gst.Object
) – AGst.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:
Creates a new
GstVideo.Navigation
message with typeGstVideo.NavigationMessageType.MOUSE_OVER
.
- classmethod message_parse_angles_changed(message)[source]¶
- Parameters:
message (
Gst.Message
) – AGst.Message
to inspect.- Returns:
True
if the message could be successfully parsed.False
if not.- Return type:
Parse a
GstVideo.Navigation
message of typeGstVideo.NavigationMessageType.ANGLES_CHANGED
and extract the cur_angle and n_angles parameters.
- classmethod message_parse_event(message)[source]¶
- Parameters:
message (
Gst.Message
) – AGst.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:
Parse a
GstVideo.Navigation
message of typeGstVideo.NavigationMessageType.EVENT
and extract containedGst.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
) – AGst.Message
to inspect.- Returns:
True
if the message could be successfully parsed.False
if not.- Return type:
Parse a
GstVideo.Navigation
message of typeGstVideo.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, orGstVideo.NavigationQueryType.INVALID
- Return type:
Inspect a
Gst.Query
and return theGstVideo.NavigationQueryType
associated with it if it is aGstVideo.Navigation
query.
- classmethod query_new_angles()[source]¶
- Returns:
The new query.
- Return type:
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:
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]¶
-
Parse the current angle number in the
GstVideo.Navigation
angles query into theint
pointed to by the cur_angle variable, and the number of available angles into theint
pointed to by the n_angles variable.
- classmethod query_parse_commands_length(query)[source]¶
- Parameters:
- Returns:
True
if the query could be successfully parsed.False
if not.- n_cmds:
the number of commands in this query.
- Return type:
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 toGstVideo.NavigationCommand.INVALID
.
- classmethod query_set_angles(query, cur_angle, n_angles)[source]¶
- Parameters:
Set the
GstVideo.Navigation
angles query result field in query.
- classmethod query_set_commandsv(query, cmds)[source]¶
- Parameters:
cmds ([
GstVideo.NavigationCommand
]) – An array containing n_cmds GstNavigationCommand values.
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_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:
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.