pub struct StartupInfo { /* private fields */ }Expand description
Contains information to start a libobs context.
This is passed to the creation of ObsContext.
§Platform Notes
On Linux platforms, if your application uses a GUI
framework (like GTK, Qt, etc.), it is crucial to set
the appropriate NixDisplay in the StartupInfo if you want to create a preview window.
This ensures that libobs can correctly interface with
the display server (X11 or Wayland) used by your application.
If this is not set, libobs will not be able to create a preview window and the application will crash.
Implementations§
Source§impl StartupInfo
impl StartupInfo
pub fn new() -> StartupInfo
pub fn set_startup_paths(self, paths: StartupPaths) -> Self
pub fn set_video_info(self, ovi: ObsVideoInfo) -> Self
pub fn get_video_info(&self) -> &ObsVideoInfo
pub fn set_logger(self, logger: Box<dyn ObsLogger + Sync + Send>) -> Self
pub fn set_start_glib_loop(self, start: bool) -> Self
Sourcepub unsafe fn set_nix_display(self, display: NixDisplay) -> Self
pub unsafe fn set_nix_display(self, display: NixDisplay) -> Self
This sets the Nix display (X11 or Wayland) to use when starting libobs.
This is important if your application creates any preview windows using libobs on Linux. Otherwise if you don’t plan to use preview windows AND are not using a GUI framework, you can skip this.
Wayland requires this display to be the same as the one used by the GUI application (if you have one). Failing to set this may result in libobs being unable to create preview windows,
X11 however works without setting this display, in fact your window may become unresponsive if a display is set.
§Safety
Make sure that the display is closed AFTER the whole OBS context has been dropped!