libobs_simple\sources\linux\sources/
x11_capture.rs1use libobs_wrapper::{
2 data::StringEnum,
3 sources::{ObsSourceBuilder, ObsSourceRef},
4};
5
6use crate::sources::macro_helper::define_object_manager;
7
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum ObsX11ServerType {
11 Local,
13 Custom,
15}
16
17impl StringEnum for ObsX11ServerType {
18 fn to_str(&self) -> &str {
19 match self {
20 ObsX11ServerType::Local => "local",
21 ObsX11ServerType::Custom => "custom",
22 }
23 }
24}
25
26define_object_manager!(
27 #[derive(Debug)]
28 struct X11CaptureSource("xshm_input") for ObsSourceRef {
33 #[obs_property(type_t = "int")]
35 screen: i64,
36
37 #[obs_property(type_t = "bool")]
39 show_cursor: bool,
40
41 #[obs_property(type_t = "bool")]
43 advanced: bool,
44
45 #[obs_property(type_t = "string")]
47 server: String,
48
49 #[obs_property(type_t = "int")]
51 cut_top: i64,
52
53 #[obs_property(type_t = "int")]
55 cut_left: i64,
56
57 #[obs_property(type_t = "int")]
59 cut_right: i64,
60
61 #[obs_property(type_t = "int")]
63 cut_bot: i64,
64 }
65);
66
67impl ObsSourceBuilder for X11CaptureSourceBuilder {}