forked from mirrors/gstreamer-rs
webrtc: Generate DataChannel bindings
This commit is contained in:
parent
842959e1d8
commit
d216757c23
3 changed files with 39 additions and 0 deletions
|
@ -38,6 +38,8 @@ generate = [
|
|||
]
|
||||
|
||||
manual = [
|
||||
"GLib.Bytes",
|
||||
"GLib.Error",
|
||||
"GObject.Object",
|
||||
"Gst.Structure",
|
||||
"GstSdp.SDPMessage",
|
||||
|
@ -77,3 +79,13 @@ final_type = true
|
|||
name = "new"
|
||||
# takes ownership of SDP message
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "GstWebRTC.WebRTCDataChannel"
|
||||
status = "generate"
|
||||
final_type = true
|
||||
|
||||
[[object.function]]
|
||||
name = "on_error"
|
||||
# takes ownership of SDP message
|
||||
ignore = true
|
||||
|
|
|
@ -35,6 +35,8 @@ macro_rules! skip_assert_initialized {
|
|||
mod auto;
|
||||
pub use auto::*;
|
||||
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
mod web_rtc_data_channel;
|
||||
mod web_rtc_session_description;
|
||||
|
||||
// Re-export all the traits in a prelude module, so that applications
|
||||
|
|
25
gstreamer-webrtc/src/web_rtc_data_channel.rs
Normal file
25
gstreamer-webrtc/src/web_rtc_data_channel.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2020 Sebastian Dröge <sebastian@centricular.com>
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use glib::translate::*;
|
||||
use gst_web_rtc_sys;
|
||||
use WebRTCDataChannel;
|
||||
|
||||
use std::mem;
|
||||
|
||||
impl WebRTCDataChannel {
|
||||
pub fn on_error(&self, error: glib::Error) {
|
||||
let error = mem::ManuallyDrop::new(error);
|
||||
unsafe {
|
||||
gst_web_rtc_sys::gst_webrtc_data_channel_on_error(
|
||||
self.to_glib_none().0,
|
||||
mut_override(error.to_glib_none().0),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue