224 lines
7.4 KiB
Rust
224 lines
7.4 KiB
Rust
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_Video_Control.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_interface_video_control.rs`, see https://github.com/diwic/dbus-rs
|
|
use dbus;
|
|
use dbus::arg;
|
|
use dbus::tree;
|
|
|
|
pub trait Call1ContentInterfaceVideoControl {
|
|
fn video_resolution(&self) -> Result<(u32, u32), tree::MethodErr>;
|
|
fn bitrate(&self) -> Result<u32, tree::MethodErr>;
|
|
fn framerate(&self) -> Result<u32, tree::MethodErr>;
|
|
fn mtu(&self) -> Result<u32, tree::MethodErr>;
|
|
fn manual_key_frames(&self) -> Result<bool, tree::MethodErr>;
|
|
}
|
|
|
|
pub fn call1_content_interface_video_control_server<F, T, D>(
|
|
factory: &tree::Factory<tree::MTFn<D>, D>,
|
|
data: D::Interface,
|
|
f: F,
|
|
) -> tree::Interface<tree::MTFn<D>, D>
|
|
where
|
|
D: tree::DataType,
|
|
D::Method: Default,
|
|
D::Property: Default,
|
|
D::Signal: Default,
|
|
T: AsRef<dyn Call1ContentInterfaceVideoControl>,
|
|
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
|
{
|
|
let i = factory.interface(
|
|
"org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl",
|
|
data,
|
|
);
|
|
let f = ::std::sync::Arc::new(f);
|
|
let p = factory.property::<(u32, u32), _>("VideoResolution", Default::default());
|
|
let p = p.access(tree::Access::Read);
|
|
let fclone = f.clone();
|
|
let p = p.on_get(move |a, pinfo| {
|
|
let minfo = pinfo.to_method_info();
|
|
let dd = fclone(&minfo);
|
|
let d = dd.as_ref();
|
|
a.append(d.video_resolution()?);
|
|
Ok(())
|
|
});
|
|
let i = i.add_p(p);
|
|
|
|
let p = factory.property::<u32, _>("Bitrate", Default::default());
|
|
let p = p.access(tree::Access::Read);
|
|
let fclone = f.clone();
|
|
let p = p.on_get(move |a, pinfo| {
|
|
let minfo = pinfo.to_method_info();
|
|
let dd = fclone(&minfo);
|
|
let d = dd.as_ref();
|
|
a.append(d.bitrate()?);
|
|
Ok(())
|
|
});
|
|
let i = i.add_p(p);
|
|
|
|
let p = factory.property::<u32, _>("Framerate", Default::default());
|
|
let p = p.access(tree::Access::Read);
|
|
let fclone = f.clone();
|
|
let p = p.on_get(move |a, pinfo| {
|
|
let minfo = pinfo.to_method_info();
|
|
let dd = fclone(&minfo);
|
|
let d = dd.as_ref();
|
|
a.append(d.framerate()?);
|
|
Ok(())
|
|
});
|
|
let i = i.add_p(p);
|
|
|
|
let p = factory.property::<u32, _>("MTU", Default::default());
|
|
let p = p.access(tree::Access::Read);
|
|
let fclone = f.clone();
|
|
let p = p.on_get(move |a, pinfo| {
|
|
let minfo = pinfo.to_method_info();
|
|
let dd = fclone(&minfo);
|
|
let d = dd.as_ref();
|
|
a.append(d.mtu()?);
|
|
Ok(())
|
|
});
|
|
let i = i.add_p(p);
|
|
|
|
let p = factory.property::<bool, _>("ManualKeyFrames", Default::default());
|
|
let p = p.access(tree::Access::Read);
|
|
let fclone = f.clone();
|
|
let p = p.on_get(move |a, pinfo| {
|
|
let minfo = pinfo.to_method_info();
|
|
let dd = fclone(&minfo);
|
|
let d = dd.as_ref();
|
|
a.append(d.manual_key_frames()?);
|
|
Ok(())
|
|
});
|
|
let i = i.add_p(p);
|
|
let s = factory.signal("KeyFrameRequested", Default::default());
|
|
let i = i.add_s(s);
|
|
let s = factory.signal("VideoResolutionChanged", Default::default());
|
|
let s = s.arg(("NewResolution", "(uu)"));
|
|
let i = i.add_s(s);
|
|
let s = factory.signal("BitrateChanged", Default::default());
|
|
let s = s.arg(("NewBitrate", "u"));
|
|
let i = i.add_s(s);
|
|
let s = factory.signal("FramerateChanged", Default::default());
|
|
let s = s.arg(("NewFramerate", "u"));
|
|
let i = i.add_s(s);
|
|
let s = factory.signal("MTUChanged", Default::default());
|
|
let s = s.arg(("NewMTU", "u"));
|
|
let i = i.add_s(s);
|
|
i
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Call1ContentInterfaceVideoControlKeyFrameRequested {}
|
|
|
|
impl arg::AppendAll for Call1ContentInterfaceVideoControlKeyFrameRequested {
|
|
fn append(&self, _: &mut arg::IterAppend) {}
|
|
}
|
|
|
|
impl arg::ReadAll for Call1ContentInterfaceVideoControlKeyFrameRequested {
|
|
fn read(_: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(Call1ContentInterfaceVideoControlKeyFrameRequested {})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for Call1ContentInterfaceVideoControlKeyFrameRequested {
|
|
const NAME: &'static str = "KeyFrameRequested";
|
|
const INTERFACE: &'static str =
|
|
"org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl";
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Call1ContentInterfaceVideoControlVideoResolutionChanged {
|
|
pub new_resolution: (u32, u32),
|
|
}
|
|
|
|
impl arg::AppendAll for Call1ContentInterfaceVideoControlVideoResolutionChanged {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.new_resolution, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for Call1ContentInterfaceVideoControlVideoResolutionChanged {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(Call1ContentInterfaceVideoControlVideoResolutionChanged {
|
|
new_resolution: i.read()?,
|
|
})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for Call1ContentInterfaceVideoControlVideoResolutionChanged {
|
|
const NAME: &'static str = "VideoResolutionChanged";
|
|
const INTERFACE: &'static str =
|
|
"org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl";
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Call1ContentInterfaceVideoControlBitrateChanged {
|
|
pub new_bitrate: u32,
|
|
}
|
|
|
|
impl arg::AppendAll for Call1ContentInterfaceVideoControlBitrateChanged {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.new_bitrate, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for Call1ContentInterfaceVideoControlBitrateChanged {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(Call1ContentInterfaceVideoControlBitrateChanged {
|
|
new_bitrate: i.read()?,
|
|
})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for Call1ContentInterfaceVideoControlBitrateChanged {
|
|
const NAME: &'static str = "BitrateChanged";
|
|
const INTERFACE: &'static str =
|
|
"org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl";
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Call1ContentInterfaceVideoControlFramerateChanged {
|
|
pub new_framerate: u32,
|
|
}
|
|
|
|
impl arg::AppendAll for Call1ContentInterfaceVideoControlFramerateChanged {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.new_framerate, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for Call1ContentInterfaceVideoControlFramerateChanged {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(Call1ContentInterfaceVideoControlFramerateChanged {
|
|
new_framerate: i.read()?,
|
|
})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for Call1ContentInterfaceVideoControlFramerateChanged {
|
|
const NAME: &'static str = "FramerateChanged";
|
|
const INTERFACE: &'static str =
|
|
"org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl";
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Call1ContentInterfaceVideoControlMTUChanged {
|
|
pub new_mtu: u32,
|
|
}
|
|
|
|
impl arg::AppendAll for Call1ContentInterfaceVideoControlMTUChanged {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.new_mtu, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for Call1ContentInterfaceVideoControlMTUChanged {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(Call1ContentInterfaceVideoControlMTUChanged { new_mtu: i.read()? })
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for Call1ContentInterfaceVideoControlMTUChanged {
|
|
const NAME: &'static str = "MTUChanged";
|
|
const INTERFACE: &'static str =
|
|
"org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl";
|
|
}
|