GstVideo.Navigation¶
- Implementations:
None
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
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.Navigationinterface, implemented by elements which provide an application with the ability to create and inject navigation events into the pipeline.GstVideo.Navigationevent handling API.GstVideo.Navigationevents are created in response to calls on aGstVideo.Navigationinterface implementation, and sent in the pipeline. Upstream elements can use the navigation event API functions to parse the contents of received messages.GstVideo.Navigationmessage handling API.GstVideo.Navigationmessages 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.Navigationmessage functions provide functions for creating and parsing custom bus messages for signalingGstVideo.Navigationchanges.- classmethod event_get_coordinates(event)[source]¶
- Parameters:
- Returns:
A boolean indicating success.
- Return type:
Try to retrieve x and y coordinates of a
GstVideo.Navigationevent.New in version 1.22.
- classmethod event_get_type(event)[source]¶
- Parameters:
- Return type:
Inspect a
Gst.Eventand return theGstVideo.NavigationEventTypeof the event, orGstVideo.NavigationEventType.INVALIDif the event is not aGstVideo.Navigationevent.
- 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_double_click(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 double click.
New in version 1.26.
- 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:
Trueif the navigation command could be extracted, otherwiseFalse.- command:
Pointer to
GstVideo.NavigationCommandto receive the type of the navigation event.
- Return type:
(
bool, command:GstVideo.NavigationCommand)
Inspect a
GstVideo.Navigationcommand 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:
Trueif the event is aGstVideo.Navigationevent with associated modifiers state, otherwiseFalse.- Return type:
New in version 1.22.
- classmethod event_parse_mouse_button_event(event)[source]¶
- Parameters:
- Returns:
Trueif the button number and both coordinates could be extracted, otherwiseFalse.- Return type:
Retrieve the details of either a
GstVideo.Navigationmouse 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.Navigationmouse movement event and extract the coordinates of the event.
- classmethod event_parse_mouse_scroll_event(event)[source]¶
- Parameters:
- Returns:
Trueif all coordinates could be extracted, otherwiseFalse.- x:
Pointer to a
floatto receive the x coordinate of the mouse movement.- y:
Pointer to a
floatto receive the y coordinate of the mouse movement.- delta_x:
Pointer to a
floatto receive the delta_x coordinate of the mouse movement.- delta_y:
Pointer to a
floatto receive the delta_y coordinate of the mouse movement.
- Return type:
Inspect a
GstVideo.Navigationmouse scroll event and extract the coordinates of the event.New in version 1.18.
- classmethod event_parse_touch_event(event)[source]¶
- Parameters:
- Returns:
Trueif all details could be extracted, otherwiseFalse.- identifier:
Pointer to a
intthat will receive the identifier unique to this touch point.- x:
Pointer to a
floatthat will receive the x coordinate of the touch event.- y:
Pointer to a
floatthat will receive the y coordinate of the touch event.- pressure:
Pointer to a
floatthat 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.Navigationtouch-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.Navigationtouch-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.Navigationevent. The event must be writable.New in version 1.22.
- classmethod message_get_type(message)[source]¶
- Parameters:
message (
Gst.Message) – AGst.Messageto inspect.- Returns:
The type of the
Gst.Message, orGstVideo.NavigationMessageType.INVALIDif the message is not aGstVideo.Navigationnotification.- Return type:
Check a bus message to see if it is a
GstVideo.Navigationevent, and return theGstVideo.NavigationMessageTypeidentifying the type of the message if so.
- classmethod message_new_angles_changed(src, cur_angle, n_angles)[source]¶
- Parameters:
src (
Gst.Object) – AGst.Objectto 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.Navigationmessage with typeGstVideo.NavigationMessageType.ANGLES_CHANGEDfor 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.Objectto set as source of the new message.- Returns:
The new
Gst.Message.- Return type:
Creates a new
GstVideo.Navigationmessage with typeGstVideo.NavigationMessageType.COMMANDS_CHANGED
- classmethod message_new_event(src, event)[source]¶
- Parameters:
src (
Gst.Object) – AGst.Objectto set as source of the new message.
- Returns:
The new
Gst.Message.- Return type:
Creates a new
GstVideo.Navigationmessage with typeGstVideo.NavigationMessageType.EVENT.New in version 1.6.
- classmethod message_new_mouse_over(src, active)[source]¶
- Parameters:
src (
Gst.Object) – AGst.Objectto set as source of the new message.active (
bool) –Trueif the mouse has entered a clickable area of the display.Falseif it over a non-clickable area.
- Returns:
The new
Gst.Message.- Return type:
Creates a new
GstVideo.Navigationmessage with typeGstVideo.NavigationMessageType.MOUSE_OVER.
- classmethod message_parse_angles_changed(message)[source]¶
- Parameters:
message (
Gst.Message) – AGst.Messageto inspect.- Returns:
Trueif the message could be successfully parsed.Falseif not.- Return type:
Parse a
GstVideo.Navigationmessage of typeGstVideo.NavigationMessageType.ANGLES_CHANGEDand extract the cur_angle and n_angles parameters.
- classmethod message_parse_event(message)[source]¶
- Parameters:
message (
Gst.Message) – AGst.Messageto inspect.- Returns:
Trueif the message could be successfully parsed.Falseif not.- event:
a pointer to a
Gst.Eventto receive the contained navigation event.
- Return type:
Parse a
GstVideo.Navigationmessage of typeGstVideo.NavigationMessageType.EVENTand 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.Messageto inspect.- Returns:
Trueif the message could be successfully parsed.Falseif not.- Return type:
Parse a
GstVideo.Navigationmessage of typeGstVideo.NavigationMessageType.MOUSE_OVERand 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.NavigationQueryTypeof the query, orGstVideo.NavigationQueryType.INVALID- Return type:
Inspect a
Gst.Queryand return theGstVideo.NavigationQueryTypeassociated with it if it is aGstVideo.Navigationquery.
- classmethod query_new_angles()[source]¶
- Returns:
The new query.
- Return type:
Create a new
GstVideo.Navigationangles 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.Navigationcommands 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.Navigationangles query into theintpointed to by the cur_angle variable, and the number of available angles into theintpointed to by the n_angles variable.
- classmethod query_parse_commands_length(query)[source]¶
- Parameters:
- Returns:
Trueif the query could be successfully parsed.Falseif not.- n_cmds:
the number of commands in this query.
- Return type:
Parse the number of commands in the
GstVideo.Navigationcommands query.
- classmethod query_parse_commands_nth(query, nth)[source]¶
- Parameters:
- Returns:
Trueif the query could be successfully parsed.Falseif not.- cmd:
a pointer to store the nth command into.
- Return type:
(
bool, cmd:GstVideo.NavigationCommand)
Parse the
GstVideo.Navigationcommand 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.Navigationangles 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.Navigationcommand 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”, “mouse-move” and “mouse-double-click”.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.Navigationinterface.
- 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.Navigationinterface.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.