mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-15 13:45:28 +00:00
webrtcsink: turn NavigationEventHandler into a tuple wrapper
More elegant way of not bumping into the unused fields warning than prefixing with _
This commit is contained in:
parent
983fcf2fbd
commit
b80cf1fb8e
1 changed files with 5 additions and 8 deletions
|
@ -214,10 +214,7 @@ struct PipelineWrapper(gst::Pipeline);
|
|||
|
||||
// Structure to generate GstNavigation event from a WebRTCDataChannel
|
||||
#[derive(Debug)]
|
||||
struct NavigationEventHandler {
|
||||
_channel: WebRTCDataChannel,
|
||||
_message_sig: glib::SignalHandlerId,
|
||||
}
|
||||
struct NavigationEventHandler((glib::SignalHandlerId, WebRTCDataChannel));
|
||||
|
||||
/// Our instance structure
|
||||
#[derive(Default)]
|
||||
|
@ -1244,8 +1241,8 @@ impl NavigationEventHandler {
|
|||
);
|
||||
|
||||
let weak_element = element.downgrade();
|
||||
Self {
|
||||
_message_sig: channel.connect("on-message-string", false, move |values| {
|
||||
Self((
|
||||
channel.connect("on-message-string", false, move |values| {
|
||||
if let Some(element) = weak_element.upgrade() {
|
||||
let _channel = values[0].get::<WebRTCDataChannel>().unwrap();
|
||||
let msg = values[1].get::<&str>().unwrap();
|
||||
|
@ -1254,8 +1251,8 @@ impl NavigationEventHandler {
|
|||
|
||||
None
|
||||
}),
|
||||
_channel: channel,
|
||||
}
|
||||
channel,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue