GStreamer Base Plugins 0.10 Library Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <gst/interfaces/navigation.h> GstNavigation; struct GstNavigationInterface; enum GstNavigationCommand; enum GstNavigationEventType; enum GstNavigationMessageType; enum GstNavigationQueryType; void gst_navigation_send_event (GstNavigation *navigation
,GstStructure *structure
); void gst_navigation_send_key_event (GstNavigation *navigation
,const char *event
,const char *key
); void gst_navigation_send_mouse_event (GstNavigation *navigation
,const char *event
,int button
,double x
,double y
); void gst_navigation_send_command (GstNavigation *navigation
,GstNavigationCommand command
); gboolean gst_navigation_event_parse_command (GstEvent *event
,GstNavigationCommand *command
); gboolean gst_navigation_event_parse_key_event (GstEvent *event
,const gchar **key
); gboolean gst_navigation_event_parse_mouse_button_event (GstEvent *event
,gint *button
,gdouble *x
,gdouble *y
); gboolean gst_navigation_event_parse_mouse_move_event (GstEvent *event
,gdouble *x
,gdouble *y
); GstNavigationMessageType gst_navigation_message_get_type (GstMessage *message
); GstMessage * gst_navigation_message_new_angles_changed (GstObject *src
,guint cur_angle
,guint n_angles
); GstMessage * gst_navigation_message_new_commands_changed (GstObject *src
); GstMessage * gst_navigation_message_new_mouse_over (GstObject *src
,gboolean active
); gboolean gst_navigation_message_parse_mouse_over (GstMessage *message
,gboolean *active
); gboolean gst_navigation_message_parse_angles_changed (GstMessage *message
,guint *cur_angle
,guint *n_angles
); GstQuery * gst_navigation_query_new_angles (void
); GstNavigationQueryType gst_navigation_query_get_type (GstQuery *query
); GstQuery * gst_navigation_query_new_commands (void
); gboolean gst_navigation_query_parse_angles (GstQuery *query
,guint *cur_angle
,guint *n_angles
); gboolean gst_navigation_query_parse_commands_length (GstQuery *query
,guint *n_cmds
); gboolean gst_navigation_query_parse_commands_nth (GstQuery *query
,guint nth
,GstNavigationCommand *cmd
); void gst_navigation_query_set_angles (GstQuery *query
,guint cur_angle
,guint n_angles
); void gst_navigation_query_set_commands (GstQuery *query
,gint n_cmds
,...
); void gst_navigation_query_set_commandsv (GstQuery *query
,gint n_cmds
,GstNavigationCommand *cmds
); #define GST_NAVIGATION_COMMAND_DVD_ANGLE_MENU #define GST_NAVIGATION_COMMAND_DVD_AUDIO_MENU #define GST_NAVIGATION_COMMAND_DVD_CHAPTER_MENU #define GST_NAVIGATION_COMMAND_DVD_MENU #define GST_NAVIGATION_COMMAND_DVD_ROOT_MENU #define GST_NAVIGATION_COMMAND_DVD_SUBPICTURE_MENU #define GST_NAVIGATION_COMMAND_DVD_TITLE_MENU
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 signalling GstNavigation changes.
struct GstNavigationInterface { GTypeInterface g_iface; /* virtual functions */ void (*send_event) (GstNavigation *navigation, GstStructure *structure); gpointer _gst_reserved[GST_PADDING]; };
typedef enum { GST_NAVIGATION_COMMAND_INVALID = 0, GST_NAVIGATION_COMMAND_MENU1 = 1, GST_NAVIGATION_COMMAND_MENU2 = 2, GST_NAVIGATION_COMMAND_MENU3 = 3, GST_NAVIGATION_COMMAND_MENU4 = 4, GST_NAVIGATION_COMMAND_MENU5 = 5, GST_NAVIGATION_COMMAND_MENU6 = 6, GST_NAVIGATION_COMMAND_MENU7 = 7, GST_NAVIGATION_COMMAND_LEFT = 20, GST_NAVIGATION_COMMAND_RIGHT = 21, GST_NAVIGATION_COMMAND_UP = 22, GST_NAVIGATION_COMMAND_DOWN = 23, GST_NAVIGATION_COMMAND_ACTIVATE = 24, GST_NAVIGATION_COMMAND_PREV_ANGLE = 30, GST_NAVIGATION_COMMAND_NEXT_ANGLE = 31 } GstNavigationCommand;
A set of commands that may be issued to an element providing the
GstNavigation interface. The available commands can be queried via
the gst_navigation_query_new_commands()
query.
For convenience in handling DVD navigation, the MENU commands are aliased as:
GST_NAVIGATION_COMMAND_DVD_MENU = GST_NAVIGATION_COMMAND_MENU1
GST_NAVIGATION_COMMAND_DVD_TITLE_MENU = GST_NAVIGATION_COMMAND_MENU2
GST_NAVIGATION_COMMAND_DVD_ROOT_MENU = GST_NAVIGATION_COMMAND_MENU3
GST_NAVIGATION_COMMAND_DVD_SUBPICTURE_MENU = GST_NAVIGATION_COMMAND_MENU4
GST_NAVIGATION_COMMAND_DVD_AUDIO_MENU = GST_NAVIGATION_COMMAND_MENU5
GST_NAVIGATION_COMMAND_DVD_ANGLE_MENU = GST_NAVIGATION_COMMAND_MENU6
GST_NAVIGATION_COMMAND_DVD_CHAPTER_MENU = GST_NAVIGATION_COMMAND_MENU7
An invalid command entry | |
Execute navigation menu command 1. For DVD, this enters the DVD root menu, or exits back to the title from the menu. | |
Execute navigation menu command 2. For DVD, this jumps to the DVD title menu. | |
Execute navigation menu command 3. For DVD, this jumps into the DVD root menu. | |
Execute navigation menu command 4. For DVD, this jumps to the Subpicture menu. | |
Execute navigation menu command 5. For DVD, the jumps to the audio menu. | |
Execute navigation menu command 6. For DVD, this jumps to the angles menu. | |
Execute navigation menu command 7. For DVD, this jumps to the chapter menu. | |
Select the next button to the left in a menu, if such a button exists. | |
Select the next button to the right in a menu, if such a button exists. | |
Select the button above the current one in a menu, if such a button exists. | |
Select the button below the current one in a menu, if such a button exists. | |
Activate (click) the currently selected button in a menu, if such a button exists. | |
Switch to the previous angle in a multiangle feature. | |
Switch to the next angle in a multiangle feature. |
Since 0.10.23
typedef enum { GST_NAVIGATION_EVENT_INVALID = 0, GST_NAVIGATION_EVENT_KEY_PRESS = 1, GST_NAVIGATION_EVENT_KEY_RELEASE = 2, GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS = 3, GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE = 4, GST_NAVIGATION_EVENT_MOUSE_MOVE = 5, GST_NAVIGATION_EVENT_COMMAND = 6 } GstNavigationEventType;
Enum values for the various events that an element implementing the GstNavigation interface might send up the pipeline.
Returned from
gst_navigation_event_get_type() when the passed event is not a navigation event.
|
|
A key press event. Use
gst_navigation_event_parse_key_event() to extract the details from the event.
|
|
A key release event. Use
gst_navigation_event_parse_key_event() to extract the details from the event.
|
|
A mouse button press event. Use
gst_navigation_event_parse_mouse_button_event() to extract the details from the
event.
|
|
A mouse button release event. Use
gst_navigation_event_parse_mouse_button_event() to extract the details from the
event.
|
|
A mouse movement event. Use
gst_navigation_event_parse_mouse_move_event() to extract the details from the
event.
|
|
A navigation command event. Use
gst_navigation_event_parse_command() to extract the details from the event.
|
Since 0.10.23
typedef enum { GST_NAVIGATION_MESSAGE_INVALID, GST_NAVIGATION_MESSAGE_MOUSE_OVER, GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED, GST_NAVIGATION_MESSAGE_ANGLES_CHANGED } GstNavigationMessageType;
A set of notifications that may be received on the bus when navigation related status changes.
Returned from
gst_navigation_message_get_type() when the passed message is not a
navigation message.
|
|
Sent when the mouse moves over or leaves a clickable region of the output, such as a DVD menu button. | |
Sent when the set of available commands changes and should re-queried by interested applications. | |
Sent when display angles in a multi-angle feature (such as a multiangle DVD) change - either angles have appeared or disappeared. |
Since 0.10.23
typedef enum { GST_NAVIGATION_QUERY_INVALID = 0, GST_NAVIGATION_QUERY_COMMANDS = 1, GST_NAVIGATION_QUERY_ANGLES = 2 } GstNavigationQueryType;
void gst_navigation_send_event (GstNavigation *navigation
,GstStructure *structure
);
void gst_navigation_send_key_event (GstNavigation *navigation
,const char *event
,const char *key
);
|
The navigation interface instance |
|
The type of the key event. Recognised values are "key-press" and "key-release" |
|
Character representation of the key. This is typically as produced by XKeysymToString. |
void gst_navigation_send_mouse_event (GstNavigation *navigation
,const char *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.
|
The navigation interface instance |
|
The type of mouse event, as a text string. Recognised values are "mouse-button-press", "mouse-button-release" and "mouse-move". |
|
The button number of the button being pressed or released. Pass 0 for mouse-move events. |
|
The x coordinate of the mouse event. |
|
The y coordinate of the mouse event. |
void gst_navigation_send_command (GstNavigation *navigation
,GstNavigationCommand command
);
Sends the indicated command to the navigation interface.
|
The navigation interface instance |
|
The command to issue |
Since 0.10.23
gboolean gst_navigation_event_parse_command (GstEvent *event
,GstNavigationCommand *command
);
Inspect a GstNavigation command event and retrieve the enum value of the associated command.
|
A GstEvent to inspect. |
|
Pointer to GstNavigationCommand to receive the type of the navigation event. |
Returns : |
TRUE if the navigation command could be extracted, otherwise FALSE. |
Since 0.10.23
gboolean gst_navigation_event_parse_key_event (GstEvent *event
,const gchar **key
);
|
A GstEvent to inspect. |
|
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. |
Since 0.10.23
gboolean gst_navigation_event_parse_mouse_button_event (GstEvent *event
,gint *button
,gdouble *x
,gdouble *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
gst_navigation_event_get_type()
to retrieve the GstNavigationEventType.
|
A GstEvent to inspect. |
|
Pointer to a gint that will receive the button number associated with the event. |
|
Pointer to a gdouble to receive the x coordinate of the mouse button event. |
|
Pointer to a gdouble to receive the y coordinate of the mouse button event. |
Returns : |
TRUE if the button number and both coordinates could be extracted, otherwise FALSE. |
Since 0.10.23
gboolean gst_navigation_event_parse_mouse_move_event (GstEvent *event
,gdouble *x
,gdouble *y
);
Inspect a GstNavigation mouse movement event and extract the coordinates of the event.
|
A GstEvent to inspect. |
|
Pointer to a gdouble to receive the x coordinate of the mouse movement. |
|
Pointer to a gdouble to receive the y coordinate of the mouse movement. |
Returns : |
TRUE if both coordinates could be extracted, otherwise FALSE. |
Since 0.10.23
GstNavigationMessageType gst_navigation_message_get_type
(GstMessage *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.
|
A GstMessage to inspect. |
Returns : |
The type of the GstNavigationMessage, or GST_NAVIGATION_MESSAGE_INVALID if the message is not a GstNavigation notification. |
Since 0.10.23
GstMessage * gst_navigation_message_new_angles_changed (GstObject *src
,guint cur_angle
,guint n_angles
);
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.
|
A GstObject to set as source of the new message. |
|
The currently selected angle. |
|
The number of viewing angles now available. |
Returns : |
The new GstMessage. |
Since 0.10.23
GstMessage * gst_navigation_message_new_commands_changed
(GstObject *src
);
Creates a new GstNavigation message with type GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED
|
A GstObject to set as source of the new message. |
Returns : |
The new GstMessage. |
Since 0.10.23
GstMessage * gst_navigation_message_new_mouse_over (GstObject *src
,gboolean active
);
Creates a new GstNavigation message with type GST_NAVIGATION_MESSAGE_MOUSE_OVER.
|
A GstObject to set as source of the new message. |
|
TRUE if the mouse has entered a clickable area of the display.
FALSE if it over a non-clickable area. |
Returns : |
The new GstMessage. |
Since 0.10.23
gboolean gst_navigation_message_parse_mouse_over (GstMessage *message
,gboolean *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.
|
A GstMessage to inspect. |
|
A pointer to a gboolean to receive the active/inactive state, or NULL. |
Returns : |
TRUE if the message could be successfully parsed. FALSE if not. |
Since 0.10.23
gboolean gst_navigation_message_parse_angles_changed (GstMessage *message
,guint *cur_angle
,guint *n_angles
);
Parse a GstNavigation message of type GST_NAVIGATION_MESSAGE_ANGLES_CHANGED
and extract the cur_angle
and n_angles
parameters.
|
A GstMessage to inspect. |
|
A pointer to a guint to receive the new current angle number, or NULL |
|
A pointer to a guint to receive the new angle count, or NULL. |
Returns : |
TRUE if the message could be successfully parsed. FALSE if not. |
Since 0.10.23
GstQuery * gst_navigation_query_new_angles (void
);
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.
Returns : |
The new query. |
Since 0.10.23
GstNavigationQueryType gst_navigation_query_get_type (GstQuery *query
);
Inspect a GstQuery and return the GstNavigationQueryType associated with it if it is a GstNavigation query.
|
The query to inspect |
Returns : |
The GstNavigationQueryType of the query, or GST_NAVIGATION_QUERY_INVALID |
Since 0.10.23
GstQuery * gst_navigation_query_new_commands (void
);
Create a new GstNavigation commands query. When executed, it will query the pipeline for the set of currently available commands.
Returns : |
The new query. |
Since 0.10.23
gboolean gst_navigation_query_parse_angles (GstQuery *query
,guint *cur_angle
,guint *n_angles
);
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.
|
a GstQuery |
|
Pointer to a guint into which to store the currently selected angle value from the query, or NULL |
|
Pointer to a guint into which to store the number of angles value from the query, or NULL |
Returns : |
TRUE if the query could be successfully parsed. FALSE if not. |
Since 0.10.23
gboolean gst_navigation_query_parse_commands_length (GstQuery *query
,guint *n_cmds
);
Parse the number of commands in the GstNavigation commands query
.
|
a GstQuery |
|
the number of commands in this query. |
Returns : |
TRUE if the query could be successfully parsed. FALSE if not. |
Since 0.10.23
gboolean gst_navigation_query_parse_commands_nth (GstQuery *query
,guint nth
,GstNavigationCommand *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.
|
a GstQuery |
|
the nth command to retrieve. |
|
a pointer to store the nth command into. |
Returns : |
TRUE if the query could be successfully parsed. FALSE if not. |
Since 0.10.23
void gst_navigation_query_set_angles (GstQuery *query
,guint cur_angle
,guint n_angles
);
Set the GstNavigation angles query result field in query
.
|
a GstQuery |
|
the current viewing angle to set. |
|
the number of viewing angles to set. |
Since 0.10.23
void gst_navigation_query_set_commands (GstQuery *query
,gint n_cmds
,...
);
Set the GstNavigation command query result fields in query
. The number
of commands passed must be equal to n_commands
.
|
a GstQuery |
|
the number of commands to set. |
|
A list of GstNavigationCommand values, n_cmds entries long. |
Since 0.10.23
void gst_navigation_query_set_commandsv (GstQuery *query
,gint n_cmds
,GstNavigationCommand *cmds
);
Set the GstNavigation command query result fields in query
. The number
of commands passed must be equal to n_commands
.
|
a GstQuery |
|
the number of commands to set. |
|
An array containing n_cmds GstNavigationCommand values. |
Since 0.10.23
#define GST_NAVIGATION_COMMAND_DVD_ANGLE_MENU GST_NAVIGATION_COMMAND_MENU6
#define GST_NAVIGATION_COMMAND_DVD_AUDIO_MENU GST_NAVIGATION_COMMAND_MENU5
#define GST_NAVIGATION_COMMAND_DVD_CHAPTER_MENU GST_NAVIGATION_COMMAND_MENU7
#define GST_NAVIGATION_COMMAND_DVD_MENU GST_NAVIGATION_COMMAND_MENU1
#define GST_NAVIGATION_COMMAND_DVD_ROOT_MENU GST_NAVIGATION_COMMAND_MENU3
#define GST_NAVIGATION_COMMAND_DVD_SUBPICTURE_MENU GST_NAVIGATION_COMMAND_MENU4