libobs_sources\windows\sources/
capture.rs

1use num_derive::{FromPrimitive, ToPrimitive};
2
3#[repr(i32)]
4#[derive(Clone, Copy, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
5/// Describes the priority of the window capture source.
6/// Used in `WindowCaptureSourceBuilder`
7pub enum ObsWindowPriority {
8    /// The window class names must be the same. This means that windows are of the same type.
9    Class = libobs::window_priority_WINDOW_PRIORITY_CLASS,
10    /// Window titles must match otherwise, find window with the same class
11    Title = libobs::window_priority_WINDOW_PRIORITY_TITLE,
12    /// Match title, otherwise find window with the same executable
13    Executable = libobs::window_priority_WINDOW_PRIORITY_EXE,
14}
15
16#[repr(i32)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
18/// Describes the capture method of the window capture source.
19/// Used in `WindowCaptureSourceBuilder`
20pub enum ObsWindowCaptureMethod {
21    /// Automatically selects the best method based on the window.
22    MethodAuto = libobs::window_capture_method_METHOD_AUTO,
23    /// Uses BitBlt to capture the window. BitBlt (Windows 7 and up)
24    MethodBitBlt = libobs::window_capture_method_METHOD_BITBLT,
25    /// Uses Windows Graphics Capture to capture the window. Windows 10 (1903 and up)
26    MethodWgc = libobs::window_capture_method_METHOD_WGC,
27}
28
29
30#[repr(i32)]
31#[derive(Clone, Copy, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
32/// Describes the capture method of the monitor capture source.
33/// Used in `MonitorCaptureSourceBuilder`
34pub enum ObsDisplayCaptureMethod {
35    /// Automatically selects the best method based on the monitor.
36    MethodAuto = libobs::display_capture_method_DISPLAY_METHOD_AUTO,
37    /// Uses DXGI to capture the monitor.
38    MethodDXGI = libobs::display_capture_method_DISPLAY_METHOD_DXGI,
39    /// Uses Windows Graphics Capture to capture the monitor.
40    MethodWgc = libobs::display_capture_method_DISPLAY_METHOD_WGC,
41}
42
43
44#[repr(i32)]
45#[derive(Clone, Copy, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
46/// Describes the capture method of the window capture source.
47/// Used in `WindowCaptureSourceBuilder`
48pub enum ObsHookRate {
49    Slow = libobs::hook_rate_HOOK_RATE_SLOW,
50    Normal = libobs::hook_rate_HOOK_RATE_NORMAL,
51    Fast = libobs::hook_rate_HOOK_RATE_FAST,
52    Fastest = libobs::hook_rate_HOOK_RATE_FASTEST,
53}