mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-28 20:41:31 +00:00
navigation: Add a method to get the GstStructure from NavigationEvent
The `GstNavigationInterface` requires to pass a GstStructure to it `send_event()` method, so it makes sense to allow getting that structure without building the navigation event itself
This commit is contained in:
parent
bbcd221e8d
commit
1dae136ae3
1 changed files with 9 additions and 4 deletions
|
@ -519,10 +519,9 @@ impl NavigationEvent {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn build(&self) -> gst::Event {
|
||||
pub fn structure(&self) -> gst::Structure {
|
||||
skip_assert_initialized!();
|
||||
|
||||
gst::event::Navigation::new(match self {
|
||||
match self {
|
||||
Self::MouseMove { x, y } => gst::Structure::builder(NAVIGATION_EVENT_NAME)
|
||||
.field("event", "mouse-move")
|
||||
.field("pointer_x", x)
|
||||
|
@ -570,7 +569,13 @@ impl NavigationEvent {
|
|||
.field("event", "command")
|
||||
.field("command-code", command)
|
||||
.build(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build(&self) -> gst::Event {
|
||||
skip_assert_initialized!();
|
||||
|
||||
gst::event::Navigation::new(self.structure())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue