//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "dispatch2")]
use dispatch2::*;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;
use crate::*;
/// SCStreamOutputTypeScreen is a screen capture sample buffer. This sample buffer that is wrapping a CMSampleBuffer that is backed by an IOSurface. The width and height of the sample buffer is what is defined in the SCStreamConfiguration for width and height. The sample buffer will be called back on the provided queue when adding a SCStreamOutput. The pixel format of the sample buffer will be what is defined in the SCStreamConfiguration. In the case of multiple window capture, the width and height will be that of the display passed in for the filter. The background color of multiwindow sample buffers will be default black and can be set through the SCStreamConfiguration.
///
///
///
/// SCStreamOutputTypeAudio is an audio capture sample buffer. This sample buffer that is wrapping an audio buffer list. The format of the audio buffer is based on sampleRate and channelCount set in SCStreamConfiguration.
/// SCStreamOutputTypeMicrophone is a microphone audio capture sample buffer. This sample buffer that is wrapping an audio buffer list. The format of the audio buffer is based on the selected microphone capture device's native format.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamoutputtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SCStreamOutputType(pub NSInteger);
impl SCStreamOutputType {
#[doc(alias = "SCStreamOutputTypeScreen")]
pub const Screen: Self = Self(0);
#[doc(alias = "SCStreamOutputTypeAudio")]
pub const Audio: Self = Self(1);
#[doc(alias = "SCStreamOutputTypeMicrophone")]
pub const Microphone: Self = Self(2);
}
unsafe impl Encode for SCStreamOutputType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SCStreamOutputType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// SCFrameStatus denotes the status of frame sample buffer.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scframestatus?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SCFrameStatus(pub NSInteger);
impl SCFrameStatus {
#[doc(alias = "SCFrameStatusComplete")]
pub const Complete: Self = Self(0);
#[doc(alias = "SCFrameStatusIdle")]
pub const Idle: Self = Self(1);
#[doc(alias = "SCFrameStatusBlank")]
pub const Blank: Self = Self(2);
#[doc(alias = "SCFrameStatusSuspended")]
pub const Suspended: Self = Self(3);
#[doc(alias = "SCFrameStatusStarted")]
pub const Started: Self = Self(4);
#[doc(alias = "SCFrameStatusStopped")]
pub const Stopped: Self = Self(5);
}
unsafe impl Encode for SCFrameStatus {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SCFrameStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// SCPresenterOverlayAlertSetting denotes the setting that can be set to determine when to show the presenter overlay alert for any stream
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scpresenteroverlayalertsetting?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SCPresenterOverlayAlertSetting(pub NSInteger);
impl SCPresenterOverlayAlertSetting {
#[doc(alias = "SCPresenterOverlayAlertSettingSystem")]
pub const System: Self = Self(0);
#[doc(alias = "SCPresenterOverlayAlertSettingNever")]
pub const Never: Self = Self(1);
#[doc(alias = "SCPresenterOverlayAlertSettingAlways")]
pub const Always: Self = Self(2);
}
unsafe impl Encode for SCPresenterOverlayAlertSetting {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SCPresenterOverlayAlertSetting {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// SCStreamTypeWindow window stream
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamtype?language=objc)
// NS_ENUM
#[deprecated = "Use SCShareableContentStyle instead"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SCStreamType(pub NSInteger);
impl SCStreamType {
#[doc(alias = "SCStreamTypeWindow")]
#[deprecated = "Use SCShareableContentStyle instead"]
pub const Window: Self = Self(0);
#[doc(alias = "SCStreamTypeDisplay")]
#[deprecated = "Use SCShareableContentStyle instead"]
pub const Display: Self = Self(1);
}
unsafe impl Encode for SCStreamType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SCStreamType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/sccaptureresolutiontype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SCCaptureResolutionType(pub NSInteger);
impl SCCaptureResolutionType {
#[doc(alias = "SCCaptureResolutionAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "SCCaptureResolutionBest")]
pub const Best: Self = Self(1);
#[doc(alias = "SCCaptureResolutionNominal")]
pub const Nominal: Self = Self(2);
}
unsafe impl Encode for SCCaptureResolutionType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SCCaptureResolutionType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// SCCaptureDynamicRange client can specify whether the captured screen output will be SDR or HDR. When SCCaptureDynamicRangeHDR is set, the output screen capture buffer pixel format and color space will be updated in order to support HDR.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/sccapturedynamicrange?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SCCaptureDynamicRange(pub NSInteger);
impl SCCaptureDynamicRange {
#[doc(alias = "SCCaptureDynamicRangeSDR")]
pub const SDR: Self = Self(0);
#[doc(alias = "SCCaptureDynamicRangeHDRLocalDisplay")]
pub const HDRLocalDisplay: Self = Self(1);
#[doc(alias = "SCCaptureDynamicRangeHDRCanonicalDisplay")]
pub const HDRCanonicalDisplay: Self = Self(2);
}
unsafe impl Encode for SCCaptureDynamicRange {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SCCaptureDynamicRange {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
/// SCContentFilter
///
/// SCContentFilter is a object that determines the exact content to be captured in the SCStream. It can be filtered through displays, windows, excluded windows or applications.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/sccontentfilter?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SCContentFilter;
);
extern_conformance!(
unsafe impl NSObjectProtocol for SCContentFilter {}
);
impl SCContentFilter {
extern_methods!(
/// streamType type of stream
#[deprecated = "Use style instead"]
#[unsafe(method(streamType))]
#[unsafe(method_family = none)]
pub unsafe fn streamType(&self) -> SCStreamType;
#[cfg(feature = "SCShareableContent")]
/// style of stream
#[unsafe(method(style))]
#[unsafe(method_family = none)]
pub unsafe fn style(&self) -> SCShareableContentStyle;
/// Pixel to points scaling factor
#[unsafe(method(pointPixelScale))]
#[unsafe(method_family = none)]
pub unsafe fn pointPixelScale(&self) -> c_float;
#[cfg(feature = "objc2-core-foundation")]
/// Size and location of content in points
#[unsafe(method(contentRect))]
#[unsafe(method_family = none)]
pub unsafe fn contentRect(&self) -> CGRect;
/// To include menu bar as part of the capture. This property has no effect for the desktop independent window filter. For content filters created with initWithDisplay:excluding, the default value is YES. Display excluding content filters contains the desktop and dock. For content filters created with initWithDisplay:including, the default value is NO. Display including content filters do not contain the desktop and dock
#[unsafe(method(includeMenuBar))]
#[unsafe(method_family = none)]
pub unsafe fn includeMenuBar(&self) -> bool;
/// Setter for [`includeMenuBar`][Self::includeMenuBar].
#[unsafe(method(setIncludeMenuBar:))]
#[unsafe(method_family = none)]
pub unsafe fn setIncludeMenuBar(&self, include_menu_bar: bool);
#[cfg(feature = "SCShareableContent")]
/// SCDisplays that are included in the content filter
#[unsafe(method(includedDisplays))]
#[unsafe(method_family = none)]
pub unsafe fn includedDisplays(&self) -> Retained<NSArray<SCDisplay>>;
#[cfg(feature = "SCShareableContent")]
/// Applications that are included in the content filter
#[unsafe(method(includedApplications))]
#[unsafe(method_family = none)]
pub unsafe fn includedApplications(&self) -> Retained<NSArray<SCRunningApplication>>;
#[cfg(feature = "SCShareableContent")]
/// Windows that are included in the content filter
#[unsafe(method(includedWindows))]
#[unsafe(method_family = none)]
pub unsafe fn includedWindows(&self) -> Retained<NSArray<SCWindow>>;
#[cfg(feature = "SCShareableContent")]
/// initWithDesktopIndependentWindow:
///
/// Parameter `window`: the independent SCWindow you wish to capture
///
/// this method will create a SCContentFilter that captures just the independent window passed in.
#[unsafe(method(initWithDesktopIndependentWindow:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDesktopIndependentWindow(
this: Allocated<Self>,
window: &SCWindow,
) -> Retained<Self>;
#[cfg(feature = "SCShareableContent")]
/// initWithDisplay:excludingWindows
///
/// Parameter `display`: the SCDisplay you wish to capture
///
/// Parameter `excluded`: the SCWindow(s) you wish to exclude from the passed in SCDisplay
///
/// This method will create a SCContentFilter that captures the SCDisplay, excluding the passed in excluded SCWindow(s). The desktop background and dock will be included with this content filter.
#[unsafe(method(initWithDisplay:excludingWindows:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDisplay_excludingWindows(
this: Allocated<Self>,
display: &SCDisplay,
excluded: &NSArray<SCWindow>,
) -> Retained<Self>;
#[cfg(feature = "SCShareableContent")]
/// initWithDisplay:includingWindows
///
/// Parameter `display`: the SCDisplay you wish to capture
///
/// Parameter `includedWindows`: a set of SCWindows you wish to capture
///
/// This method will create a SCContentFilter that captures a group of SCWindows. The desktop background and dock will be excluded with this content filter.
#[unsafe(method(initWithDisplay:includingWindows:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDisplay_includingWindows(
this: Allocated<Self>,
display: &SCDisplay,
included_windows: &NSArray<SCWindow>,
) -> Retained<Self>;
#[cfg(feature = "SCShareableContent")]
/// initWithDisplay:includingApplications:exceptingWindows
///
/// Parameter `display`: the SCDisplay you wish to capture
///
/// Parameter `applications`: the NSSet of SCRunningApplications that you wish to capture
///
/// Parameter `exceptingWindows`: the NSSet of SCWindows that you wish to be an exception to the filter
///
/// This method creates a SCContentFilter that captures all windows owned by the passed in SCRunningApplications. Any windows that are an exception to the filter will not be shown if their owning application is in the provided list and will be shown otherwise. The desktop background and dock will be excluded with this content filter.
#[unsafe(method(initWithDisplay:includingApplications:exceptingWindows:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDisplay_includingApplications_exceptingWindows(
this: Allocated<Self>,
display: &SCDisplay,
applications: &NSArray<SCRunningApplication>,
excepting_windows: &NSArray<SCWindow>,
) -> Retained<Self>;
#[cfg(feature = "SCShareableContent")]
/// initWithDisplay:excludingApplications:exceptingWindows
///
/// Parameter `display`: the SCDisplay you wish to capture
///
/// Parameter `applications`: the NSSet of SCRunningApplications that you do not wish to capture
///
/// Parameter `exceptingWindows`: the NSSet of SCWindows that you wish to be an exception to the filter
///
/// This method creates a SCContentFilter that captures all windows not owned by the passed in SCRunningApplications. Any windows that are an exception to the filter will be shown if their owning application is in the provided list and will not be shown otherwise. The desktop background and dock will be included with this content filter.
#[unsafe(method(initWithDisplay:excludingApplications:exceptingWindows:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDisplay_excludingApplications_exceptingWindows(
this: Allocated<Self>,
display: &SCDisplay,
applications: &NSArray<SCRunningApplication>,
excepting_windows: &NSArray<SCWindow>,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl SCContentFilter {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
/// Client can use SCStreamConfigurationPreset to create SCStreamConfiguration with suggested values of properties for various use cases
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamconfigurationpreset?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SCStreamConfigurationPreset(pub NSInteger);
impl SCStreamConfigurationPreset {
#[doc(alias = "SCStreamConfigurationPresetCaptureHDRStreamLocalDisplay")]
pub const CaptureHDRStreamLocalDisplay: Self = Self(0);
#[doc(alias = "SCStreamConfigurationPresetCaptureHDRStreamCanonicalDisplay")]
pub const CaptureHDRStreamCanonicalDisplay: Self = Self(1);
#[doc(alias = "SCStreamConfigurationPresetCaptureHDRScreenshotLocalDisplay")]
pub const CaptureHDRScreenshotLocalDisplay: Self = Self(2);
#[doc(alias = "SCStreamConfigurationPresetCaptureHDRScreenshotCanonicalDisplay")]
pub const CaptureHDRScreenshotCanonicalDisplay: Self = Self(3);
#[doc(alias = "SCStreamConfigurationPresetCaptureHDRRecordingPreservedSDRHDR10")]
pub const CaptureHDRRecordingPreservedSDRHDR10: Self = Self(4);
}
unsafe impl Encode for SCStreamConfigurationPreset {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SCStreamConfigurationPreset {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
/// SCStreamConfiguration
///
/// SCStreamConfiguration is an object that encapsulates the SCStream properties such as output width, height, pixelformat and others.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamconfiguration?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SCStreamConfiguration;
);
extern_conformance!(
unsafe impl NSObjectProtocol for SCStreamConfiguration {}
);
impl SCStreamConfiguration {
extern_methods!(
/// SCStreamProperty for output width as measured in pixels. Default is set to 1920.
#[unsafe(method(width))]
#[unsafe(method_family = none)]
pub unsafe fn width(&self) -> usize;
/// Setter for [`width`][Self::width].
#[unsafe(method(setWidth:))]
#[unsafe(method_family = none)]
pub unsafe fn setWidth(&self, width: usize);
/// SCStreamProperty for output height as measured in pixels. Default is set to 1080.
#[unsafe(method(height))]
#[unsafe(method_family = none)]
pub unsafe fn height(&self) -> usize;
/// Setter for [`height`][Self::height].
#[unsafe(method(setHeight:))]
#[unsafe(method_family = none)]
pub unsafe fn setHeight(&self, height: usize);
#[cfg(feature = "objc2-core-media")]
/// SCStreamProperty that specifies the desired minimum time in seconds between frame updates, allowing you to throttle the rate at which updates are received. The default value is 1/60, meaning that updates are coming in at or up to 60fps. Set this to kCMTimeZero to capture at display's native refresh rate.
#[unsafe(method(minimumFrameInterval))]
#[unsafe(method_family = none)]
pub unsafe fn minimumFrameInterval(&self) -> CMTime;
#[cfg(feature = "objc2-core-media")]
/// Setter for [`minimumFrameInterval`][Self::minimumFrameInterval].
#[unsafe(method(setMinimumFrameInterval:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinimumFrameInterval(&self, minimum_frame_interval: CMTime);
/// SCStreamProperty for output pixel format. Supported pixel formats are:
/// 'BGRA': Packed Little Endian ARGB8888
/// 'l10r': Packed Little Endian ARGB2101010
/// '420v': 2-plane "video" range YCbCr 4:2:0
/// '420f': 2-plane "full" range YCbCr 4:2:0
/// 'xf44': 2 plane "full" range YCbCr10 4:4:4
/// 'RGhA': 64 bit RGBA IEEE half-precision float, 16-bit little-endian
/// See https://developer.apple.com/documentation/coregraphics/1455170-cgdisplaystreamcreate
#[unsafe(method(pixelFormat))]
#[unsafe(method_family = none)]
pub unsafe fn pixelFormat(&self) -> OSType;
/// Setter for [`pixelFormat`][Self::pixelFormat].
#[unsafe(method(setPixelFormat:))]
#[unsafe(method_family = none)]
pub unsafe fn setPixelFormat(&self, pixel_format: OSType);
/// SCStreamProperty for output to be always scaled to fit into the provided width and height. For use for independent window capture. When true, the output scales up and down. When false, the output only scales down.
#[unsafe(method(scalesToFit))]
#[unsafe(method_family = none)]
pub unsafe fn scalesToFit(&self) -> bool;
/// Setter for [`scalesToFit`][Self::scalesToFit].
#[unsafe(method(setScalesToFit:))]
#[unsafe(method_family = none)]
pub unsafe fn setScalesToFit(&self, scales_to_fit: bool);
/// SCStreamProperty that specifies whether the stream preserves the aspect ratio of the source pixel data. By default the aspect ratio is preserved.
#[unsafe(method(preservesAspectRatio))]
#[unsafe(method_family = none)]
pub unsafe fn preservesAspectRatio(&self) -> bool;
/// Setter for [`preservesAspectRatio`][Self::preservesAspectRatio].
#[unsafe(method(setPreservesAspectRatio:))]
#[unsafe(method_family = none)]
pub unsafe fn setPreservesAspectRatio(&self, preserves_aspect_ratio: bool);
/// SCStreamProperty the name of the stream
#[unsafe(method(streamName))]
#[unsafe(method_family = none)]
pub unsafe fn streamName(&self) -> Option<Retained<NSString>>;
/// Setter for [`streamName`][Self::streamName].
#[unsafe(method(setStreamName:))]
#[unsafe(method_family = none)]
pub unsafe fn setStreamName(&self, stream_name: Option<&NSString>);
/// SCStreamProperty that specifies whether the cursor should appear in the stream. By default the cursor is visible.
#[unsafe(method(showsCursor))]
#[unsafe(method_family = none)]
pub unsafe fn showsCursor(&self) -> bool;
/// Setter for [`showsCursor`][Self::showsCursor].
#[unsafe(method(setShowsCursor:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsCursor(&self, shows_cursor: bool);
/// SCStreamProperty that specifies whether to draw a circle around the cursor click, default is NO. This property will not be affected by showsCursor. This property currently applies when pixelFormat is set to BGRA.
#[unsafe(method(showMouseClicks))]
#[unsafe(method_family = none)]
pub unsafe fn showMouseClicks(&self) -> bool;
/// Setter for [`showMouseClicks`][Self::showMouseClicks].
#[unsafe(method(setShowMouseClicks:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowMouseClicks(&self, show_mouse_clicks: bool);
#[cfg(feature = "objc2-core-graphics")]
/// SCStreamProperty for background color. By default the background color is clear.
///
/// # Safety
///
/// This is not retained internally, you must ensure the object is still alive.
#[unsafe(method(backgroundColor))]
#[unsafe(method_family = none)]
pub unsafe fn backgroundColor(&self) -> Retained<CGColor>;
#[cfg(feature = "objc2-core-graphics")]
/// Setter for [`backgroundColor`][Self::backgroundColor].
///
/// # Safety
///
/// This is unretained, you must ensure the object is kept alive while in use.
#[unsafe(method(setBackgroundColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setBackgroundColor(&self, background_color: &CGColor);
#[cfg(feature = "objc2-core-foundation")]
/// SCStreamProperty that specifies that the stream only samples a subset of the frame input. For display streams, if not set, then the entire display is streamed. For independent window streams, if not set, then the entire window is streamed. The rectangle is specified in points in the display’s logical coordinate system.
#[unsafe(method(sourceRect))]
#[unsafe(method_family = none)]
pub unsafe fn sourceRect(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`sourceRect`][Self::sourceRect].
#[unsafe(method(setSourceRect:))]
#[unsafe(method_family = none)]
pub unsafe fn setSourceRect(&self, source_rect: CGRect);
#[cfg(feature = "objc2-core-foundation")]
/// SCStreamProperty that specifies that the stream outputs the frame data into a subset of the output IOSurface object. For both display streams and independent window streams, if not set, then the entire output surface is used. The rectangle is specified in pixels in the display's coordinate system.
#[unsafe(method(destinationRect))]
#[unsafe(method_family = none)]
pub unsafe fn destinationRect(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`destinationRect`][Self::destinationRect].
#[unsafe(method(setDestinationRect:))]
#[unsafe(method_family = none)]
pub unsafe fn setDestinationRect(&self, destination_rect: CGRect);
/// SCStreamProperty that specifies the number of frames to keep in the queue. If not set the default value is 8 frames. Specifying more frames uses more memory, but may allow you to process frame data without stalling the display stream and should not exceed 8 frames.
#[unsafe(method(queueDepth))]
#[unsafe(method_family = none)]
pub unsafe fn queueDepth(&self) -> NSInteger;
/// Setter for [`queueDepth`][Self::queueDepth].
#[unsafe(method(setQueueDepth:))]
#[unsafe(method_family = none)]
pub unsafe fn setQueueDepth(&self, queue_depth: NSInteger);
#[cfg(feature = "objc2-core-foundation")]
/// SCStreamProperty that specifies the YCbCr matrix applied to the output surface. The value must be one of the strings specified in https://developer.apple.com/documentation/coregraphics/quartz_display_services/display_stream_ycbcr_to_rgb_conversion_matrix_options. Should only be used if your pixel format is 420v or 420f.
///
/// # Safety
///
/// This is not retained internally, you must ensure the object is still alive.
#[unsafe(method(colorMatrix))]
#[unsafe(method_family = none)]
pub unsafe fn colorMatrix(&self) -> Retained<CFString>;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`colorMatrix`][Self::colorMatrix].
///
/// # Safety
///
/// This is unretained, you must ensure the object is kept alive while in use.
#[unsafe(method(setColorMatrix:))]
#[unsafe(method_family = none)]
pub unsafe fn setColorMatrix(&self, color_matrix: &CFString);
#[cfg(feature = "objc2-core-foundation")]
/// SCStreamProperty that specifies the color space of the output buffer. If not set the output buffer uses the same color space as the display. The value must be one of the strings specified in
/// https://developer.apple.com/documentation/coregraphics/cgcolorspace/color_space_names.
///
/// # Safety
///
/// This is not retained internally, you must ensure the object is still alive.
#[unsafe(method(colorSpaceName))]
#[unsafe(method_family = none)]
pub unsafe fn colorSpaceName(&self) -> Retained<CFString>;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`colorSpaceName`][Self::colorSpaceName].
///
/// # Safety
///
/// This is unretained, you must ensure the object is kept alive while in use.
#[unsafe(method(setColorSpaceName:))]
#[unsafe(method_family = none)]
pub unsafe fn setColorSpaceName(&self, color_space_name: &CFString);
/// SCStreamProperty that specifies whether the audio will be captured. By default audio is not captured.
#[unsafe(method(capturesAudio))]
#[unsafe(method_family = none)]
pub unsafe fn capturesAudio(&self) -> bool;
/// Setter for [`capturesAudio`][Self::capturesAudio].
#[unsafe(method(setCapturesAudio:))]
#[unsafe(method_family = none)]
pub unsafe fn setCapturesAudio(&self, captures_audio: bool);
/// SCStreamProperty to specify the sample rate for audio. Default is set to 48000.
#[unsafe(method(sampleRate))]
#[unsafe(method_family = none)]
pub unsafe fn sampleRate(&self) -> NSInteger;
/// Setter for [`sampleRate`][Self::sampleRate].
#[unsafe(method(setSampleRate:))]
#[unsafe(method_family = none)]
pub unsafe fn setSampleRate(&self, sample_rate: NSInteger);
/// SCStreamProperty to specify channel count. Default is set to two.
#[unsafe(method(channelCount))]
#[unsafe(method_family = none)]
pub unsafe fn channelCount(&self) -> NSInteger;
/// Setter for [`channelCount`][Self::channelCount].
#[unsafe(method(setChannelCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setChannelCount(&self, channel_count: NSInteger);
/// SCAudioProperty whether to exclude audio from current process. Default is set to NO.
#[unsafe(method(excludesCurrentProcessAudio))]
#[unsafe(method_family = none)]
pub unsafe fn excludesCurrentProcessAudio(&self) -> bool;
/// Setter for [`excludesCurrentProcessAudio`][Self::excludesCurrentProcessAudio].
#[unsafe(method(setExcludesCurrentProcessAudio:))]
#[unsafe(method_family = none)]
pub unsafe fn setExcludesCurrentProcessAudio(&self, excludes_current_process_audio: bool);
/// SCStreamProperty to ignore framing on windows in the display sharing case (will ignore shadows).
#[unsafe(method(ignoreShadowsDisplay))]
#[unsafe(method_family = none)]
pub unsafe fn ignoreShadowsDisplay(&self) -> bool;
/// Setter for [`ignoreShadowsDisplay`][Self::ignoreShadowsDisplay].
#[unsafe(method(setIgnoreShadowsDisplay:))]
#[unsafe(method_family = none)]
pub unsafe fn setIgnoreShadowsDisplay(&self, ignore_shadows_display: bool);
/// SCStreamProperty to ignore framing on windows in the single window sharing case (will ignore shadows).
#[unsafe(method(ignoreShadowsSingleWindow))]
#[unsafe(method_family = none)]
pub unsafe fn ignoreShadowsSingleWindow(&self) -> bool;
/// Setter for [`ignoreShadowsSingleWindow`][Self::ignoreShadowsSingleWindow].
#[unsafe(method(setIgnoreShadowsSingleWindow:))]
#[unsafe(method_family = none)]
pub unsafe fn setIgnoreShadowsSingleWindow(&self, ignore_shadows_single_window: bool);
/// captureResolution Choose between automatic, best, and nominal.
#[unsafe(method(captureResolution))]
#[unsafe(method_family = none)]
pub unsafe fn captureResolution(&self) -> SCCaptureResolutionType;
/// Setter for [`captureResolution`][Self::captureResolution].
#[unsafe(method(setCaptureResolution:))]
#[unsafe(method_family = none)]
pub unsafe fn setCaptureResolution(&self, capture_resolution: SCCaptureResolutionType);
/// SCStreamProperty to capture only the shadows of windows.
#[unsafe(method(capturesShadowsOnly))]
#[unsafe(method_family = none)]
pub unsafe fn capturesShadowsOnly(&self) -> bool;
/// Setter for [`capturesShadowsOnly`][Self::capturesShadowsOnly].
#[unsafe(method(setCapturesShadowsOnly:))]
#[unsafe(method_family = none)]
pub unsafe fn setCapturesShadowsOnly(&self, captures_shadows_only: bool);
/// SCStreamProperty to ensure partially transparent areas on windows are backed by a solid white color so that the resulting image is fully opaque.
#[unsafe(method(shouldBeOpaque))]
#[unsafe(method_family = none)]
pub unsafe fn shouldBeOpaque(&self) -> bool;
/// Setter for [`shouldBeOpaque`][Self::shouldBeOpaque].
#[unsafe(method(setShouldBeOpaque:))]
#[unsafe(method_family = none)]
pub unsafe fn setShouldBeOpaque(&self, should_be_opaque: bool);
/// SCStreamProperty to ignore framing on windows in the display sharing case (will ignore shadows).
#[unsafe(method(ignoreGlobalClipDisplay))]
#[unsafe(method_family = none)]
pub unsafe fn ignoreGlobalClipDisplay(&self) -> bool;
/// Setter for [`ignoreGlobalClipDisplay`][Self::ignoreGlobalClipDisplay].
#[unsafe(method(setIgnoreGlobalClipDisplay:))]
#[unsafe(method_family = none)]
pub unsafe fn setIgnoreGlobalClipDisplay(&self, ignore_global_clip_display: bool);
/// SCStreamProperty to ignore global clipping when on single window share. When set to true, single window captures that are partially off the screen will not be clipped. (will ignore window placement in display context).
#[unsafe(method(ignoreGlobalClipSingleWindow))]
#[unsafe(method_family = none)]
pub unsafe fn ignoreGlobalClipSingleWindow(&self) -> bool;
/// Setter for [`ignoreGlobalClipSingleWindow`][Self::ignoreGlobalClipSingleWindow].
#[unsafe(method(setIgnoreGlobalClipSingleWindow:))]
#[unsafe(method_family = none)]
pub unsafe fn setIgnoreGlobalClipSingleWindow(
&self,
ignore_global_clip_single_window: bool,
);
/// SCStreamProperty that informs the system if a privacy alert should be shown when using presenter overlay for a stream. Defaults to SCPresenterOverlayAlertSettingSystem;
#[unsafe(method(presenterOverlayPrivacyAlertSetting))]
#[unsafe(method_family = none)]
pub unsafe fn presenterOverlayPrivacyAlertSetting(&self) -> SCPresenterOverlayAlertSetting;
/// Setter for [`presenterOverlayPrivacyAlertSetting`][Self::presenterOverlayPrivacyAlertSetting].
#[unsafe(method(setPresenterOverlayPrivacyAlertSetting:))]
#[unsafe(method_family = none)]
pub unsafe fn setPresenterOverlayPrivacyAlertSetting(
&self,
presenter_overlay_privacy_alert_setting: SCPresenterOverlayAlertSetting,
);
/// SCStreamProperty to show the child windows in display bound windows and applications sharing. Child windows are included by default.
#[unsafe(method(includeChildWindows))]
#[unsafe(method_family = none)]
pub unsafe fn includeChildWindows(&self) -> bool;
/// Setter for [`includeChildWindows`][Self::includeChildWindows].
#[unsafe(method(setIncludeChildWindows:))]
#[unsafe(method_family = none)]
pub unsafe fn setIncludeChildWindows(&self, include_child_windows: bool);
/// SCStreamProperty that specifies whether the microphone audio will be captured. By default microphone is not captured.
#[unsafe(method(captureMicrophone))]
#[unsafe(method_family = none)]
pub unsafe fn captureMicrophone(&self) -> bool;
/// Setter for [`captureMicrophone`][Self::captureMicrophone].
#[unsafe(method(setCaptureMicrophone:))]
#[unsafe(method_family = none)]
pub unsafe fn setCaptureMicrophone(&self, capture_microphone: bool);
/// SCStreamProperty that specifies which microphone device to capture. This deviceID is the uniqueID from AVCaptureDevice for the microphone. System Default Microphone will be used if not specified by client. For Mac Catalyst apps, the System Default Microphone will be captured.
#[unsafe(method(microphoneCaptureDeviceID))]
#[unsafe(method_family = none)]
pub unsafe fn microphoneCaptureDeviceID(&self) -> Option<Retained<NSString>>;
/// Setter for [`microphoneCaptureDeviceID`][Self::microphoneCaptureDeviceID].
#[unsafe(method(setMicrophoneCaptureDeviceID:))]
#[unsafe(method_family = none)]
pub unsafe fn setMicrophoneCaptureDeviceID(
&self,
microphone_capture_device_id: Option<&NSString>,
);
/// SCStreamProperty client will choose captureDynamicRange between SCCaptureDynamicRangeSDR, SCCaptureDynamicRangeHDRLocalDisplay, SCCaptureDynamicRangeHDRCanonicalDisplay. By default, the stream is capturing with SCCaptureDynamicRangeSDR. HDR capture is only supported with Apple Silicon Mac, setting this property on Intel Mac will have no effect. HDR recording is not support yet, adding a recording output to a stream with SCCaptureDynamicRangeHDR set will fail.
#[unsafe(method(captureDynamicRange))]
#[unsafe(method_family = none)]
pub unsafe fn captureDynamicRange(&self) -> SCCaptureDynamicRange;
/// Setter for [`captureDynamicRange`][Self::captureDynamicRange].
#[unsafe(method(setCaptureDynamicRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setCaptureDynamicRange(&self, capture_dynamic_range: SCCaptureDynamicRange);
/// Returns an instance of SCStreamConfiguration corresponding to the given preset
///
/// Parameter `preset`: The enum identifier for the desired preset
///
/// The SCStreamConfiguration of the returned object can be used as a guide for creating and configuring an SCStream. If all the suggested properties are respected in creating the SCStream, the resulting capture result will conform to the criteria implied by the preset.
#[unsafe(method(streamConfigurationWithPreset:))]
#[unsafe(method_family = none)]
pub unsafe fn streamConfigurationWithPreset(
preset: SCStreamConfigurationPreset,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl SCStreamConfiguration {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
/// [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfo?language=objc)
// NS_TYPED_ENUM
pub type SCStreamFrameInfo = NSString;
extern "C" {
/// SCStreamFrameInfoStatus
///
/// The key for the CFDictionary attached to the CMSampleBuffer that denotes the frames SCFrameStatus
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfostatus?language=objc)
pub static SCStreamFrameInfoStatus: &'static SCStreamFrameInfo;
}
extern "C" {
/// SCStreamFrameInfoDisplayTime
///
/// The key for the CFDictionary attached to the CMSampleBuffer for the mach absolute time when the event occurred. For a frame event, this is when the frame was displayed by the window server.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfodisplaytime?language=objc)
pub static SCStreamFrameInfoDisplayTime: &'static SCStreamFrameInfo;
}
extern "C" {
/// SCStreamFrameInfoScaleFactor
///
/// The key for the CFDictionary attached to the CMSampleBuffer for the display resolution associated with the frame. Display resolution is the pixel to point scaling factor. It should be in the range of [1, 4].
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfoscalefactor?language=objc)
pub static SCStreamFrameInfoScaleFactor: &'static SCStreamFrameInfo;
}
extern "C" {
/// SCStreamFrameInfoContentScale
///
/// The key for the CFDictionary attached to the CMSampleBuffer for the content scale associated with the frame. Content scale is the scaling factor from original content size to its size in surface.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfocontentscale?language=objc)
pub static SCStreamFrameInfoContentScale: &'static SCStreamFrameInfo;
}
extern "C" {
/// SCStreamFrameInfoContentRect
///
/// The key for the CFDictionary attached to the CMSampleBuffer for the content rect associated with the frame. Content rect is the size and location of content in points in surface.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfocontentrect?language=objc)
pub static SCStreamFrameInfoContentRect: &'static SCStreamFrameInfo;
}
extern "C" {
/// SCStreamFrameInfoDirtyRects
///
/// The key for the CFDictionary attached to the CMSampleBuffer for an array of rectangles that is the union of both rectangles that were redrawn and rectangles that were moved. This is an array of CGRect in NSValue. The CGRects elements are specified in pixels.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfodirtyrects?language=objc)
pub static SCStreamFrameInfoDirtyRects: &'static SCStreamFrameInfo;
}
extern "C" {
/// SCStreamFrameInfoScreenRect
///
/// The key for the CFDictionary attached to the CMSampleBuffer for the onscreen location of the captured content
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfoscreenrect?language=objc)
pub static SCStreamFrameInfoScreenRect: &'static SCStreamFrameInfo;
}
extern "C" {
/// SCStreamFrameInfoBoundingRect
///
/// The key for the CFDictionary attached to the CMSampleBuffer for the bounding rect associated with the frame. Bounding rect is the size and location of smallest bounding box containing all captured windows in points and in surface coordinates.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfoboundingrect?language=objc)
pub static SCStreamFrameInfoBoundingRect: &'static SCStreamFrameInfo;
}
extern "C" {
/// SCStreamFrameInfoPresenterOverlayContentRect
///
/// The key for the CFDictionary attached to the CMSampleBuffer for the content rect associated with the frame while in presenter overlay. In presenter overlay small, this content rect is the size and location of smallest bounding box containing all captured windows plus small overlay window in points and in surface coordinates.
/// In presenter overlay large, this content rect is the size and location of shared content in points and in surface coordinates.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamframeinfopresenteroverlaycontentrect?language=objc)
pub static SCStreamFrameInfoPresenterOverlayContentRect: &'static SCStreamFrameInfo;
}
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstream?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SCStream;
);
extern_conformance!(
unsafe impl NSObjectProtocol for SCStream {}
);
impl SCStream {
extern_methods!(
#[cfg(feature = "objc2-core-media")]
/// Synchronization clock used for media capture.
#[unsafe(method(synchronizationClock))]
#[unsafe(method_family = none)]
pub unsafe fn synchronizationClock(&self) -> Option<Retained<CMClock>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
/// initWithFilter:configuration:delegate:
///
/// Parameter `contentFilter`: the requested content filter to be captured
///
/// Parameter `streamConfig`: the requested stream configuration to be applied to the SCStream
///
/// Parameter `delegate`: the SCStream delegate object
///
/// this method create a SCStream object that has the particular output settings for the content stream
#[unsafe(method(initWithFilter:configuration:delegate:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFilter_configuration_delegate(
this: Allocated<Self>,
content_filter: &SCContentFilter,
stream_config: &SCStreamConfiguration,
delegate: Option<&ProtocolObject<dyn SCStreamDelegate>>,
) -> Retained<Self>;
#[cfg(feature = "dispatch2")]
/// addStreamOutput:type:sampleHandlerQueue:error:
///
/// Parameter `output`: an object that adheres to the SCStreamOutput protocol that will receive the frames and call its delegate frame call back on its sample handler queue
///
/// Parameter `type`: the SCStreamOutput type
///
/// Parameter `sampleHandlerQueue`: the return queue for the sample handler
///
/// Parameter `error`: the error pertaining to the add stream output
///
/// An SCStreamOutput protocol object instance can only be added to a session using -addStreamOutput: Returns a BOOL denoting if the add was successful
///
/// # Safety
///
/// `sample_handler_queue` possibly has additional threading requirements.
#[unsafe(method(addStreamOutput:type:sampleHandlerQueue:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn addStreamOutput_type_sampleHandlerQueue_error(
&self,
output: &ProtocolObject<dyn SCStreamOutput>,
r#type: SCStreamOutputType,
sample_handler_queue: Option<&DispatchQueue>,
) -> Result<(), Retained<NSError>>;
/// removeStreamOutput:type:error:
///
/// Parameter `output`: an object that adheres to the SCStreamOutput protocol that will received the frames and call its delegate frame call back on its sample handler queue
///
/// Parameter `type`: the SCStreamOutput type
///
/// Parameter `error`: the error pertaining to the removing stream output
///
/// An SCStreamOutput protocol object instance can only be removed to a session using -addStreamOutput: Returns a BOOL denoting if the remove was successful
#[unsafe(method(removeStreamOutput:type:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn removeStreamOutput_type_error(
&self,
output: &ProtocolObject<dyn SCStreamOutput>,
r#type: SCStreamOutputType,
) -> Result<(), Retained<NSError>>;
#[cfg(feature = "block2")]
/// updateContentFilter:completionHandler:
///
/// Parameter `contentFilter`: the requested content filter to be updated
///
/// Parameter `completionHandler`: the handler to be called when the function completes
///
/// this method will update the content filter for a content stream. A completion handler will be called when the update is complete with an error denoting if the update has failed.
#[unsafe(method(updateContentFilter:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn updateContentFilter_completionHandler(
&self,
content_filter: &SCContentFilter,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
/// updateConfiguration:completionHandler:
///
/// Parameter `streamConfig`: the requested content filter to be updated
///
/// Parameter `completionHandler`: the handler to be called when the function completes
///
/// this method will update the stream configuration for a content stream. A completion handler will be called when the update is complete with an error denoting if the update has failed.
#[unsafe(method(updateConfiguration:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn updateConfiguration_completionHandler(
&self,
stream_config: &SCStreamConfiguration,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
/// startCaptureWithCompletionHandler:
///
/// Parameter `completionHandler`: the handler to be called when the function completes
///
/// this method starts the content stream. The handler will be called when the content stream start has completed with an error denoting if the start has failed.
#[unsafe(method(startCaptureWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn startCaptureWithCompletionHandler(
&self,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
/// stopCaptureWithCompletionHandler:
///
/// Parameter `completionHandler`: the handler to be called when the function completes
///
/// this method stops the content stream. The handler will be called when the content stream stop has completed with an error denoting if the stop has failed.
#[unsafe(method(stopCaptureWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn stopCaptureWithCompletionHandler(
&self,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "SCRecordingOutput")]
/// Add a SCRecordingOutput to the SCStream. Starts Recording if stream is already capturing, otherwise recording will be started after capture starts. Recording will be written into a file url specified in SCRecordingOutput. Media(Screen/Audio/Microphone) to be recorded will be based on the SCStream configuration.
///
/// Parameter `recordingOutput`: an SCRecordingOutput that including configuration of recording, and delegate for recording event.
///
/// Parameter `error`: the error pertaining to the add recording output
///
/// Returns a BOOL denoting if the add was successful. Currently only support one recordingOutput on a stream. To guarantee the first sample captured in the stream to be written into the recording file, client need to add recordingOutput before startCapture. Delegate for recordingDidStart will be notified in SCRecordingOutput or recordingDidFinishWithError will be notified with an error associated if recording failed to start.
#[unsafe(method(addRecordingOutput:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn addRecordingOutput_error(
&self,
recording_output: &SCRecordingOutput,
) -> Result<(), Retained<NSError>>;
#[cfg(feature = "SCRecordingOutput")]
/// Remove SCRecordingOutput from the SCStream. Stops Recording if the stream is currently recording.
///
/// Parameter `recordingOutput`: an SCRecordingOutput that including configuration of recording, and delegate for recording event.
///
/// Parameter `error`: the error pertaining to the remove recording output
///
/// Returns a BOOL denoting if the remove was successful. Delegate for recordingDidFinishWithError will be notified in SCRecordingOutput, associate with an error code if recording failed to finish written to the file. If stopCapture is called without removing recordingOutput, recording will be stopped and finish writting into the file. In case client update the stream configuration during recording, recording will be stopped as well.
#[unsafe(method(removeRecordingOutput:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn removeRecordingOutput_error(
&self,
recording_output: &SCRecordingOutput,
) -> Result<(), Retained<NSError>>;
);
}
extern_protocol!(
/// [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamoutput?language=objc)
pub unsafe trait SCStreamOutput: NSObjectProtocol {
#[cfg(feature = "objc2-core-media")]
/// stream:didOutputSampleBuffer:ofType:
///
/// Parameter `sampleBuffer`: the sample buffer
///
/// Parameter `type`: the sample buffer type
///
/// protocol method for passing back screen sample buffers
#[optional]
#[unsafe(method(stream:didOutputSampleBuffer:ofType:))]
#[unsafe(method_family = none)]
unsafe fn stream_didOutputSampleBuffer_ofType(
&self,
stream: &SCStream,
sample_buffer: &CMSampleBuffer,
r#type: SCStreamOutputType,
);
}
);
extern_protocol!(
/// SCStreamDelegate
///
/// SCStreamDelegate is the object that adheres to the SCStream delegate call backs
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/screencapturekit/scstreamdelegate?language=objc)
pub unsafe trait SCStreamDelegate: NSObjectProtocol {
/// stream:didStopStreamWithError:
///
/// Parameter `stream`: the SCStream object
///
/// Parameter `error`: the error denoted by the stopping of the stream
///
/// notifies the delegate that the stream has stopped and the error associated with it
#[optional]
#[unsafe(method(stream:didStopWithError:))]
#[unsafe(method_family = none)]
unsafe fn stream_didStopWithError(&self, stream: &SCStream, error: &NSError);
/// outputVideoEffectDidStartForStream:
///
/// Parameter `stream`: the SCStream object
///
/// notifies the delegate that the stream's overlay video effect has started.
#[optional]
#[unsafe(method(outputVideoEffectDidStartForStream:))]
#[unsafe(method_family = none)]
unsafe fn outputVideoEffectDidStartForStream(&self, stream: &SCStream);
/// stream:outputVideoEffectDidStart:
///
/// Parameter `stream`: the SCStream object
///
/// notifies the delegate that the stream's overlay video effect has stopped.
#[optional]
#[unsafe(method(outputVideoEffectDidStopForStream:))]
#[unsafe(method_family = none)]
unsafe fn outputVideoEffectDidStopForStream(&self, stream: &SCStream);
/// streamDidBecomeActive:
///
/// Parameter `stream`: the SCStream object
///
/// notifies the delegate the first time any window that was being shared in the stream is re-opened after all the windows being shared are closed. When all the windows being shared are closed, the client will receive streamDidBecomeInactive:.
#[optional]
#[unsafe(method(streamDidBecomeActive:))]
#[unsafe(method_family = none)]
unsafe fn streamDidBecomeActive(&self, stream: &SCStream);
/// streamDidBecomeInactive:
///
/// Parameter `stream`: the SCStream object
///
/// notifies the delegate that all the windows that are currently being shared are exited. This callback occurs for all content filter types.
#[optional]
#[unsafe(method(streamDidBecomeInactive:))]
#[unsafe(method_family = none)]
unsafe fn streamDidBecomeInactive(&self, stream: &SCStream);
}
);