1个不稳定版本
0.1.0 | 2024年8月5日 |
---|
#487 in 视频
116 每月下载量
用于 libobs-sources
15KB
216 代码行
libOBS源宏
这是libOBS sources crate的辅助宏。
用法
这是window_capture源的一个示例
#[obs_source_builder("window_capture")]
pub struct WindowCaptureSourceBuilder {
#[obs_property(type_t = "enum")]
capture_method: ObsWindowCaptureMethod,
// This attribute has to be on each field that should change any obs data setting.
// notice the `settings_key` attribute, which sets the key that should be used when setting obs data (so data.set_string("window", 'your_window') would be called). Otherwise defaults to the field name.
// The `type_t` attribute is the type that should be used in the obs data. This is used to generate the correct obs data setter.
// Can be enum,enum_string,int,bool,string
#[obs_property(type_t = "string", settings_key = "window")]
window_raw: String,
#[obs_property(type_t = "bool")]
cursor: bool,
}
更多示例请查看libOBS sources crate.
依赖项
~0.4–0.9MB
~19K SLoC