libobs-sources 0.1.0

A helper crate to create sources for OBS
docs.rs failed to build libobs-sources-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

libOBS Sources

This crate makes it really easy to create new sources for OBS Studio using the libobs crate.

Example

// Set up the obs context and output here (see libobs-new crate for more info)

let (mut context, output) = initialize_obs(rec_file);
let output = context.get_output(&output).unwrap();

let windows =
    WindowCaptureSourceBuilder::get_windows(WindowSearchMode::ExcludeMinimized).unwrap();
let window = windows.into_iter().find(|w| {
    w.class
        .as_ref()
        .is_some_and(|e| e.to_lowercase().contains("notepad"))
})
.unwrap();

WindowCaptureSourceBuilder::new("test_capture")
    .set_window(&window)
    .add_to_output(output, 0)
    .unwrap();
// And the window capture source is added and captures the notepad window!