pub struct GraphicsCaptureApi { /* private fields */ }Expand description
Manages a graphics capture session using the Windows Graphics Capture API.
Implementationsยง
Sourceยงimpl GraphicsCaptureApi
impl GraphicsCaptureApi
Sourcepub fn new<T: GraphicsCaptureApiHandler<Error = E> + Send + 'static, E: Send + Sync + 'static>(
d3d_device: ID3D11Device,
d3d_device_context: ID3D11DeviceContext,
item_with_details: GraphicsCaptureItemType,
callback: Arc<Mutex<T>>,
cursor_capture_settings: CursorCaptureSettings,
draw_border_settings: DrawBorderSettings,
secondary_window_settings: SecondaryWindowSettings,
minimum_update_interval_settings: MinimumUpdateIntervalSettings,
dirty_region_settings: DirtyRegionSettings,
color_format: ColorFormat,
thread_id: u32,
result: Arc<Mutex<Option<E>>>,
) -> Result<Self, Error>
pub fn new<T: GraphicsCaptureApiHandler<Error = E> + Send + 'static, E: Send + Sync + 'static>( d3d_device: ID3D11Device, d3d_device_context: ID3D11DeviceContext, item_with_details: GraphicsCaptureItemType, callback: Arc<Mutex<T>>, cursor_capture_settings: CursorCaptureSettings, draw_border_settings: DrawBorderSettings, secondary_window_settings: SecondaryWindowSettings, minimum_update_interval_settings: MinimumUpdateIntervalSettings, dirty_region_settings: DirtyRegionSettings, color_format: ColorFormat, thread_id: u32, result: Arc<Mutex<Option<E>>>, ) -> Result<Self, Error>
Constructs a new GraphicsCaptureApi instance.
For parameter details, see the type names in the signature; complex behavior is documented inline below where relevant.
Sourcepub fn start_capture(&mut self) -> Result<(), Error>
pub fn start_capture(&mut self) -> Result<(), Error>
Starts the capture.
ยงErrors
Error::AlreadyStartedwhen called more than onceError::WindowsErrorfor failures starting the capture session
Sourcepub fn stop_capture(self)
pub fn stop_capture(self)
Stops the capture session and cleans up resources.
Sourcepub fn halt_handle(&self) -> Arc<AtomicBool> โ
pub fn halt_handle(&self) -> Arc<AtomicBool> โ
Gets the halt handle.
ยงReturns
Returns an Arc<AtomicBool> that can be used to check if the capture is halted.
Sourcepub fn is_supported() -> Result<bool, Error>
pub fn is_supported() -> Result<bool, Error>
Checks if the Windows Graphics Capture API is supported.
Sourcepub fn is_cursor_settings_supported() -> Result<bool, Error>
pub fn is_cursor_settings_supported() -> Result<bool, Error>
Checks if the cursor capture settings can be changed.
Sourcepub fn is_border_settings_supported() -> Result<bool, Error>
pub fn is_border_settings_supported() -> Result<bool, Error>
Checks if the capture border settings can be changed.
Sourcepub fn is_secondary_windows_supported() -> Result<bool, Error>
pub fn is_secondary_windows_supported() -> Result<bool, Error>
Checks if capturing secondary windows is supported.
Sourcepub fn is_minimum_update_interval_supported() -> Result<bool, Error>
pub fn is_minimum_update_interval_supported() -> Result<bool, Error>
Checks if setting a minimum update interval is supported.
Sourcepub fn is_dirty_region_supported() -> Result<bool, Error>
pub fn is_dirty_region_supported() -> Result<bool, Error>
Checks if dirty region tracking is supported.
Trait Implementationsยง
Auto Trait Implementationsยง
impl Freeze for GraphicsCaptureApi
impl RefUnwindSafe for GraphicsCaptureApi
impl !Send for GraphicsCaptureApi
impl !Sync for GraphicsCaptureApi
impl Unpin for GraphicsCaptureApi
impl UnsafeUnpin for GraphicsCaptureApi
impl UnwindSafe for GraphicsCaptureApi
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more