pub struct GameCaptureSourceBuilder { /* private fields */ }Expand description
A source to capture a game or fullscreen application.
Use GameCaptureSourceBuilder::get_windows to get a list of windows that can be captured (feature window-list needs to be enabled).
Requires OBS to be running with administrator privileges to capture certain games.
§Important Notice
This source fails to capture if another instance (OBS studio, another instance of your program, etc.) has a game capture source for the same game/application active.
If the window can be captured can be checked using GameCaptureSourceBuilder::is_window_in_use_by_other_instance (feature window-list needs to be enabled).
Implementations§
Source§impl GameCaptureSourceBuilder
impl GameCaptureSourceBuilder
Sourcepub fn set_capture_mode(self, capture_mode: ObsGameCaptureMode) -> Self
pub fn set_capture_mode(self, capture_mode: ObsGameCaptureMode) -> Self
Sets the capture mode for the game capture source. Look at doc for ObsGameCaptureMode
Sourcepub fn set_window_raw<T: Into<ObsString> + Sync + Send>(
self,
window_raw: T,
) -> Self
pub fn set_window_raw<T: Into<ObsString> + Sync + Send>( self, window_raw: T, ) -> Self
Sourcepub fn set_priority(self, priority: ObsWindowPriority) -> Self
pub fn set_priority(self, priority: ObsWindowPriority) -> Self
Window Match Priority
Sourcepub fn set_sli_compatability(self, sli_compatability: bool) -> Self
pub fn set_sli_compatability(self, sli_compatability: bool) -> Self
SLI/Crossfire Capture Mode (Slow)
Sourcepub fn set_capture_cursor(self, capture_cursor: bool) -> Self
pub fn set_capture_cursor(self, capture_cursor: bool) -> Self
Whether the cursor should be captured
Sourcepub fn set_allow_transparency(self, allow_transparency: bool) -> Self
pub fn set_allow_transparency(self, allow_transparency: bool) -> Self
If transparency of windows should be allowed
Sourcepub fn set_premultiplied_alpha(self, premultiplied_alpha: bool) -> Self
pub fn set_premultiplied_alpha(self, premultiplied_alpha: bool) -> Self
Premultiplied Alpha
Sourcepub fn set_limit_framerate(self, limit_framerate: bool) -> Self
pub fn set_limit_framerate(self, limit_framerate: bool) -> Self
Limit capture framerate
Sourcepub fn set_capture_overlays(self, capture_overlays: bool) -> Self
pub fn set_capture_overlays(self, capture_overlays: bool) -> Self
Capture third party overlays (such as steam overlays)
Sourcepub fn set_anti_cheat_hook(self, anti_cheat_hook: bool) -> Self
pub fn set_anti_cheat_hook(self, anti_cheat_hook: bool) -> Self
Use anti-cheat compatibility hook
Sourcepub fn set_hook_rate(self, hook_rate: ObsHookRate) -> Self
pub fn set_hook_rate(self, hook_rate: ObsHookRate) -> Self
Hook rate (Ranging from slow to fastest)
Sourcepub fn set_rgb10a2_space(self, rgb10a2_space: ObsGameCaptureRgbaSpace) -> Self
pub fn set_rgb10a2_space(self, rgb10a2_space: ObsGameCaptureRgbaSpace) -> Self
The color space to capture in
Source§impl GameCaptureSourceBuilder
impl GameCaptureSourceBuilder
Sourcepub fn get_windows(
mode: WindowSearchMode,
) -> Result<Vec<WindowInfo>, ObsSimpleError>
pub fn get_windows( mode: WindowSearchMode, ) -> Result<Vec<WindowInfo>, ObsSimpleError>
Gets a list of windows that can be captured by this source.
Sourcepub fn is_window_in_use_by_other_instance(window_pid: u32) -> Result<bool>
pub fn is_window_in_use_by_other_instance(window_pid: u32) -> Result<bool>
Checks if a window with the given process ID can be captured by this source. This does not guarantee that the window can be captured, only that it is not black