forge
Explore
Log in

Don't you dare go Hollow

srceencast: Send stream size

Browse files at this commit

05f2a3709b3447ac4d362980b166c3351a7129b2Ivan MolodetskikhParent: 743173e
Kooha requires this (even though it's optional). Unfortunately, Kooha
also seems to want memfd recording so it doesn't work anyway.
src/dbus/mutter_screen_cast.rsmodified+15 -1
@@ -7,10 +7,11 @@ use serde::Deserialize;
77 use smithay::output::Output;
88 use smithay::reexports::calloop;
99 use zbus::fdo::RequestNameFlags;
10-use zbus::zvariant::{DeserializeDict, OwnedObjectPath, Type, Value};
10+use zbus::zvariant::{DeserializeDict, OwnedObjectPath, SerializeDict, Type, Value};
1111 use zbus::{dbus_interface, fdo, InterfaceRef, ObjectServer, SignalContext};
1212
1313 use super::Start;
14+use crate::utils::output_size;
1415
1516 #[derive(Clone)]
1617 pub struct ScreenCast {
@@ -54,6 +55,13 @@ pub struct Stream {
5455 to_niri: calloop::channel::Sender<ScreenCastToNiri>,
5556 }
5657
58+#[derive(Debug, SerializeDict, Type, Value)]
59+#[zvariant(signature = "dict")]
60+struct StreamParameters {
61+ /// Size of the stream in logical coordinates.
62+ size: (i32, i32),
63+}
64+
5765 pub enum ScreenCastToNiri {
5866 StartCast {
5967 session_id: usize,
@@ -195,6 +203,12 @@ impl Stream {
195203 #[dbus_interface(signal)]
196204 pub async fn pipe_wire_stream_added(ctxt: &SignalContext<'_>, node_id: u32)
197205 -> zbus::Result<()>;
206+
207+ #[dbus_interface(property)]
208+ async fn parameters(&self) -> StreamParameters {
209+ let size = output_size(&self.output).into();
210+ StreamParameters { size }
211+ }
198212 }
199213
200214 impl ScreenCast {