screencapturekit

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package screencapturekit provides Go bindings for the ScreenCaptureKit framework.

Filter and select screen content and stream it to your app.

Use the ScreenCaptureKit framework to add support for high-performance frame capture of screen and audio content to your Mac app. The framework gives you fine-grained control to select and stream only the content that you want to capture. As a stream captures new video frames and audio samples, it passes them to your app as [CMSampleBuffer](<doc://com.apple.documentation/documentation/CoreMedia/CMSampleBuffer>) objects that contain the media data and its related metadata. ScreenCaptureKit also provides a macOS-integrated picker for streaming selection and management, SCContentSharingPicker(<doc://com.apple.screencapturekit/documentation/ScreenCaptureKit/SCContentSharingPicker>).

Essentials

  • ScreenCaptureKit updates: Learn about important changes to ScreenCaptureKit.
  • Persistent Content Capture: A Boolean value that indicates whether a Virtual Network Computing (VNC) app needs persistent access to screen capture.
  • Capturing screen content in macOS: Stream desktop content like displays, apps, and windows by adopting screen capture in your app.

Shareable content

  • SCShareableContent: An instance that represents a set of displays, apps, and windows that your app can capture.
  • SCShareableContentInfo: An instance that provides information for the content in a given stream.
  • SCShareableContentStyle: The style of content presented in a stream.
  • SCDisplay: An instance that represents a display device.
  • SCRunningApplication: An instance that represents an app running on a device.
  • SCWindow: An instance that represents an onscreen window.

Content capture

  • SCStream: An instance that represents a stream of shareable content. (SCRecordingOutput)
  • SCStreamConfiguration: An instance that provides the output configuration for a stream. (SCCaptureResolutionType, SCPresenterOverlayAlertSetting, SCCaptureDynamicRange)
  • SCContentFilter: An instance that filters the content a stream captures. (SCStreamType)
  • SCStreamDelegate: A delegate protocol your app implements to respond to stream events.
  • SCScreenshotManager: An instance for the capture of single frames from a stream.
  • SCScreenshotConfiguration: An object that contains screenshot properties such as output width, height, and image quality specifications.
  • SCScreenshotOutput: An object that contains all images requested by the client.

Output processing

  • SCStreamOutput: A delegate protocol your app implements to receive capture stream output events.
  • SCStreamOutputType: Constants that represent output types for a stream frame.
  • SCStreamFrameInfo: An instance that defines metadata keys for a stream frame.
  • SCFrameStatus: Status values for a frame from a stream.

System content-sharing picker

  • SCContentSharingPicker: An instance of a picker presented by the operating system for managing frame-capture streams.
  • SCContentSharingPickerConfiguration: An instance for configuring the system content-sharing picker.
  • SCContentSharingPickerMode: Available modes for selecting streaming content from a picker presented by the operating system.
  • SCContentSharingPickerObserver: An observer protocol your app implements to receive messages from the operating system’s content picker.

Stream errors

  • SCStreamErrorDomain: A string representation of the error domain.
  • SCStreamError: An instance representing a ScreenCaptureKit framework error.

Key Types

Code generated from Apple documentation. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SCStreamErrorDomain is a string representation of the error domain.
	//
	// See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamErrorDomain
	SCStreamErrorDomain string
)
View Source
var SCStreamFrameInfos struct {
	// BoundingRect: A key to retrieve the bounding rectangle for a video frame.
	BoundingRect SCStreamFrameInfo
	// ContentRect: A key to retrieve the content rectangle of a video frame.
	ContentRect SCStreamFrameInfo
	// ContentScale: A key to retrieve the content scale of a video frame.
	ContentScale SCStreamFrameInfo
	// DirtyRects: A key to retrieve the areas of a video frame that contain changes.
	DirtyRects SCStreamFrameInfo
	// DisplayTime: A key to retrieve the display time of a video frame.
	DisplayTime                 SCStreamFrameInfo
	PresenterOverlayContentRect SCStreamFrameInfo
	// ScaleFactor: A key to retrieve the scale factor of a video frame.
	ScaleFactor SCStreamFrameInfo
	// ScreenRect: A key to retrieve the onscreen location of captured content.
	ScreenRect SCStreamFrameInfo
	// Status: A key to retrieve the status of a video frame.
	Status SCStreamFrameInfo
}

SCStreamFrameInfos provides typed accessors for SCStreamFrameInfo constants.

Functions

func NewCGImageRefErrorBlock

func NewCGImageRefErrorBlock(handler CGImageRefErrorHandler) (objc.ID, func())

NewCGImageRefErrorBlock wraps a Go CGImageRefErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [SCScreenshotManager.CaptureImageInRectCompletionHandler]
  • [SCScreenshotManager.CaptureImageWithFilterConfigurationCompletionHandler]

func NewCMSampleBufferRefErrorBlock

func NewCMSampleBufferRefErrorBlock(handler CMSampleBufferRefErrorHandler) (objc.ID, func())

NewCMSampleBufferRefErrorBlock wraps a Go CMSampleBufferRefErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [SCScreenshotManager.CaptureSampleBufferWithFilterConfigurationCompletionHandler]

func NewErrorBlock

func NewErrorBlock(handler ErrorHandler) (objc.ID, func())

NewErrorBlock wraps a Go ErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewSCScreenshotOutputErrorBlock

func NewSCScreenshotOutputErrorBlock(handler SCScreenshotOutputErrorHandler) (objc.ID, func())

NewSCScreenshotOutputErrorBlock wraps a Go SCScreenshotOutputErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [SCScreenshotManager.CaptureScreenshotWithFilterConfigurationCompletionHandler]
  • [SCScreenshotManager.CaptureScreenshotWithRectConfigurationCompletionHandler]

func NewSCShareableContentErrorBlock

func NewSCShareableContentErrorBlock(handler SCShareableContentErrorHandler) (objc.ID, func())

NewSCShareableContentErrorBlock wraps a Go SCShareableContentErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [SCShareableContent.GetCurrentProcessShareableContentWithCompletionHandler]
  • [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyAboveWindowCompletionHandler]
  • [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyBelowWindowCompletionHandler]
  • [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyCompletionHandler]
  • [SCShareableContent.GetShareableContentWithCompletionHandler]

Types

type CGImageRefErrorHandler

type CGImageRefErrorHandler = func(coregraphics.CGImageRef, error)

CGImageRefErrorHandler handles Closure that processes the screenshot taken from the streaming content. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [SCScreenshotManager.CaptureImageInRectCompletionHandler]
  • [SCScreenshotManager.CaptureImageWithFilterConfigurationCompletionHandler]

type CMSampleBufferRefErrorHandler

type CMSampleBufferRefErrorHandler = func(objectivec.IObject, error)

CMSampleBufferRefErrorHandler handles Closure that processes the capture taken from streaming content. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [SCScreenshotManager.CaptureSampleBufferWithFilterConfigurationCompletionHandler]

type ErrorHandler

type ErrorHandler = func(error)

ErrorHandler handles A completion handler the system calls when this method completes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type ISCContentFilter

type ISCContentFilter interface {
	objectivec.IObject

	// Creates a filter that captures only the specified window.
	InitWithDesktopIndependentWindow(window ISCWindow) SCContentFilter
	// Creates a filter that captures only specific windows from a display.
	InitWithDisplayIncludingWindows(display ISCDisplay, includedWindows []SCWindow) SCContentFilter
	// Creates a filter that captures the contents of a display, excluding the specified windows.
	InitWithDisplayExcludingWindows(display ISCDisplay, excluded []SCWindow) SCContentFilter
	// Creates a filter that captures a display, including only windows of the specified apps.
	InitWithDisplayIncludingApplicationsExceptingWindows(display ISCDisplay, applications []SCRunningApplication, exceptingWindows []SCWindow) SCContentFilter
	// Creates a filter that captures a display, excluding windows of the specified apps.
	InitWithDisplayExcludingApplicationsExceptingWindows(display ISCDisplay, applications []SCRunningApplication, exceptingWindows []SCWindow) SCContentFilter

	// The size and location of the content to filter, in screen points.
	ContentRect() corefoundation.CGRect
	// The scaling factor used to translate screen points into pixels.
	PointPixelScale() float32
	// The type of the streaming content.
	StreamType() SCStreamType
	// The display style of the sharable content.
	Style() SCShareableContentStyle

	IncludeMenuBar() bool
	SetIncludeMenuBar(value bool)
	IncludedApplications() []SCRunningApplication
	IncludedDisplays() []SCDisplay
	IncludedWindows() []SCWindow
}

An interface definition for the SCContentFilter class.

Creating a filter

  • [ISCContentFilter.InitWithDesktopIndependentWindow]: Creates a filter that captures only the specified window.
  • [ISCContentFilter.InitWithDisplayIncludingWindows]: Creates a filter that captures only specific windows from a display.
  • [ISCContentFilter.InitWithDisplayExcludingWindows]: Creates a filter that captures the contents of a display, excluding the specified windows.
  • [ISCContentFilter.InitWithDisplayIncludingApplicationsExceptingWindows]: Creates a filter that captures a display, including only windows of the specified apps.
  • [ISCContentFilter.InitWithDisplayExcludingApplicationsExceptingWindows]: Creates a filter that captures a display, excluding windows of the specified apps.

Filter properties

  • [ISCContentFilter.ContentRect]: The size and location of the content to filter, in screen points.
  • [ISCContentFilter.PointPixelScale]: The scaling factor used to translate screen points into pixels.
  • [ISCContentFilter.StreamType]: The type of the streaming content.
  • [ISCContentFilter.Style]: The display style of the sharable content.

Instance Properties

  • [ISCContentFilter.IncludeMenuBar]
  • [ISCContentFilter.SetIncludeMenuBar]
  • [ISCContentFilter.IncludedApplications]
  • [ISCContentFilter.IncludedDisplays]
  • [ISCContentFilter.IncludedWindows]

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter

type ISCContentSharingPicker

type ISCContentSharingPicker interface {
	objectivec.IObject

	// A Boolean value that indicates if the picker is active.
	Active() bool
	SetActive(value bool)

	// Sets the configuration for the content capture picker for all streams, providing allowed selection modes and content excluded from selection.
	Configuration() ISCContentSharingPickerConfiguration
	SetConfiguration(value ISCContentSharingPickerConfiguration)
	// The default configuration to use for the content capture picker.
	DefaultConfiguration() ISCContentSharingPickerConfiguration
	SetDefaultConfiguration(value ISCContentSharingPickerConfiguration)
	// The maximum number of streams the content capture picker allows.
	MaximumStreamCount() int
	SetMaximumStreamCount(value int)

	// Adds an observer instance to notify of changes in the content-sharing picker.
	AddObserver(observer SCContentSharingPickerObserver)
	// Removes an observer instance from the content-sharing picker.
	RemoveObserver(observer SCContentSharingPickerObserver)

	// Displays the picker with no active selection for capture.
	Present()
	// Displays the picker with an already running capture stream.
	PresentPickerForStream(stream ISCStream)
	// Displays the picker for a single type of capture selection.
	PresentPickerUsingContentStyle(contentStyle SCShareableContentStyle)
	// Displays the picker with an existing capture stream, allowing for a single type of capture selection.
	PresentPickerForStreamUsingContentStyle(stream ISCStream, contentStyle SCShareableContentStyle)
}

An interface definition for the SCContentSharingPicker class.

Picker availability

  • [ISCContentSharingPicker.Active]: A Boolean value that indicates if the picker is active.
  • [ISCContentSharingPicker.SetActive]

Stream configuration

  • [ISCContentSharingPicker.Configuration]: Sets the configuration for the content capture picker for all streams, providing allowed selection modes and content excluded from selection.
  • [ISCContentSharingPicker.SetConfiguration]
  • [ISCContentSharingPicker.DefaultConfiguration]: The default configuration to use for the content capture picker.
  • [ISCContentSharingPicker.SetDefaultConfiguration]
  • [ISCContentSharingPicker.MaximumStreamCount]: The maximum number of streams the content capture picker allows.
  • [ISCContentSharingPicker.SetMaximumStreamCount]

Manage observers

  • [ISCContentSharingPicker.AddObserver]: Adds an observer instance to notify of changes in the content-sharing picker.
  • [ISCContentSharingPicker.RemoveObserver]: Removes an observer instance from the content-sharing picker.

Picker display

  • [ISCContentSharingPicker.Present]: Displays the picker with no active selection for capture.
  • [ISCContentSharingPicker.PresentPickerForStream]: Displays the picker with an already running capture stream.
  • [ISCContentSharingPicker.PresentPickerUsingContentStyle]: Displays the picker for a single type of capture selection.
  • [ISCContentSharingPicker.PresentPickerForStreamUsingContentStyle]: Displays the picker with an existing capture stream, allowing for a single type of capture selection.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker

type ISCContentSharingPickerConfiguration

type ISCContentSharingPickerConfiguration interface {
	objectivec.IObject

	// The content-selection modes supported by the picker.
	AllowedPickerModes() SCContentSharingPickerMode
	SetAllowedPickerModes(value SCContentSharingPickerMode)
	// A Boolean value that indicates if the present stream can change to a different source.
	AllowsChangingSelectedContent() bool
	SetAllowsChangingSelectedContent(value bool)
	// A list of bundle IDs to exclude from the sharing picker.
	ExcludedBundleIDs() []string
	SetExcludedBundleIDs(value []string)
	// A list of window IDs to exclude from the sharing picker.
	ExcludedWindowIDs() []foundation.NSNumber
	SetExcludedWindowIDs(value []foundation.NSNumber)
}

An interface definition for the SCContentSharingPickerConfiguration class.

Control streaming selections

  • [ISCContentSharingPickerConfiguration.AllowedPickerModes]: The content-selection modes supported by the picker.
  • [ISCContentSharingPickerConfiguration.SetAllowedPickerModes]
  • [ISCContentSharingPickerConfiguration.AllowsChangingSelectedContent]: A Boolean value that indicates if the present stream can change to a different source.
  • [ISCContentSharingPickerConfiguration.SetAllowsChangingSelectedContent]
  • [ISCContentSharingPickerConfiguration.ExcludedBundleIDs]: A list of bundle IDs to exclude from the sharing picker.
  • [ISCContentSharingPickerConfiguration.SetExcludedBundleIDs]
  • [ISCContentSharingPickerConfiguration.ExcludedWindowIDs]: A list of window IDs to exclude from the sharing picker.
  • [ISCContentSharingPickerConfiguration.SetExcludedWindowIDs]

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerConfiguration-c.class

type ISCDisplay

type ISCDisplay interface {
	objectivec.IObject

	// The Core Graphics display identifier.
	DisplayID() uint32

	// The frame of the display.
	Frame() corefoundation.CGRect
	// The width of the display in points.
	Width() int
	// The height of the display in points.
	Height() int
}

An interface definition for the SCDisplay class.

Identifying displays

  • [ISCDisplay.DisplayID]: The Core Graphics display identifier.

Accessing dimensions

  • [ISCDisplay.Frame]: The frame of the display.
  • [ISCDisplay.Width]: The width of the display in points.
  • [ISCDisplay.Height]: The height of the display in points.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCDisplay

type ISCRecordingOutput

type ISCRecordingOutput interface {
	objectivec.IObject

	InitWithConfigurationDelegate(recordingOutputConfiguration ISCRecordingOutputConfiguration, delegate SCRecordingOutputDelegate) SCRecordingOutput

	RecordedDuration() objectivec.IObject
	RecordedFileSize() int
}

An interface definition for the SCRecordingOutput class.

Creating a recording output

  • [ISCRecordingOutput.InitWithConfigurationDelegate]

Configuring the recording output

  • [ISCRecordingOutput.RecordedDuration]
  • [ISCRecordingOutput.RecordedFileSize]

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRecordingOutput

type ISCRecordingOutputConfiguration

type ISCRecordingOutputConfiguration interface {
	objectivec.IObject

	AvailableOutputFileTypes() []string
	AvailableVideoCodecTypes() []string
	OutputFileType() foundation.NSString
	SetOutputFileType(value foundation.NSString)
	OutputURL() foundation.INSURL
	SetOutputURL(value foundation.INSURL)
	VideoCodecType() foundation.NSString
	SetVideoCodecType(value foundation.NSString)
}

An interface definition for the SCRecordingOutputConfiguration class.

Instance Properties

  • [ISCRecordingOutputConfiguration.AvailableOutputFileTypes]
  • [ISCRecordingOutputConfiguration.AvailableVideoCodecTypes]
  • [ISCRecordingOutputConfiguration.OutputFileType]
  • [ISCRecordingOutputConfiguration.SetOutputFileType]
  • [ISCRecordingOutputConfiguration.OutputURL]
  • [ISCRecordingOutputConfiguration.SetOutputURL]
  • [ISCRecordingOutputConfiguration.VideoCodecType]
  • [ISCRecordingOutputConfiguration.SetVideoCodecType]

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRecordingOutputConfiguration

type ISCRunningApplication

type ISCRunningApplication interface {
	objectivec.IObject

	// The system process identifier of the app.
	ProcessID() int32
	// The unique bundle identifier of the app.
	BundleIdentifier() string
	// The display name of the app.
	ApplicationName() string
}

An interface definition for the SCRunningApplication class.

Inspecting an app

  • [ISCRunningApplication.ProcessID]: The system process identifier of the app.
  • [ISCRunningApplication.BundleIdentifier]: The unique bundle identifier of the app.
  • [ISCRunningApplication.ApplicationName]: The display name of the app.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRunningApplication

type ISCScreenshotConfiguration

type ISCScreenshotConfiguration interface {
	objectivec.IObject

	// A uniform type identifier that specifies the screenshot’s file format; HEIC, JPEG, or PNG.
	ContentType() uniformtypeidentifiers.UTType
	SetContentType(value uniformtypeidentifiers.UTType)
	// A rectangle that specifies whether to output screenshots in a subset of the output image.
	DestinationRect() corefoundation.CGRect
	SetDestinationRect(value corefoundation.CGRect)
	// Specifies whether the screen capture uses attributes of the local or canonical display.
	DisplayIntent() SCScreenshotDisplayIntent
	SetDisplayIntent(value SCScreenshotDisplayIntent)
	// Specifies the type of image returned to the client; standard dynamic range, high dynamic range, or both.
	DynamicRange() SCScreenshotDynamicRange
	SetDynamicRange(value SCScreenshotDynamicRange)
	// Specifies the URL where the screenshot process saves the output.
	FileURL() foundation.INSURL
	SetFileURL(value foundation.INSURL)
	// An integer value that specifies the output height, measured in pixels.
	Height() int
	SetHeight(value int)
	// A Boolean value that specifies whether to ignore framing on windows when using content filters.
	IgnoreClipping() bool
	SetIgnoreClipping(value bool)
	// A Boolean value that specifies whether to ignore framing on windows.
	IgnoreShadows() bool
	SetIgnoreShadows(value bool)
	// A Boolean that specifies whether the screenshot captures subwindows of the included apps and windows.
	IncludeChildWindows() bool
	SetIncludeChildWindows(value bool)
	// A Boolean value that specifies whether the pointer appears in the screenshot.
	ShowsCursor() bool
	SetShowsCursor(value bool)
	// A rectangle that specifies that the screenshot only samples a subset of the frame input.
	SourceRect() corefoundation.CGRect
	SetSourceRect(value corefoundation.CGRect)
	// An integer value that specifies the output width in pixels.
	Width() int
	SetWidth(value int)
}

An interface definition for the SCScreenshotConfiguration class.

Instance Properties

  • [ISCScreenshotConfiguration.ContentType]: A uniform type identifier that specifies the screenshot’s file format; HEIC, JPEG, or PNG.
  • [ISCScreenshotConfiguration.SetContentType]
  • [ISCScreenshotConfiguration.DestinationRect]: A rectangle that specifies whether to output screenshots in a subset of the output image.
  • [ISCScreenshotConfiguration.SetDestinationRect]
  • [ISCScreenshotConfiguration.DisplayIntent]: Specifies whether the screen capture uses attributes of the local or canonical display.
  • [ISCScreenshotConfiguration.SetDisplayIntent]
  • [ISCScreenshotConfiguration.DynamicRange]: Specifies the type of image returned to the client; standard dynamic range, high dynamic range, or both.
  • [ISCScreenshotConfiguration.SetDynamicRange]
  • [ISCScreenshotConfiguration.FileURL]: Specifies the URL where the screenshot process saves the output.
  • [ISCScreenshotConfiguration.SetFileURL]
  • [ISCScreenshotConfiguration.Height]: An integer value that specifies the output height, measured in pixels.
  • [ISCScreenshotConfiguration.SetHeight]
  • [ISCScreenshotConfiguration.IgnoreClipping]: A Boolean value that specifies whether to ignore framing on windows when using content filters.
  • [ISCScreenshotConfiguration.SetIgnoreClipping]
  • [ISCScreenshotConfiguration.IgnoreShadows]: A Boolean value that specifies whether to ignore framing on windows.
  • [ISCScreenshotConfiguration.SetIgnoreShadows]
  • [ISCScreenshotConfiguration.IncludeChildWindows]: A Boolean that specifies whether the screenshot captures subwindows of the included apps and windows.
  • [ISCScreenshotConfiguration.SetIncludeChildWindows]
  • [ISCScreenshotConfiguration.ShowsCursor]: A Boolean value that specifies whether the pointer appears in the screenshot.
  • [ISCScreenshotConfiguration.SetShowsCursor]
  • [ISCScreenshotConfiguration.SourceRect]: A rectangle that specifies that the screenshot only samples a subset of the frame input.
  • [ISCScreenshotConfiguration.SetSourceRect]
  • [ISCScreenshotConfiguration.Width]: An integer value that specifies the output width in pixels.
  • [ISCScreenshotConfiguration.SetWidth]

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration

type ISCScreenshotManager

type ISCScreenshotManager interface {
	objectivec.IObject
}

An interface definition for the SCScreenshotManager class.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotManager

type ISCScreenshotOutput

type ISCScreenshotOutput interface {
	objectivec.IObject

	// A URL property that specifies the location of the saved image.
	FileURL() foundation.INSURL
	SetFileURL(value foundation.INSURL)
	// An output property that specifies the high dynamic range version of the screenshot.
	HdrImage() coregraphics.CGImageRef
	SetHdrImage(value coregraphics.CGImageRef)
	// An output property that specifies the standard dynamic range version of the screenshot.
	SdrImage() coregraphics.CGImageRef
	SetSdrImage(value coregraphics.CGImageRef)
}

An interface definition for the SCScreenshotOutput class.

Instance Properties

  • [ISCScreenshotOutput.FileURL]: A URL property that specifies the location of the saved image.
  • [ISCScreenshotOutput.SetFileURL]
  • [ISCScreenshotOutput.HdrImage]: An output property that specifies the high dynamic range version of the screenshot.
  • [ISCScreenshotOutput.SetHdrImage]
  • [ISCScreenshotOutput.SdrImage]: An output property that specifies the standard dynamic range version of the screenshot.
  • [ISCScreenshotOutput.SetSdrImage]

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotOutput

type ISCShareableContent

type ISCShareableContent interface {
	objectivec.IObject

	// The windows available for capture.
	Windows() []SCWindow
	// The displays available for capture.
	Displays() []SCDisplay
	// The apps available for capture.
	Applications() []SCRunningApplication
}

An interface definition for the SCShareableContent class.

Inspecting shareable content

  • [ISCShareableContent.Windows]: The windows available for capture.
  • [ISCShareableContent.Displays]: The displays available for capture.
  • [ISCShareableContent.Applications]: The apps available for capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent

type ISCShareableContentInfo

type ISCShareableContentInfo interface {
	objectivec.IObject

	// The size and location of content for the stream.
	ContentRect() corefoundation.CGRect
	// The scaling from points to output pixel resolution for the stream.
	PointPixelScale() float32
	// The current presentation style of the stream.
	Style() SCShareableContentStyle
}

An interface definition for the SCShareableContentInfo class.

Shared content properties

  • [ISCShareableContentInfo.ContentRect]: The size and location of content for the stream.
  • [ISCShareableContentInfo.PointPixelScale]: The scaling from points to output pixel resolution for the stream.
  • [ISCShareableContentInfo.Style]: The current presentation style of the stream.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContentInfo

type ISCStream

type ISCStream interface {
	objectivec.IObject

	// Creates a stream with a content filter and configuration.
	InitWithFilterConfigurationDelegate(contentFilter ISCContentFilter, streamConfig ISCStreamConfiguration, delegate SCStreamDelegate) SCStream

	// Updates the stream with a new configuration.
	UpdateConfigurationCompletionHandler(streamConfig ISCStreamConfiguration, completionHandler ErrorHandler)
	// Updates the stream by applying a new content filter.
	UpdateContentFilterCompletionHandler(contentFilter ISCContentFilter, completionHandler ErrorHandler)

	// Adds a destination that receives the stream output.
	AddStreamOutputTypeSampleHandlerQueueError(output SCStreamOutput, type_ SCStreamOutputType, sampleHandlerQueue dispatch.Queue) (bool, error)
	// Removes a destination from receiving stream output.
	RemoveStreamOutputTypeError(output SCStreamOutput, type_ SCStreamOutputType) (bool, error)

	AddRecordingOutputError(recordingOutput ISCRecordingOutput) (bool, error)
	RemoveRecordingOutputError(recordingOutput ISCRecordingOutput) (bool, error)

	// Starts the stream with a callback to indicate whether it successfully starts.
	StartCaptureWithCompletionHandler(completionHandler ErrorHandler)
	// Stops the stream.
	StopCaptureWithCompletionHandler(completionHandler ErrorHandler)

	// A clock to use for output synchronization.
	SynchronizationClock() objectivec.IObject
}

An interface definition for the SCStream class.

Creating a stream

  • [ISCStream.InitWithFilterConfigurationDelegate]: Creates a stream with a content filter and configuration.

Updating stream configuration

  • [ISCStream.UpdateConfigurationCompletionHandler]: Updates the stream with a new configuration.
  • [ISCStream.UpdateContentFilterCompletionHandler]: Updates the stream by applying a new content filter.

Adding and removing stream output

  • [ISCStream.AddStreamOutputTypeSampleHandlerQueueError]: Adds a destination that receives the stream output.
  • [ISCStream.RemoveStreamOutputTypeError]: Removes a destination from receiving stream output.

Adding and removing recording output

  • [ISCStream.AddRecordingOutputError]
  • [ISCStream.RemoveRecordingOutputError]

Starting and stopping a stream

  • [ISCStream.StartCaptureWithCompletionHandler]: Starts the stream with a callback to indicate whether it successfully starts.
  • [ISCStream.StopCaptureWithCompletionHandler]: Stops the stream.

Stream synchronization

  • [ISCStream.SynchronizationClock]: A clock to use for output synchronization.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream

type ISCStreamConfiguration

type ISCStreamConfiguration interface {
	objectivec.IObject

	// The width of the output.
	Width() uintptr
	SetWidth(value uintptr)
	// The height of the output.
	Height() uintptr
	SetHeight(value uintptr)
	// A Boolean value that indicates whether to scale the output to fit the configured width and height.
	ScalesToFit() bool
	SetScalesToFit(value bool)
	// A rectangle that specifies the source area to capture.
	SourceRect() corefoundation.CGRect
	SetSourceRect(value corefoundation.CGRect)
	// A rectangle that specifies a destination into which to write the output.
	DestinationRect() corefoundation.CGRect
	SetDestinationRect(value corefoundation.CGRect)
	// A Boolean value that determines if the stream preserves aspect ratio.
	PreservesAspectRatio() bool
	SetPreservesAspectRatio(value bool)

	// A pixel format for sample buffers that a stream outputs.
	PixelFormat() uint32
	SetPixelFormat(value uint32)
	// A color matrix to apply to the output surface.
	ColorMatrix() corefoundation.CFStringRef
	SetColorMatrix(value corefoundation.CFStringRef)
	// A color space to use for the output buffer.
	ColorSpaceName() corefoundation.CFStringRef
	SetColorSpaceName(value corefoundation.CFStringRef)
	// A background color for the output.
	BackgroundColor() coregraphics.CGColorRef
	SetBackgroundColor(value coregraphics.CGColorRef)

	// A Boolean value that determines whether the cursor is visible in the stream.
	ShowsCursor() bool
	SetShowsCursor(value bool)
	// A Boolean value that indicates if semitransparent content presents as opaque.
	ShouldBeOpaque() bool
	SetShouldBeOpaque(value bool)
	// A Boolean value that indicates if the stream only captures shadows.
	CapturesShadowsOnly() bool
	SetCapturesShadowsOnly(value bool)
	// A Boolean value that indicates if the stream ignores the capturing of window shadows when streaming in display style.
	IgnoreShadowsDisplay() bool
	SetIgnoreShadowsDisplay(value bool)
	// A Boolean value that indicates if the stream ignores the capturing of window shadows when streaming in window style.
	IgnoreShadowsSingleWindow() bool
	SetIgnoreShadowsSingleWindow(value bool)
	// A Boolean value that indicates if the stream ignores content clipped past the edge of a display, when streaming in display style.
	IgnoreGlobalClipDisplay() bool
	SetIgnoreGlobalClipDisplay(value bool)
	// A Boolean value that indicates if the stream ignores content clipped past the edge of a display, when streaming in window style.
	IgnoreGlobalClipSingleWindow() bool
	SetIgnoreGlobalClipSingleWindow(value bool)

	// The maximum number of frames for the queue to store.
	QueueDepth() int
	SetQueueDepth(value int)
	// The desired minimum time between frame updates, in seconds.
	MinimumFrameInterval() objectivec.IObject
	SetMinimumFrameInterval(value objectivec.IObject)
	// The resolution at which to capture source content.
	CaptureResolution() SCCaptureResolutionType
	SetCaptureResolution(value SCCaptureResolutionType)

	// A Boolean value that indicates whether to capture audio.
	CapturesAudio() bool
	SetCapturesAudio(value bool)
	// The sample rate for audio capture.
	SampleRate() int
	SetSampleRate(value int)
	// The number of audio channels to capture.
	ChannelCount() int
	SetChannelCount(value int)
	// A Boolean value that indicates whether to exclude audio from your app during capture.
	ExcludesCurrentProcessAudio() bool
	SetExcludesCurrentProcessAudio(value bool)

	// A name that you provide for identifying the stream.
	StreamName() string
	SetStreamName(value string)

	// A value indicating if alerts appear to presenters while using Presenter Overlay.
	PresenterOverlayPrivacyAlertSetting() SCPresenterOverlayAlertSetting
	SetPresenterOverlayPrivacyAlertSetting(value SCPresenterOverlayAlertSetting)

	CaptureDynamicRange() SCCaptureDynamicRange
	SetCaptureDynamicRange(value SCCaptureDynamicRange)
	CaptureMicrophone() bool
	SetCaptureMicrophone(value bool)
	IncludeChildWindows() bool
	SetIncludeChildWindows(value bool)
	MicrophoneCaptureDeviceID() string
	SetMicrophoneCaptureDeviceID(value string)
	ShowMouseClicks() bool
	SetShowMouseClicks(value bool)
}

An interface definition for the SCStreamConfiguration class.

Specifying dimensions

  • [ISCStreamConfiguration.Width]: The width of the output.
  • [ISCStreamConfiguration.SetWidth]
  • [ISCStreamConfiguration.Height]: The height of the output.
  • [ISCStreamConfiguration.SetHeight]
  • [ISCStreamConfiguration.ScalesToFit]: A Boolean value that indicates whether to scale the output to fit the configured width and height.
  • [ISCStreamConfiguration.SetScalesToFit]
  • [ISCStreamConfiguration.SourceRect]: A rectangle that specifies the source area to capture.
  • [ISCStreamConfiguration.SetSourceRect]
  • [ISCStreamConfiguration.DestinationRect]: A rectangle that specifies a destination into which to write the output.
  • [ISCStreamConfiguration.SetDestinationRect]
  • [ISCStreamConfiguration.PreservesAspectRatio]: A Boolean value that determines if the stream preserves aspect ratio.
  • [ISCStreamConfiguration.SetPreservesAspectRatio]

Configuring colors

  • [ISCStreamConfiguration.PixelFormat]: A pixel format for sample buffers that a stream outputs.
  • [ISCStreamConfiguration.SetPixelFormat]
  • [ISCStreamConfiguration.ColorMatrix]: A color matrix to apply to the output surface.
  • [ISCStreamConfiguration.SetColorMatrix]
  • [ISCStreamConfiguration.ColorSpaceName]: A color space to use for the output buffer.
  • [ISCStreamConfiguration.SetColorSpaceName]
  • [ISCStreamConfiguration.BackgroundColor]: A background color for the output.
  • [ISCStreamConfiguration.SetBackgroundColor]

Configuring captured elements

  • [ISCStreamConfiguration.ShowsCursor]: A Boolean value that determines whether the cursor is visible in the stream.
  • [ISCStreamConfiguration.SetShowsCursor]
  • [ISCStreamConfiguration.ShouldBeOpaque]: A Boolean value that indicates if semitransparent content presents as opaque.
  • [ISCStreamConfiguration.SetShouldBeOpaque]
  • [ISCStreamConfiguration.CapturesShadowsOnly]: A Boolean value that indicates if the stream only captures shadows.
  • [ISCStreamConfiguration.SetCapturesShadowsOnly]
  • [ISCStreamConfiguration.IgnoreShadowsDisplay]: A Boolean value that indicates if the stream ignores the capturing of window shadows when streaming in display style.
  • [ISCStreamConfiguration.SetIgnoreShadowsDisplay]
  • [ISCStreamConfiguration.IgnoreShadowsSingleWindow]: A Boolean value that indicates if the stream ignores the capturing of window shadows when streaming in window style.
  • [ISCStreamConfiguration.SetIgnoreShadowsSingleWindow]
  • [ISCStreamConfiguration.IgnoreGlobalClipDisplay]: A Boolean value that indicates if the stream ignores content clipped past the edge of a display, when streaming in display style.
  • [ISCStreamConfiguration.SetIgnoreGlobalClipDisplay]
  • [ISCStreamConfiguration.IgnoreGlobalClipSingleWindow]: A Boolean value that indicates if the stream ignores content clipped past the edge of a display, when streaming in window style.
  • [ISCStreamConfiguration.SetIgnoreGlobalClipSingleWindow]

Configuring captured frames

  • [ISCStreamConfiguration.QueueDepth]: The maximum number of frames for the queue to store.
  • [ISCStreamConfiguration.SetQueueDepth]
  • [ISCStreamConfiguration.MinimumFrameInterval]: The desired minimum time between frame updates, in seconds.
  • [ISCStreamConfiguration.SetMinimumFrameInterval]
  • [ISCStreamConfiguration.CaptureResolution]: The resolution at which to capture source content.
  • [ISCStreamConfiguration.SetCaptureResolution]

Configuring audio

  • [ISCStreamConfiguration.CapturesAudio]: A Boolean value that indicates whether to capture audio.
  • [ISCStreamConfiguration.SetCapturesAudio]
  • [ISCStreamConfiguration.SampleRate]: The sample rate for audio capture.
  • [ISCStreamConfiguration.SetSampleRate]
  • [ISCStreamConfiguration.ChannelCount]: The number of audio channels to capture.
  • [ISCStreamConfiguration.SetChannelCount]
  • [ISCStreamConfiguration.ExcludesCurrentProcessAudio]: A Boolean value that indicates whether to exclude audio from your app during capture.
  • [ISCStreamConfiguration.SetExcludesCurrentProcessAudio]

Identifying a stream

  • [ISCStreamConfiguration.StreamName]: A name that you provide for identifying the stream.
  • [ISCStreamConfiguration.SetStreamName]

Notifying presenters

  • [ISCStreamConfiguration.PresenterOverlayPrivacyAlertSetting]: A value indicating if alerts appear to presenters while using Presenter Overlay.
  • [ISCStreamConfiguration.SetPresenterOverlayPrivacyAlertSetting]

Instance Properties

  • [ISCStreamConfiguration.CaptureDynamicRange]
  • [ISCStreamConfiguration.SetCaptureDynamicRange]
  • [ISCStreamConfiguration.CaptureMicrophone]
  • [ISCStreamConfiguration.SetCaptureMicrophone]
  • [ISCStreamConfiguration.IncludeChildWindows]
  • [ISCStreamConfiguration.SetIncludeChildWindows]
  • [ISCStreamConfiguration.MicrophoneCaptureDeviceID]
  • [ISCStreamConfiguration.SetMicrophoneCaptureDeviceID]
  • [ISCStreamConfiguration.ShowMouseClicks]
  • [ISCStreamConfiguration.SetShowMouseClicks]

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration

type ISCWindow

type ISCWindow interface {
	objectivec.IObject

	// The Core Graphics window identifier.
	WindowID() uint32
	// The string that displays in a window’s title bar.
	Title() string
	// The app that owns the window.
	OwningApplication() ISCRunningApplication
	// The layer of the window relative to other windows.
	WindowLayer() int

	// A rectangle the represents the frame of the window within a display.
	Frame() corefoundation.CGRect

	// A Boolean value that indicates whether the window is on screen.
	OnScreen() bool
	// A Boolean value that indicates if the window is currently streaming.
	Active() bool
}

An interface definition for the SCWindow class.

Identifying windows

  • [ISCWindow.WindowID]: The Core Graphics window identifier.
  • [ISCWindow.Title]: The string that displays in a window’s title bar.
  • [ISCWindow.OwningApplication]: The app that owns the window.
  • [ISCWindow.WindowLayer]: The layer of the window relative to other windows.

Accessing dimensions

  • [ISCWindow.Frame]: A rectangle the represents the frame of the window within a display.

Determining visibility

  • [ISCWindow.OnScreen]: A Boolean value that indicates whether the window is on screen.
  • [ISCWindow.Active]: A Boolean value that indicates if the window is currently streaming.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCWindow

type SCCaptureDynamicRange

type SCCaptureDynamicRange int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCCaptureDynamicRange

const (
	// SCCaptureDynamicRangeHDRCanonicalDisplay: Specifies that the system captures the screen in high dynamic range with attributes of the canonical display.
	SCCaptureDynamicRangeHDRCanonicalDisplay SCCaptureDynamicRange = 2
	// SCCaptureDynamicRangeHDRLocalDisplay: Specifies that the system captures the screen in high dynamic range with attributes of the local display.
	SCCaptureDynamicRangeHDRLocalDisplay SCCaptureDynamicRange = 1
	// SCCaptureDynamicRangeSDR: Specifies that the system captures the screen in standard dynamic range.
	SCCaptureDynamicRangeSDR SCCaptureDynamicRange = 0
)

func (SCCaptureDynamicRange) String

func (e SCCaptureDynamicRange) String() string

type SCCaptureResolutionType

type SCCaptureResolutionType int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCCaptureResolutionType

const (
	// SCCaptureResolutionAutomatic: Allow ScreenCaptureKit to automatically select the quality of content depending on factors such as network connection.
	SCCaptureResolutionAutomatic SCCaptureResolutionType = 0
	// SCCaptureResolutionBest: Capture streaming content at the best available resolution.
	SCCaptureResolutionBest SCCaptureResolutionType = 1
	// SCCaptureResolutionNominal: Capture streaming content with a one point to one pixel conversion factor.
	SCCaptureResolutionNominal SCCaptureResolutionType = 2
)

func (SCCaptureResolutionType) String

func (e SCCaptureResolutionType) String() string

type SCContentFilter

type SCContentFilter struct {
	objectivec.Object
}

An instance that filters the content a stream captures.

Overview

Use a content filter to limit an SCStream object’s output to only that matching your filter criteria. Retrieve the displays, apps, and windows that your app can capture from an instance of SCShareableContent.

Creating a filter

Filter properties

Instance Properties

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter

func NewContentFilterWithDesktopIndependentWindow

func NewContentFilterWithDesktopIndependentWindow(window ISCWindow) SCContentFilter

Creates a filter that captures only the specified window.

window: A window to capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(desktopIndependentWindow:)

func NewContentFilterWithDisplayExcludingApplicationsExceptingWindows

func NewContentFilterWithDisplayExcludingApplicationsExceptingWindows(display ISCDisplay, applications []SCRunningApplication, exceptingWindows []SCWindow) SCContentFilter

Creates a filter that captures a display, excluding windows of the specified apps.

display: A display to capture.

applications: An array of apps to exclude from capture.

exceptingWindows: An array of windows that are exceptions to the previous rules.

Discussion

The initializer arguments provide a three-stage filter that gives you fine-grained control over the output:

- Specify a display to capture. If you don’t specify additional filter criteria, the stream includes all content for a display. - Specify one or more apps with windows to exclude from the output. - Specify one or more windows that are exceptions to the previous rules. If the previous rules include a window, specifying it as an exception excludes it from the output. Likewise, if the previous rules exclude a window, specifying it as an exception includes it in the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(display:excludingApplications:exceptingWindows:)

func NewContentFilterWithDisplayExcludingWindows

func NewContentFilterWithDisplayExcludingWindows(display ISCDisplay, excluded []SCWindow) SCContentFilter

Creates a filter that captures the contents of a display, excluding the specified windows.

display: A display to capture.

excluded: An array of windows to exclude from the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(display:excludingWindows:)

func NewContentFilterWithDisplayIncludingApplicationsExceptingWindows

func NewContentFilterWithDisplayIncludingApplicationsExceptingWindows(display ISCDisplay, applications []SCRunningApplication, exceptingWindows []SCWindow) SCContentFilter

Creates a filter that captures a display, including only windows of the specified apps.

display: A display to capture.

applications: An array of apps with windows to capture.

exceptingWindows: An array of windows that are exceptions to the previous rules.

Discussion

The initializer arguments provide a three-stage filter that gives you fine-grained control over the output:

- Specify a display to capture. If you don’t specify additional filter criteria, the stream includes all content for a display. - Specify one or more apps to capture only the windows that they own. - Specify one or more windows that are exceptions to the previous rules. If the previous rules include a window, specifying it as an exception excludes it from the output. Likewise, if the previous rules exclude a window, specifying it as an exception includes it in the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(display:including:exceptingWindows:)

func NewContentFilterWithDisplayIncludingWindows

func NewContentFilterWithDisplayIncludingWindows(display ISCDisplay, includedWindows []SCWindow) SCContentFilter

Creates a filter that captures only specific windows from a display.

display: A display to capture.

includedWindows: An array of windows to include in the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(display:including:)

func NewSCContentFilter

func NewSCContentFilter() SCContentFilter

NewSCContentFilter creates a new SCContentFilter instance.

func SCContentFilterFromID

func SCContentFilterFromID(id objc.ID) SCContentFilter

SCContentFilterFromID constructs a SCContentFilter from an objc.ID.

An instance that filters the content a stream captures.

func (SCContentFilter) Autorelease

func (c SCContentFilter) Autorelease() SCContentFilter

Autorelease adds the receiver to the current autorelease pool.

func (SCContentFilter) ContentRect

func (c SCContentFilter) ContentRect() corefoundation.CGRect

The size and location of the content to filter, in screen points.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/contentRect

func (SCContentFilter) Init

Init initializes the instance.

func (SCContentFilter) InitWithDesktopIndependentWindow

func (c SCContentFilter) InitWithDesktopIndependentWindow(window ISCWindow) SCContentFilter

Creates a filter that captures only the specified window.

window: A window to capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(desktopIndependentWindow:)

func (SCContentFilter) InitWithDisplayExcludingApplicationsExceptingWindows

func (c SCContentFilter) InitWithDisplayExcludingApplicationsExceptingWindows(display ISCDisplay, applications []SCRunningApplication, exceptingWindows []SCWindow) SCContentFilter

Creates a filter that captures a display, excluding windows of the specified apps.

display: A display to capture.

applications: An array of apps to exclude from capture.

exceptingWindows: An array of windows that are exceptions to the previous rules.

Discussion

The initializer arguments provide a three-stage filter that gives you fine-grained control over the output:

- Specify a display to capture. If you don’t specify additional filter criteria, the stream includes all content for a display. - Specify one or more apps with windows to exclude from the output. - Specify one or more windows that are exceptions to the previous rules. If the previous rules include a window, specifying it as an exception excludes it from the output. Likewise, if the previous rules exclude a window, specifying it as an exception includes it in the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(display:excludingApplications:exceptingWindows:)

func (SCContentFilter) InitWithDisplayExcludingWindows

func (c SCContentFilter) InitWithDisplayExcludingWindows(display ISCDisplay, excluded []SCWindow) SCContentFilter

Creates a filter that captures the contents of a display, excluding the specified windows.

display: A display to capture.

excluded: An array of windows to exclude from the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(display:excludingWindows:)

func (SCContentFilter) InitWithDisplayIncludingApplicationsExceptingWindows

func (c SCContentFilter) InitWithDisplayIncludingApplicationsExceptingWindows(display ISCDisplay, applications []SCRunningApplication, exceptingWindows []SCWindow) SCContentFilter

Creates a filter that captures a display, including only windows of the specified apps.

display: A display to capture.

applications: An array of apps with windows to capture.

exceptingWindows: An array of windows that are exceptions to the previous rules.

Discussion

The initializer arguments provide a three-stage filter that gives you fine-grained control over the output:

- Specify a display to capture. If you don’t specify additional filter criteria, the stream includes all content for a display. - Specify one or more apps to capture only the windows that they own. - Specify one or more windows that are exceptions to the previous rules. If the previous rules include a window, specifying it as an exception excludes it from the output. Likewise, if the previous rules exclude a window, specifying it as an exception includes it in the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(display:including:exceptingWindows:)

func (SCContentFilter) InitWithDisplayIncludingWindows

func (c SCContentFilter) InitWithDisplayIncludingWindows(display ISCDisplay, includedWindows []SCWindow) SCContentFilter

Creates a filter that captures only specific windows from a display.

display: A display to capture.

includedWindows: An array of windows to include in the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/init(display:including:)

func (SCContentFilter) PointPixelScale

func (c SCContentFilter) PointPixelScale() float32

The scaling factor used to translate screen points into pixels.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/pointPixelScale

func (SCContentFilter) SetIncludeMenuBar

func (c SCContentFilter) SetIncludeMenuBar(value bool)

func (SCContentFilter) StreamType

func (c SCContentFilter) StreamType() SCStreamType

The type of the streaming content.

Discussion

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/streamType

func (SCContentFilter) Style

The display style of the sharable content.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentFilter/style

type SCContentFilterClass

type SCContentFilterClass struct {
	// contains filtered or unexported fields
}

func GetSCContentFilterClass

func GetSCContentFilterClass() SCContentFilterClass

GetSCContentFilterClass returns the class object for SCContentFilter.

func (SCContentFilterClass) Alloc

Alloc allocates memory for a new instance of the class.

type SCContentSharingPicker

type SCContentSharingPicker struct {
	objectivec.Object
}

An instance of a picker presented by the operating system for managing frame-capture streams.

Overview

Picker availability

Stream configuration

Manage observers

Picker display

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker

func NewSCContentSharingPicker

func NewSCContentSharingPicker() SCContentSharingPicker

NewSCContentSharingPicker creates a new SCContentSharingPicker instance.

func SCContentSharingPickerFromID

func SCContentSharingPickerFromID(id objc.ID) SCContentSharingPicker

SCContentSharingPickerFromID constructs a SCContentSharingPicker from an objc.ID.

An instance of a picker presented by the operating system for managing frame-capture streams.

func (SCContentSharingPicker) Active

func (c SCContentSharingPicker) Active() bool

A Boolean value that indicates if the picker is active.

Discussion

When this value is `true`, the capture stream picker is active, available for managing capture. The default value is `false`.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker/isActive

func (SCContentSharingPicker) AddObserver

Adds an observer instance to notify of changes in the content-sharing picker.

observer: The observer instance to send notifications to.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker/add(_:)

func (SCContentSharingPicker) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (SCContentSharingPicker) Configuration

Sets the configuration for the content capture picker for all streams, providing allowed selection modes and content excluded from selection.

See: https://developer.apple.com/documentation/screencapturekit/sccontentsharingpicker/configuration

func (SCContentSharingPicker) DefaultConfiguration

The default configuration to use for the content capture picker.

See: https://developer.apple.com/documentation/screencapturekit/sccontentsharingpicker/defaultconfiguration-94q2b

func (SCContentSharingPicker) Init

Init initializes the instance.

func (SCContentSharingPicker) MaximumStreamCount

func (c SCContentSharingPicker) MaximumStreamCount() int

The maximum number of streams the content capture picker allows.

See: https://developer.apple.com/documentation/screencapturekit/sccontentsharingpicker/maximumstreamcount-2kuaa

func (SCContentSharingPicker) Present

func (c SCContentSharingPicker) Present()

Displays the picker with no active selection for capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker/present()

func (SCContentSharingPicker) PresentPickerForStream

func (c SCContentSharingPicker) PresentPickerForStream(stream ISCStream)

Displays the picker with an already running capture stream.

stream: The capture stream to display in the picker.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker/present(for:)

func (SCContentSharingPicker) PresentPickerForStreamUsingContentStyle

func (c SCContentSharingPicker) PresentPickerForStreamUsingContentStyle(stream ISCStream, contentStyle SCShareableContentStyle)

Displays the picker with an existing capture stream, allowing for a single type of capture selection.

stream: The stream to display in the picker.

contentStyle: The type of streaming content selection allowed through the presented picker.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker/present(for:using:)

func (SCContentSharingPicker) PresentPickerUsingContentStyle

func (c SCContentSharingPicker) PresentPickerUsingContentStyle(contentStyle SCShareableContentStyle)

Displays the picker for a single type of capture selection.

contentStyle: The type of streaming content selection allowed through the presented picker.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker/present(using:)

func (SCContentSharingPicker) RemoveObserver

func (c SCContentSharingPicker) RemoveObserver(observer SCContentSharingPickerObserver)

Removes an observer instance from the content-sharing picker.

observer: The observer instance to remove.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker/remove(_:)

func (SCContentSharingPicker) SetActive

func (c SCContentSharingPicker) SetActive(value bool)

func (SCContentSharingPicker) SetConfiguration

func (SCContentSharingPicker) SetDefaultConfiguration

func (c SCContentSharingPicker) SetDefaultConfiguration(value ISCContentSharingPickerConfiguration)

func (SCContentSharingPicker) SetMaximumStreamCount

func (c SCContentSharingPicker) SetMaximumStreamCount(value int)

type SCContentSharingPickerClass

type SCContentSharingPickerClass struct {
	// contains filtered or unexported fields
}

func GetSCContentSharingPickerClass

func GetSCContentSharingPickerClass() SCContentSharingPickerClass

GetSCContentSharingPickerClass returns the class object for SCContentSharingPicker.

func (SCContentSharingPickerClass) Alloc

Alloc allocates memory for a new instance of the class.

func (SCContentSharingPickerClass) SharedPicker

func (_SCContentSharingPickerClass SCContentSharingPickerClass) SharedPicker() SCContentSharingPicker

The system-provided picker UI instance for capturing display and audio content from someone’s Mac.

Discussion

The picker gives a person control over what information on their Mac they wish to let your app view or record such as specific applications, displays, and windows.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPicker/shared

type SCContentSharingPickerConfiguration

type SCContentSharingPickerConfiguration struct {
	objectivec.Object
}

An instance for configuring the system content-sharing picker.

Control streaming selections

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerConfiguration-c.class

func NewSCContentSharingPickerConfiguration

func NewSCContentSharingPickerConfiguration() SCContentSharingPickerConfiguration

NewSCContentSharingPickerConfiguration creates a new SCContentSharingPickerConfiguration instance.

func SCContentSharingPickerConfigurationFromID

func SCContentSharingPickerConfigurationFromID(id objc.ID) SCContentSharingPickerConfiguration

SCContentSharingPickerConfigurationFromID constructs a SCContentSharingPickerConfiguration from an objc.ID.

An instance for configuring the system content-sharing picker.

func (SCContentSharingPickerConfiguration) AllowedPickerModes

The content-selection modes supported by the picker.

Discussion

The default value doesn’t exclude selecting any content for streaming. There isn’t an equivalent SCContentSharingPickerMode available to reset this property once changed.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerConfiguration-c.class/allowedPickerModes

func (SCContentSharingPickerConfiguration) AllowsChangingSelectedContent

func (c SCContentSharingPickerConfiguration) AllowsChangingSelectedContent() bool

A Boolean value that indicates if the present stream can change to a different source.

Discussion

The default value is `true`.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerConfiguration-c.class/allowsChangingSelectedContent

func (SCContentSharingPickerConfiguration) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (SCContentSharingPickerConfiguration) ExcludedBundleIDs

func (c SCContentSharingPickerConfiguration) ExcludedBundleIDs() []string

A list of bundle IDs to exclude from the sharing picker.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerConfiguration-c.class/excludedBundleIDs

func (SCContentSharingPickerConfiguration) ExcludedWindowIDs

A list of window IDs to exclude from the sharing picker.

Discussion

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerConfiguration-c.class/excludedWindowIDs

func (SCContentSharingPickerConfiguration) Init

Init initializes the instance.

func (SCContentSharingPickerConfiguration) SetAllowedPickerModes

func (c SCContentSharingPickerConfiguration) SetAllowedPickerModes(value SCContentSharingPickerMode)

func (SCContentSharingPickerConfiguration) SetAllowsChangingSelectedContent

func (c SCContentSharingPickerConfiguration) SetAllowsChangingSelectedContent(value bool)

func (SCContentSharingPickerConfiguration) SetExcludedBundleIDs

func (c SCContentSharingPickerConfiguration) SetExcludedBundleIDs(value []string)

func (SCContentSharingPickerConfiguration) SetExcludedWindowIDs

func (c SCContentSharingPickerConfiguration) SetExcludedWindowIDs(value []foundation.NSNumber)

type SCContentSharingPickerConfigurationClass

type SCContentSharingPickerConfigurationClass struct {
	// contains filtered or unexported fields
}

func GetSCContentSharingPickerConfigurationClass

func GetSCContentSharingPickerConfigurationClass() SCContentSharingPickerConfigurationClass

GetSCContentSharingPickerConfigurationClass returns the class object for SCContentSharingPickerConfiguration.

func (SCContentSharingPickerConfigurationClass) Alloc

Alloc allocates memory for a new instance of the class.

type SCContentSharingPickerMode

type SCContentSharingPickerMode int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerMode

const (
	// SCContentSharingPickerModeMultipleApplications: The mode allowing the selection of multiple applications through the presented picker.
	SCContentSharingPickerModeMultipleApplications SCContentSharingPickerMode = 8
	// SCContentSharingPickerModeMultipleWindows: The mode allowing the selection of multiple windows through the presented picker.
	SCContentSharingPickerModeMultipleWindows SCContentSharingPickerMode = 2
	// SCContentSharingPickerModeSingleApplication: The mode allowing the selection of a single application through the presented picker.
	SCContentSharingPickerModeSingleApplication SCContentSharingPickerMode = 4
	// SCContentSharingPickerModeSingleDisplay: The mode allowing the selection of a single display through the presented picker.
	SCContentSharingPickerModeSingleDisplay SCContentSharingPickerMode = 16
	// SCContentSharingPickerModeSingleWindow: The mode allowing the selection of a single window through the presented picker.
	SCContentSharingPickerModeSingleWindow SCContentSharingPickerMode = 1
)

func (SCContentSharingPickerMode) String

type SCContentSharingPickerObserver

type SCContentSharingPickerObserver interface {
	objectivec.IObject

	// Tells the observer that a sharing picker canceled selection for a stream.
	//
	// See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerObserver/contentSharingPicker(_:didCancelFor:)
	ContentSharingPickerDidCancelForStream(picker ISCContentSharingPicker, stream ISCStream)

	// Tells the observer that a sharing picker updated the content filter for a stream.
	//
	// See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerObserver/contentSharingPicker(_:didUpdateWith:for:)
	ContentSharingPickerDidUpdateWithFilterForStream(picker ISCContentSharingPicker, filter ISCContentFilter, stream ISCStream)

	// Tells the observer that a sharing picker was unable to start.
	//
	// See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerObserver/contentSharingPickerStartDidFailWithError(_:)
	ContentSharingPickerStartDidFailWithError(error_ foundation.INSError)
}

An observer protocol your app implements to receive messages from the operating system’s content picker.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerObserver

type SCContentSharingPickerObserverObject

type SCContentSharingPickerObserverObject struct {
	objectivec.Object
}

SCContentSharingPickerObserverObject wraps an existing Objective-C object that conforms to the SCContentSharingPickerObserver protocol.

func SCContentSharingPickerObserverObjectFromID

func SCContentSharingPickerObserverObjectFromID(id objc.ID) SCContentSharingPickerObserverObject

SCContentSharingPickerObserverObjectFromID constructs a SCContentSharingPickerObserverObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (SCContentSharingPickerObserverObject) BaseObject

func (SCContentSharingPickerObserverObject) ContentSharingPickerDidCancelForStream

func (o SCContentSharingPickerObserverObject) ContentSharingPickerDidCancelForStream(picker ISCContentSharingPicker, stream ISCStream)

Tells the observer that a sharing picker canceled selection for a stream.

picker: The content-sharing picker that sent this event.

stream: The canceled stream, if any.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerObserver/contentSharingPicker(_:didCancelFor:)

func (SCContentSharingPickerObserverObject) ContentSharingPickerDidUpdateWithFilterForStream

func (o SCContentSharingPickerObserverObject) ContentSharingPickerDidUpdateWithFilterForStream(picker ISCContentSharingPicker, filter ISCContentFilter, stream ISCStream)

Tells the observer that a sharing picker updated the content filter for a stream.

picker: The content-sharing picker that sent this event.

filter: The new filter applied to streaming content.

stream: The changed stream, if any.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerObserver/contentSharingPicker(_:didUpdateWith:for:)

func (SCContentSharingPickerObserverObject) ContentSharingPickerStartDidFailWithError

func (o SCContentSharingPickerObserverObject) ContentSharingPickerStartDidFailWithError(error_ foundation.INSError)

Tells the observer that a sharing picker was unable to start.

error: The error that caused the picker failure.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCContentSharingPickerObserver/contentSharingPickerStartDidFailWithError(_:)

type SCDisplay

type SCDisplay struct {
	objectivec.Object
}

An instance that represents a display device.

Overview

A display object represents a physical display connected to a Mac. Query the display to retrieve its unique identifier and onscreen coordinates.

Retrieve the available displays from an instance of SCShareableContent. Select a display to capture and use it to create an instance of SCContentFilter. Apply the filter to an instance of SCStream to limit its output to content matching your criteria.

Identifying displays

Accessing dimensions

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCDisplay

func NewSCDisplay

func NewSCDisplay() SCDisplay

NewSCDisplay creates a new SCDisplay instance.

func SCDisplayFromID

func SCDisplayFromID(id objc.ID) SCDisplay

SCDisplayFromID constructs a SCDisplay from an objc.ID.

An instance that represents a display device.

func (SCDisplay) Autorelease

func (d SCDisplay) Autorelease() SCDisplay

Autorelease adds the receiver to the current autorelease pool.

func (SCDisplay) DisplayID

func (d SCDisplay) DisplayID() uint32

The Core Graphics display identifier.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCDisplay/displayID

func (SCDisplay) Height

func (d SCDisplay) Height() int

The height of the display in points.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCDisplay/height

func (SCDisplay) Init

func (d SCDisplay) Init() SCDisplay

Init initializes the instance.

func (SCDisplay) Width

func (d SCDisplay) Width() int

The width of the display in points.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCDisplay/width

type SCDisplayClass

type SCDisplayClass struct {
	// contains filtered or unexported fields
}

func GetSCDisplayClass

func GetSCDisplayClass() SCDisplayClass

GetSCDisplayClass returns the class object for SCDisplay.

func (SCDisplayClass) Alloc

func (sc SCDisplayClass) Alloc() SCDisplay

Alloc allocates memory for a new instance of the class.

type SCFrameStatus

type SCFrameStatus int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCFrameStatus

const (
	// SCFrameStatusBlank: A status that indicates the system didn’t generate a new frame because the display is blank.
	SCFrameStatusBlank SCFrameStatus = 2
	// SCFrameStatusComplete: A status that indicates the system successfully generated a new frame.
	SCFrameStatusComplete SCFrameStatus = 0
	// SCFrameStatusIdle: A status that indicates the system didn’t generate a new frame because the display didn’t change.
	SCFrameStatusIdle SCFrameStatus = 1
	// SCFrameStatusStarted: A status that indicates the frame is the first one sent after the stream starts.
	SCFrameStatusStarted SCFrameStatus = 4
	// SCFrameStatusStopped: A status that indicates the frame is in a stopped state.
	SCFrameStatusStopped SCFrameStatus = 5
	// SCFrameStatusSuspended: A status that indicates the system didn’t generate a new frame because you suspended updates.
	SCFrameStatusSuspended SCFrameStatus = 3
)

func (SCFrameStatus) String

func (e SCFrameStatus) String() string

type SCPresenterOverlayAlertSetting

type SCPresenterOverlayAlertSetting int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCPresenterOverlayAlertSetting

const (
	// SCPresenterOverlayAlertSettingAlways: Always display an alert when using Presenter Overlay.
	SCPresenterOverlayAlertSettingAlways SCPresenterOverlayAlertSetting = 2
	// SCPresenterOverlayAlertSettingNever: Never display an alert when using Presenter Overlay.
	SCPresenterOverlayAlertSettingNever SCPresenterOverlayAlertSetting = 1
	// SCPresenterOverlayAlertSettingSystem: Displays an alert when using Presenter Overlay based on the System Settings.
	SCPresenterOverlayAlertSettingSystem SCPresenterOverlayAlertSetting = 0
)

func (SCPresenterOverlayAlertSetting) String

type SCRecordingOutput

type SCRecordingOutput struct {
	objectivec.Object
}

Creating a recording output

Configuring the recording output

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRecordingOutput

func NewSCRecordingOutput

func NewSCRecordingOutput() SCRecordingOutput

NewSCRecordingOutput creates a new SCRecordingOutput instance.

func SCRecordingOutputFromID

func SCRecordingOutputFromID(id objc.ID) SCRecordingOutput

SCRecordingOutputFromID constructs a SCRecordingOutput from an objc.ID.

func (SCRecordingOutput) Autorelease

func (r SCRecordingOutput) Autorelease() SCRecordingOutput

Autorelease adds the receiver to the current autorelease pool.

func (SCRecordingOutput) Init

Init initializes the instance.

type SCRecordingOutputClass

type SCRecordingOutputClass struct {
	// contains filtered or unexported fields
}

func GetSCRecordingOutputClass

func GetSCRecordingOutputClass() SCRecordingOutputClass

GetSCRecordingOutputClass returns the class object for SCRecordingOutput.

func (SCRecordingOutputClass) Alloc

Alloc allocates memory for a new instance of the class.

type SCRecordingOutputConfiguration

type SCRecordingOutputConfiguration struct {
	objectivec.Object
}

Instance Properties

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRecordingOutputConfiguration

func NewSCRecordingOutputConfiguration

func NewSCRecordingOutputConfiguration() SCRecordingOutputConfiguration

NewSCRecordingOutputConfiguration creates a new SCRecordingOutputConfiguration instance.

func SCRecordingOutputConfigurationFromID

func SCRecordingOutputConfigurationFromID(id objc.ID) SCRecordingOutputConfiguration

SCRecordingOutputConfigurationFromID constructs a SCRecordingOutputConfiguration from an objc.ID.

func (SCRecordingOutputConfiguration) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (SCRecordingOutputConfiguration) Init

Init initializes the instance.

func (SCRecordingOutputConfiguration) SetOutputFileType

func (r SCRecordingOutputConfiguration) SetOutputFileType(value foundation.NSString)

func (SCRecordingOutputConfiguration) SetOutputURL

func (r SCRecordingOutputConfiguration) SetOutputURL(value foundation.INSURL)

func (SCRecordingOutputConfiguration) SetVideoCodecType

func (r SCRecordingOutputConfiguration) SetVideoCodecType(value foundation.NSString)

type SCRecordingOutputConfigurationClass

type SCRecordingOutputConfigurationClass struct {
	// contains filtered or unexported fields
}

func GetSCRecordingOutputConfigurationClass

func GetSCRecordingOutputConfigurationClass() SCRecordingOutputConfigurationClass

GetSCRecordingOutputConfigurationClass returns the class object for SCRecordingOutputConfiguration.

func (SCRecordingOutputConfigurationClass) Alloc

Alloc allocates memory for a new instance of the class.

type SCRecordingOutputDelegate

type SCRecordingOutputDelegate interface {
	objectivec.IObject
}

SCRecordingOutputDelegate protocol.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRecordingOutputDelegate

type SCRecordingOutputDelegateConfig

type SCRecordingOutputDelegateConfig struct {

	// Instance Methods
	RecordingOutputDidFailWithError   func(recordingOutput SCRecordingOutput, error_ foundation.NSError)
	RecordingOutputDidFinishRecording func(recordingOutput SCRecordingOutput)
	RecordingOutputDidStartRecording  func(recordingOutput SCRecordingOutput)
}

SCRecordingOutputDelegateConfig holds optional typed callbacks for SCRecordingOutputDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.

See Apple Documentation for protocol details.

type SCRecordingOutputDelegateObject

type SCRecordingOutputDelegateObject struct {
	objectivec.Object
}

SCRecordingOutputDelegateObject wraps an existing Objective-C object that conforms to the SCRecordingOutputDelegate protocol.

func NewSCRecordingOutputDelegate

func NewSCRecordingOutputDelegate(config SCRecordingOutputDelegateConfig) SCRecordingOutputDelegateObject

NewSCRecordingOutputDelegate creates an Objective-C object implementing the SCRecordingOutputDelegate protocol.

Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.

The returned SCRecordingOutputDelegateObject satisfies the SCRecordingOutputDelegate interface and can be passed directly to SetDelegate and similar methods.

See Apple Documentation for protocol details.

func SCRecordingOutputDelegateObjectFromID

func SCRecordingOutputDelegateObjectFromID(id objc.ID) SCRecordingOutputDelegateObject

SCRecordingOutputDelegateObjectFromID constructs a SCRecordingOutputDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (SCRecordingOutputDelegateObject) BaseObject

type SCRunningApplication

type SCRunningApplication struct {
	objectivec.Object
}

An instance that represents an app running on a device.

Overview

Retrieve the available apps from an instance of SCShareableContent. Select one or more apps to capture and use them to create an instance of SCContentFilter. Apply the filter to an instance of SCStream to limit its output to content matching your criteria.

Inspecting an app

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRunningApplication

func NewSCRunningApplication

func NewSCRunningApplication() SCRunningApplication

NewSCRunningApplication creates a new SCRunningApplication instance.

func SCRunningApplicationFromID

func SCRunningApplicationFromID(id objc.ID) SCRunningApplication

SCRunningApplicationFromID constructs a SCRunningApplication from an objc.ID.

An instance that represents an app running on a device.

func (SCRunningApplication) ApplicationName

func (r SCRunningApplication) ApplicationName() string

The display name of the app.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRunningApplication/applicationName

func (SCRunningApplication) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (SCRunningApplication) BundleIdentifier

func (r SCRunningApplication) BundleIdentifier() string

The unique bundle identifier of the app.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRunningApplication/bundleIdentifier

func (SCRunningApplication) Init

Init initializes the instance.

func (SCRunningApplication) ProcessID

func (r SCRunningApplication) ProcessID() int32

The system process identifier of the app.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCRunningApplication/processID

type SCRunningApplicationClass

type SCRunningApplicationClass struct {
	// contains filtered or unexported fields
}

func GetSCRunningApplicationClass

func GetSCRunningApplicationClass() SCRunningApplicationClass

GetSCRunningApplicationClass returns the class object for SCRunningApplication.

func (SCRunningApplicationClass) Alloc

Alloc allocates memory for a new instance of the class.

type SCScreenshotConfiguration

type SCScreenshotConfiguration struct {
	objectivec.Object
}

An object that contains screenshot properties such as output width, height, and image quality specifications.

Overview

SCScreenshotConfiguration provides a default image capture configuration for SCScreenshotManager. Only configure its properties if you need to customize the output. Additional options for customization include dynamic range settings, image reproduction optimizations, and ignoring user interface elements.

Instance Properties

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration

func NewSCScreenshotConfiguration

func NewSCScreenshotConfiguration() SCScreenshotConfiguration

NewSCScreenshotConfiguration creates a new SCScreenshotConfiguration instance.

func SCScreenshotConfigurationFromID

func SCScreenshotConfigurationFromID(id objc.ID) SCScreenshotConfiguration

SCScreenshotConfigurationFromID constructs a SCScreenshotConfiguration from an objc.ID.

An object that contains screenshot properties such as output width, height, and image quality specifications.

func (SCScreenshotConfiguration) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (SCScreenshotConfiguration) ContentType

A uniform type identifier that specifies the screenshot’s file format; HEIC, JPEG, or PNG.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/contentType

func (SCScreenshotConfiguration) DestinationRect

func (s SCScreenshotConfiguration) DestinationRect() corefoundation.CGRect

A rectangle that specifies whether to output screenshots in a subset of the output image.

Discussion

If you don’t specify a destination rectangle, the system uses the full dimensions of the output surface. The rectangle is specified in pixels in the display’s coordinate system.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/destinationRect

func (SCScreenshotConfiguration) DisplayIntent

Specifies whether the screen capture uses attributes of the local or canonical display.

Discussion

Performing a screenshot with either the local or canonical display attributes optimizes output for presentation on either the capture display or any high dynamic range display respectively.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/displayIntent-swift.property

func (SCScreenshotConfiguration) DynamicRange

Specifies the type of image returned to the client; standard dynamic range, high dynamic range, or both.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/dynamicRange-swift.property

func (SCScreenshotConfiguration) FileURL

Specifies the URL where the screenshot process saves the output.

Discussion

If `imageOutputURL` is `nil`, then the file isn’t saved.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/fileURL

func (SCScreenshotConfiguration) Height

func (s SCScreenshotConfiguration) Height() int

An integer value that specifies the output height, measured in pixels.

Discussion

The default value is the height of the captured content.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/height

func (SCScreenshotConfiguration) IgnoreClipping

func (s SCScreenshotConfiguration) IgnoreClipping() bool

A Boolean value that specifies whether to ignore framing on windows when using content filters.

Discussion

Use [SCNPropertyFilter] in conjunction with this property to ignore window framing on specified apps and windows. Setting this value to `true` ignores shadows.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/ignoreClipping

func (SCScreenshotConfiguration) IgnoreShadows

func (s SCScreenshotConfiguration) IgnoreShadows() bool

A Boolean value that specifies whether to ignore framing on windows.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/ignoreShadows

func (SCScreenshotConfiguration) IncludeChildWindows

func (s SCScreenshotConfiguration) IncludeChildWindows() bool

A Boolean that specifies whether the screenshot captures subwindows of the included apps and windows.

Discussion

By default taking a screenshot captures subwindows. For example, alerts, popovers, and sheets are captured by default.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/includeChildWindows

func (SCScreenshotConfiguration) Init

Init initializes the instance.

func (SCScreenshotConfiguration) SetContentType

func (SCScreenshotConfiguration) SetDestinationRect

func (s SCScreenshotConfiguration) SetDestinationRect(value corefoundation.CGRect)

func (SCScreenshotConfiguration) SetDisplayIntent

func (s SCScreenshotConfiguration) SetDisplayIntent(value SCScreenshotDisplayIntent)

func (SCScreenshotConfiguration) SetDynamicRange

func (s SCScreenshotConfiguration) SetDynamicRange(value SCScreenshotDynamicRange)

func (SCScreenshotConfiguration) SetFileURL

func (s SCScreenshotConfiguration) SetFileURL(value foundation.INSURL)

func (SCScreenshotConfiguration) SetHeight

func (s SCScreenshotConfiguration) SetHeight(value int)

func (SCScreenshotConfiguration) SetIgnoreClipping

func (s SCScreenshotConfiguration) SetIgnoreClipping(value bool)

func (SCScreenshotConfiguration) SetIgnoreShadows

func (s SCScreenshotConfiguration) SetIgnoreShadows(value bool)

func (SCScreenshotConfiguration) SetIncludeChildWindows

func (s SCScreenshotConfiguration) SetIncludeChildWindows(value bool)

func (SCScreenshotConfiguration) SetShowsCursor

func (s SCScreenshotConfiguration) SetShowsCursor(value bool)

func (SCScreenshotConfiguration) SetSourceRect

func (s SCScreenshotConfiguration) SetSourceRect(value corefoundation.CGRect)

func (SCScreenshotConfiguration) SetWidth

func (s SCScreenshotConfiguration) SetWidth(value int)

func (SCScreenshotConfiguration) ShowsCursor

func (s SCScreenshotConfiguration) ShowsCursor() bool

A Boolean value that specifies whether the pointer appears in the screenshot.

Discussion

By default the pointer is visible in screenshots.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/showsCursor

func (SCScreenshotConfiguration) SourceRect

A rectangle that specifies that the screenshot only samples a subset of the frame input.

Discussion

If not set, the screenshot captures the entire frame. Specify the rectangle in points in the display’s logical coordinate system.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/sourceRect

func (SCScreenshotConfiguration) Width

func (s SCScreenshotConfiguration) Width() int

An integer value that specifies the output width in pixels.

Discussion

The default value is the width of the captured content.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/width

type SCScreenshotConfigurationClass

type SCScreenshotConfigurationClass struct {
	// contains filtered or unexported fields
}

func GetSCScreenshotConfigurationClass

func GetSCScreenshotConfigurationClass() SCScreenshotConfigurationClass

GetSCScreenshotConfigurationClass returns the class object for SCScreenshotConfiguration.

func (SCScreenshotConfigurationClass) Alloc

Alloc allocates memory for a new instance of the class.

func (SCScreenshotConfigurationClass) SupportedContentTypes

func (_SCScreenshotConfigurationClass SCScreenshotConfigurationClass) SupportedContentTypes() []uniformtypeidentifiers.UTType

An array of uniform type identifiers that correspond to file formats the output image supports.

Discussion

You can save the output CGImage into HEIC, JPEG, and PNG formats.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/supportedContentTypes

type SCScreenshotDisplayIntent

type SCScreenshotDisplayIntent int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/DisplayIntent-swift.enum

const (
	// SCScreenshotDisplayIntentCanonical: Specifies that the screenshot renders with canonical display attributes optimizing output for presentation on a high dynamic range display.
	SCScreenshotDisplayIntentCanonical SCScreenshotDisplayIntent = 0
	// SCScreenshotDisplayIntentLocal: Specifies that the screenshot renders with local display attributes optimizing output for presentation on the capture display.
	SCScreenshotDisplayIntentLocal SCScreenshotDisplayIntent = 1
)

func (SCScreenshotDisplayIntent) String

func (e SCScreenshotDisplayIntent) String() string

type SCScreenshotDynamicRange

type SCScreenshotDynamicRange int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotConfiguration/DynamicRange-swift.enum

const (
	// SCScreenshotDynamicRangeHDR: Returns a high dynamic range image to the client.
	SCScreenshotDynamicRangeHDR SCScreenshotDynamicRange = 1
	// SCScreenshotDynamicRangeSDR: Returns a standard dynamic range image to the client.
	SCScreenshotDynamicRangeSDR SCScreenshotDynamicRange = 0
	// SCScreenshotDynamicRangeSDRAndHDR: Returns both standard dynamic range and high dynamic range image versions to the client.
	SCScreenshotDynamicRangeSDRAndHDR SCScreenshotDynamicRange = 2
)

func (SCScreenshotDynamicRange) String

func (e SCScreenshotDynamicRange) String() string

type SCScreenshotManager

type SCScreenshotManager struct {
	objectivec.Object
}

An instance for the capture of single frames from a stream.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotManager

func NewSCScreenshotManager

func NewSCScreenshotManager() SCScreenshotManager

NewSCScreenshotManager creates a new SCScreenshotManager instance.

func SCScreenshotManagerFromID

func SCScreenshotManagerFromID(id objc.ID) SCScreenshotManager

SCScreenshotManagerFromID constructs a SCScreenshotManager from an objc.ID.

An instance for the capture of single frames from a stream.

func (SCScreenshotManager) Autorelease

func (s SCScreenshotManager) Autorelease() SCScreenshotManager

Autorelease adds the receiver to the current autorelease pool.

func (SCScreenshotManager) Init

Init initializes the instance.

type SCScreenshotManagerClass

type SCScreenshotManagerClass struct {
	// contains filtered or unexported fields
}

func GetSCScreenshotManagerClass

func GetSCScreenshotManagerClass() SCScreenshotManagerClass

GetSCScreenshotManagerClass returns the class object for SCScreenshotManager.

func (SCScreenshotManagerClass) Alloc

Alloc allocates memory for a new instance of the class.

func (SCScreenshotManagerClass) CaptureImageInRect

CaptureImageInRect is a synchronous wrapper around [SCScreenshotManager.CaptureImageInRectCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCScreenshotManagerClass) CaptureImageInRectCompletionHandler

func (_SCScreenshotManagerClass SCScreenshotManagerClass) CaptureImageInRectCompletionHandler(rect corefoundation.CGRect, completionHandler CGImageRefErrorHandler)

rect: The rect for the region in points on the screen space for the screen shot, this is display agnostic and supports multiple displays

completionHandler: Is the handler that will deliver the screenshot to the client

Discussion

captureImageInRect:completionHandler:

this method returns an image containing the contents of the rectangle in points, specified in display space

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotManager/captureImage(in:completionHandler:)

func (SCScreenshotManagerClass) CaptureImageWithFilterConfiguration

func (sc SCScreenshotManagerClass) CaptureImageWithFilterConfiguration(ctx context.Context, contentFilter ISCContentFilter, config ISCStreamConfiguration) (coregraphics.CGImageRef, error)

CaptureImageWithFilterConfiguration is a synchronous wrapper around [SCScreenshotManager.CaptureImageWithFilterConfigurationCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCScreenshotManagerClass) CaptureImageWithFilterConfigurationCompletionHandler

func (_SCScreenshotManagerClass SCScreenshotManagerClass) CaptureImageWithFilterConfigurationCompletionHandler(contentFilter ISCContentFilter, config ISCStreamConfiguration, completionHandler CGImageRefErrorHandler)

Captures a single frame from a stream as an image, using a filter.

contentFilter: The content filter used to select the stream.

config: Configuration information for how to capture the screenshot.

completionHandler: Closure that processes the screenshot taken from the streaming content.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotManager/captureImage(contentFilter:configuration:completionHandler:)

func (SCScreenshotManagerClass) CaptureSampleBufferWithFilterConfiguration

func (sc SCScreenshotManagerClass) CaptureSampleBufferWithFilterConfiguration(ctx context.Context, contentFilter ISCContentFilter, config ISCStreamConfiguration) (objectivec.IObject, error)

CaptureSampleBufferWithFilterConfiguration is a synchronous wrapper around [SCScreenshotManager.CaptureSampleBufferWithFilterConfigurationCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCScreenshotManagerClass) CaptureSampleBufferWithFilterConfigurationCompletionHandler

func (_SCScreenshotManagerClass SCScreenshotManagerClass) CaptureSampleBufferWithFilterConfigurationCompletionHandler(contentFilter ISCContentFilter, config ISCStreamConfiguration, completionHandler CMSampleBufferRefErrorHandler)

Captures a single frame directly from a stream’s buffer, using a filter.

contentFilter: The content filter used to select the stream.

config: Configuration information for how to record the stream buffer.

completionHandler: Closure that processes the capture taken from streaming content.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotManager/captureSampleBuffer(contentFilter:configuration:completionHandler:)

func (SCScreenshotManagerClass) CaptureScreenshotWithFilterConfiguration

func (sc SCScreenshotManagerClass) CaptureScreenshotWithFilterConfiguration(ctx context.Context, contentFilter ISCContentFilter, config ISCScreenshotConfiguration) (*SCScreenshotOutput, error)

CaptureScreenshotWithFilterConfiguration is a synchronous wrapper around [SCScreenshotManager.CaptureScreenshotWithFilterConfigurationCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCScreenshotManagerClass) CaptureScreenshotWithFilterConfigurationCompletionHandler

func (_SCScreenshotManagerClass SCScreenshotManagerClass) CaptureScreenshotWithFilterConfigurationCompletionHandler(contentFilter ISCContentFilter, config ISCScreenshotConfiguration, completionHandler SCScreenshotOutputErrorHandler)

contentFilter: Is the filter containing the content to take a screenshot of

config: Is the screenshot configuration containing information on how to format the screenshot

completionHandler: Is the handler that will deliver the SCScreenshotOutput object to the client

Discussion

captureScreenshotWithFilter:configuration:completionHandler:

this method returns an SCScreenshotOutput object containing CGImages of the screenshot requested by the client

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotManager/captureScreenshot(contentFilter:configuration:completionHandler:)

func (SCScreenshotManagerClass) CaptureScreenshotWithRectConfiguration

func (sc SCScreenshotManagerClass) CaptureScreenshotWithRectConfiguration(ctx context.Context, rect corefoundation.CGRect, config ISCScreenshotConfiguration) (*SCScreenshotOutput, error)

CaptureScreenshotWithRectConfiguration is a synchronous wrapper around [SCScreenshotManager.CaptureScreenshotWithRectConfigurationCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCScreenshotManagerClass) CaptureScreenshotWithRectConfigurationCompletionHandler

func (_SCScreenshotManagerClass SCScreenshotManagerClass) CaptureScreenshotWithRectConfigurationCompletionHandler(rect corefoundation.CGRect, config ISCScreenshotConfiguration, completionHandler SCScreenshotOutputErrorHandler)

rect: The rect for the region in points on the screen space for the screen shot, this is display agnostic and supports multiple displays

config: Is the screenshot configuration containing information on how to format the screenshot

completionHandler: Is the handler that will deliver the SCScreenshotOutput object to the client

Discussion

captureScreenshotWithRect:configuration:completionHandler:

this method returns an SCScreenshotOutput object containing CGImages of the screenshot requested by the client

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotManager/captureScreenshot(rect:configuration:completionHandler:)

type SCScreenshotOutput

type SCScreenshotOutput struct {
	objectivec.Object
}

An object that contains all images requested by the client.

Instance Properties

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotOutput

func NewSCScreenshotOutput

func NewSCScreenshotOutput() SCScreenshotOutput

NewSCScreenshotOutput creates a new SCScreenshotOutput instance.

func SCScreenshotOutputFromID

func SCScreenshotOutputFromID(id objc.ID) SCScreenshotOutput

SCScreenshotOutputFromID constructs a SCScreenshotOutput from an objc.ID.

An object that contains all images requested by the client.

func (SCScreenshotOutput) Autorelease

func (s SCScreenshotOutput) Autorelease() SCScreenshotOutput

Autorelease adds the receiver to the current autorelease pool.

func (SCScreenshotOutput) FileURL

func (s SCScreenshotOutput) FileURL() foundation.INSURL

A URL property that specifies the location of the saved image.

Discussion

If `fileURL` is `nil`, then the file isn’t saved.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotOutput/fileURL

func (SCScreenshotOutput) HdrImage

An output property that specifies the high dynamic range version of the screenshot.

Discussion

The output CGImage uses the extended sRGB color space.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotOutput/hdrImage

func (SCScreenshotOutput) Init

Init initializes the instance.

func (SCScreenshotOutput) SdrImage

An output property that specifies the standard dynamic range version of the screenshot.

Discussion

The output CGImage uses the same color space as the content capture display.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCScreenshotOutput/sdrImage

func (SCScreenshotOutput) SetFileURL

func (s SCScreenshotOutput) SetFileURL(value foundation.INSURL)

func (SCScreenshotOutput) SetHdrImage

func (s SCScreenshotOutput) SetHdrImage(value coregraphics.CGImageRef)

func (SCScreenshotOutput) SetSdrImage

func (s SCScreenshotOutput) SetSdrImage(value coregraphics.CGImageRef)

type SCScreenshotOutputClass

type SCScreenshotOutputClass struct {
	// contains filtered or unexported fields
}

func GetSCScreenshotOutputClass

func GetSCScreenshotOutputClass() SCScreenshotOutputClass

GetSCScreenshotOutputClass returns the class object for SCScreenshotOutput.

func (SCScreenshotOutputClass) Alloc

Alloc allocates memory for a new instance of the class.

type SCScreenshotOutputErrorHandler

type SCScreenshotOutputErrorHandler = func(*SCScreenshotOutput, error)

SCScreenshotOutputErrorHandler handles Is the handler that will deliver the SCScreenshotOutput object to the client The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [SCScreenshotManager.CaptureScreenshotWithFilterConfigurationCompletionHandler]
  • [SCScreenshotManager.CaptureScreenshotWithRectConfigurationCompletionHandler]

type SCShareableContent

type SCShareableContent struct {
	objectivec.Object
}

An instance that represents a set of displays, apps, and windows that your app can capture.

Overview

Use the SCShareableContent.Displays, SCShareableContent.Windows, and SCShareableContent.Applications properties to create a SCContentFilter object that specifies what display content to capture. You apply the filter to an instance of SCStream to limit its output to only the content matching your filter.

Inspecting shareable content

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent

func NewSCShareableContent

func NewSCShareableContent() SCShareableContent

NewSCShareableContent creates a new SCShareableContent instance.

func SCShareableContentFromID

func SCShareableContentFromID(id objc.ID) SCShareableContent

SCShareableContentFromID constructs a SCShareableContent from an objc.ID.

An instance that represents a set of displays, apps, and windows that your app can capture.

func (SCShareableContent) Applications

func (s SCShareableContent) Applications() []SCRunningApplication

The apps available for capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent/applications

func (SCShareableContent) Autorelease

func (s SCShareableContent) Autorelease() SCShareableContent

Autorelease adds the receiver to the current autorelease pool.

func (SCShareableContent) Displays

func (s SCShareableContent) Displays() []SCDisplay

The displays available for capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent/displays

func (SCShareableContent) Init

Init initializes the instance.

func (SCShareableContent) Windows

func (s SCShareableContent) Windows() []SCWindow

The windows available for capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent/windows

type SCShareableContentClass

type SCShareableContentClass struct {
	// contains filtered or unexported fields
}

func GetSCShareableContentClass

func GetSCShareableContentClass() SCShareableContentClass

GetSCShareableContentClass returns the class object for SCShareableContent.

func (SCShareableContentClass) Alloc

Alloc allocates memory for a new instance of the class.

func (SCShareableContentClass) GetCurrentProcessShareableContent

func (sc SCShareableContentClass) GetCurrentProcessShareableContent(ctx context.Context) (*SCShareableContent, error)

GetCurrentProcessShareableContent is a synchronous wrapper around [SCShareableContent.GetCurrentProcessShareableContentWithCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCShareableContentClass) GetShareableContent

func (sc SCShareableContentClass) GetShareableContent(ctx context.Context) (*SCShareableContent, error)

GetShareableContent is a synchronous wrapper around [SCShareableContent.GetShareableContentWithCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnly

func (sc SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnly(ctx context.Context, excludeDesktopWindows bool, onScreenWindowsOnly bool) (*SCShareableContent, error)

GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnly is a synchronous wrapper around [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyAboveWindow

func (sc SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyAboveWindow(ctx context.Context, excludeDesktopWindows bool, window ISCWindow) (*SCShareableContent, error)

GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyAboveWindow is a synchronous wrapper around [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyAboveWindowCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyAboveWindowCompletionHandler

func (_SCShareableContentClass SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyAboveWindowCompletionHandler(excludeDesktopWindows bool, window ISCWindow, completionHandler SCShareableContentErrorHandler)

Retrieves the displays, apps, and windows that are in front of the specified window.

excludeDesktopWindows: A Boolean value that indicates whether to exclude desktop windows like Finder, Dock, and Desktop from the set of shareable content.

window: The window above which to retrieve shareable content.

completionHandler: A callback the system invokes with the shareable content, or an error if a failure occurs.

Discussion

Use this method to retrieve the onscreen content matching your filtering criteria. If the call is successful, the system passes an SCShareableContent instance to the completion handler; otherwise, it returns an error that describes the failure.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent/getExcludingDesktopWindows(_:onScreenWindowsOnlyAbove:completionHandler:)

func (SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyBelowWindow

func (sc SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyBelowWindow(ctx context.Context, excludeDesktopWindows bool, window ISCWindow) (*SCShareableContent, error)

GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyBelowWindow is a synchronous wrapper around [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyBelowWindowCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.

func (SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyBelowWindowCompletionHandler

func (_SCShareableContentClass SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyBelowWindowCompletionHandler(excludeDesktopWindows bool, window ISCWindow, completionHandler SCShareableContentErrorHandler)

Retrieves the displays, apps, and windows that are behind the specified window.

excludeDesktopWindows: A Boolean value that indicates whether to exclude desktop windows from the set of shareable content.

window: The window above which to retrieve shareable content.

completionHandler: A callback the system invokes with the shareable content, or an error if a failure occurs.

Discussion

Use this method to retrieve the onscreen content matching your filtering criteria. If the call is successful, the system passes an SCShareableContent instance to the completion handler; otherwise, it returns an error that describes the failure.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent/getExcludingDesktopWindows(_:onScreenWindowsOnlyBelow:completionHandler:)

func (SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyCompletionHandler

func (_SCShareableContentClass SCShareableContentClass) GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyCompletionHandler(excludeDesktopWindows bool, onScreenWindowsOnly bool, completionHandler SCShareableContentErrorHandler)

Retrieves the displays, apps, and windows that match your criteria.

excludeDesktopWindows: A Boolean value that indicates whether to exclude desktop windows like Finder, Dock, and Desktop from the set of shareable content.

onScreenWindowsOnly: A Boolean value that indicates whether to include only onscreen windows in the set of shareable content.

completionHandler: A callback the system invokes with the shareable content, or an error if a failure occurs.

Discussion

Use this method to retrieve the onscreen content matching your filtering criteria. If the call is successful, the system passes an SCShareableContent instance to the completion handler; otherwise, it returns an error that describes the failure.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent/getExcludingDesktopWindows(_:onScreenWindowsOnly:completionHandler:)

func (SCShareableContentClass) GetShareableContentWithCompletionHandler

func (_SCShareableContentClass SCShareableContentClass) GetShareableContentWithCompletionHandler(completionHandler SCShareableContentErrorHandler)

Retrieves the displays, apps, and windows that your app can capture.

completionHandler: A callback the system invokes with the shareable content, or an error if a failure occurs.

Discussion

Use this method to retrieve the onscreen content that your app can capture. If the call is successful, the system returns the shareable content to the completion handler; otherwise, it returns an error that describes the failure.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent/getWithCompletionHandler(_:)

func (SCShareableContentClass) InfoForFilter

func (_SCShareableContentClass SCShareableContentClass) InfoForFilter(filter ISCContentFilter) SCShareableContentInfo

Retrieves any available sharable content information that matches the provided filter.

filter: The filter to match current sharable content against.

Return Value

The sharable content matching the filter, or `nil` if none is found.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContent/info(for:)

type SCShareableContentErrorHandler

type SCShareableContentErrorHandler = func(*SCShareableContent, error)

SCShareableContentErrorHandler handles A callback the system invokes with the shareable content, or an error if a failure occurs. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [SCShareableContent.GetCurrentProcessShareableContentWithCompletionHandler]
  • [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyAboveWindowCompletionHandler]
  • [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyBelowWindowCompletionHandler]
  • [SCShareableContent.GetShareableContentExcludingDesktopWindowsOnScreenWindowsOnlyCompletionHandler]
  • [SCShareableContent.GetShareableContentWithCompletionHandler]

type SCShareableContentInfo

type SCShareableContentInfo struct {
	objectivec.Object
}

An instance that provides information for the content in a given stream.

Shared content properties

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContentInfo

func NewSCShareableContentInfo

func NewSCShareableContentInfo() SCShareableContentInfo

NewSCShareableContentInfo creates a new SCShareableContentInfo instance.

func SCShareableContentInfoFromID

func SCShareableContentInfoFromID(id objc.ID) SCShareableContentInfo

SCShareableContentInfoFromID constructs a SCShareableContentInfo from an objc.ID.

An instance that provides information for the content in a given stream.

func (SCShareableContentInfo) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (SCShareableContentInfo) ContentRect

The size and location of content for the stream.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContentInfo/contentRect

func (SCShareableContentInfo) Init

Init initializes the instance.

func (SCShareableContentInfo) PointPixelScale

func (s SCShareableContentInfo) PointPixelScale() float32

The scaling from points to output pixel resolution for the stream.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContentInfo/pointPixelScale

func (SCShareableContentInfo) Style

The current presentation style of the stream.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContentInfo/style

type SCShareableContentInfoClass

type SCShareableContentInfoClass struct {
	// contains filtered or unexported fields
}

func GetSCShareableContentInfoClass

func GetSCShareableContentInfoClass() SCShareableContentInfoClass

GetSCShareableContentInfoClass returns the class object for SCShareableContentInfo.

func (SCShareableContentInfoClass) Alloc

Alloc allocates memory for a new instance of the class.

type SCShareableContentStyle

type SCShareableContentStyle int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCShareableContentStyle

const (
	// SCShareableContentStyleApplication: The stream is currently presenting one or more applications.
	SCShareableContentStyleApplication SCShareableContentStyle = 3
	// SCShareableContentStyleDisplay: The stream is currently presenting a complete display.
	SCShareableContentStyleDisplay SCShareableContentStyle = 2
	// SCShareableContentStyleNone: The stream isn’t currently presenting any content.
	SCShareableContentStyleNone SCShareableContentStyle = 0
	// SCShareableContentStyleWindow: The stream is currently presenting one or more windows.
	SCShareableContentStyleWindow SCShareableContentStyle = 1
)

func (SCShareableContentStyle) String

func (e SCShareableContentStyle) String() string

type SCStream

type SCStream struct {
	objectivec.Object
}

An instance that represents a stream of shareable content.

Overview

Use a stream to capture video of screen content like apps and windows. Create a content stream by passing it an instance of SCContentFilter and an SCStreamConfiguration object. The stream uses the filter to determine which screen content to capture, and uses the configuration data to configure the output.

Creating a stream

Updating stream configuration

Adding and removing stream output

Adding and removing recording output

Starting and stopping a stream

Stream synchronization

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream

func NewSCStream

func NewSCStream() SCStream

NewSCStream creates a new SCStream instance.

func NewStreamWithFilterConfigurationDelegate

func NewStreamWithFilterConfigurationDelegate(contentFilter ISCContentFilter, streamConfig ISCStreamConfiguration, delegate SCStreamDelegate) SCStream

Creates a stream with a content filter and configuration.

contentFilter: The content to capture.

streamConfig: The configuration to apply to the stream.

delegate: An optional object that responds to stream events.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/init(filter:configuration:delegate:)

func SCStreamFromID

func SCStreamFromID(id objc.ID) SCStream

SCStreamFromID constructs a SCStream from an objc.ID.

An instance that represents a stream of shareable content.

func (SCStream) AddStreamOutputTypeSampleHandlerQueueError

func (s SCStream) AddStreamOutputTypeSampleHandlerQueueError(output SCStreamOutput, type_ SCStreamOutputType, sampleHandlerQueue dispatch.Queue) (bool, error)

Adds a destination that receives the stream output.

output: The object that conforms to the stream output protocol.

type: The stream output type.

sampleHandlerQueue: The queue that receives the stream output.

Discussion

Use this method to attach an object that conforms to SCStreamOutput to receive stream content. Optionally, provide a DispatchQueue to send output to a queue that’s responsible for processing the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/addStreamOutput(_:type:sampleHandlerQueue:)

func (SCStream) Autorelease

func (s SCStream) Autorelease() SCStream

Autorelease adds the receiver to the current autorelease pool.

func (SCStream) Init

func (s SCStream) Init() SCStream

Init initializes the instance.

func (SCStream) InitWithFilterConfigurationDelegate

func (s SCStream) InitWithFilterConfigurationDelegate(contentFilter ISCContentFilter, streamConfig ISCStreamConfiguration, delegate SCStreamDelegate) SCStream

Creates a stream with a content filter and configuration.

contentFilter: The content to capture.

streamConfig: The configuration to apply to the stream.

delegate: An optional object that responds to stream events.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/init(filter:configuration:delegate:)

func (SCStream) RemoveStreamOutputTypeError

func (s SCStream) RemoveStreamOutputTypeError(output SCStreamOutput, type_ SCStreamOutputType) (bool, error)

Removes a destination from receiving stream output.

output: The object to remove that conforms to the stream output protocol.

type: The stream output type.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/removeStreamOutput(_:type:)

func (SCStream) StartCapture

func (s SCStream) StartCapture(ctx context.Context) error

StartCapture is a synchronous wrapper around SCStream.StartCaptureWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (SCStream) StartCaptureWithCompletionHandler

func (s SCStream) StartCaptureWithCompletionHandler(completionHandler ErrorHandler)

Starts the stream with a callback to indicate whether it successfully starts.

completionHandler: A completion handler that provides an error if the stream fails to start.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/startCapture(completionHandler:)

func (SCStream) StopCapture

func (s SCStream) StopCapture(ctx context.Context) error

StopCapture is a synchronous wrapper around SCStream.StopCaptureWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (SCStream) StopCaptureWithCompletionHandler

func (s SCStream) StopCaptureWithCompletionHandler(completionHandler ErrorHandler)

Stops the stream.

completionHandler: A completion handler that provides an error if the stream fails to stop.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/stopCapture(completionHandler:)

func (SCStream) SynchronizationClock

func (s SCStream) SynchronizationClock() objectivec.IObject

A clock to use for output synchronization.

Discussion

The synchronization clock provides the timebase for sample buffers that the stream outputs. Use it to synchronize with the clocks of other media sources, such as the synchronizationClock of AVCaptureSession.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/synchronizationClock

func (SCStream) UpdateConfiguration

func (s SCStream) UpdateConfiguration(ctx context.Context, streamConfig ISCStreamConfiguration) error

UpdateConfiguration is a synchronous wrapper around SCStream.UpdateConfigurationCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (SCStream) UpdateConfigurationCompletionHandler

func (s SCStream) UpdateConfigurationCompletionHandler(streamConfig ISCStreamConfiguration, completionHandler ErrorHandler)

Updates the stream with a new configuration.

streamConfig: An object that provides the updated stream configuration.

completionHandler: A completion handler the system calls when this method completes. It includes an error if the update fails.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/updateConfiguration(_:completionHandler:)

func (SCStream) UpdateContentFilter

func (s SCStream) UpdateContentFilter(ctx context.Context, contentFilter ISCContentFilter) error

UpdateContentFilter is a synchronous wrapper around SCStream.UpdateContentFilterCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (SCStream) UpdateContentFilterCompletionHandler

func (s SCStream) UpdateContentFilterCompletionHandler(contentFilter ISCContentFilter, completionHandler ErrorHandler)

Updates the stream by applying a new content filter.

contentFilter: The content filter to apply.

completionHandler: A completion handler the system calls when this method completes. It includes an error if the update fails.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStream/updateContentFilter(_:completionHandler:)

type SCStreamClass

type SCStreamClass struct {
	// contains filtered or unexported fields
}

func GetSCStreamClass

func GetSCStreamClass() SCStreamClass

GetSCStreamClass returns the class object for SCStream.

func (SCStreamClass) Alloc

func (sc SCStreamClass) Alloc() SCStream

Alloc allocates memory for a new instance of the class.

type SCStreamConfiguration

type SCStreamConfiguration struct {
	objectivec.Object
}

An instance that provides the output configuration for a stream.

Overview

Creating an instance of this class provides a default configuration for a stream. Only configure its properties if you need to customize the output.

Specifying dimensions

Configuring colors

Configuring captured elements

Configuring captured frames

Configuring audio

Identifying a stream

Notifying presenters

Instance Properties

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration

func NewSCStreamConfiguration

func NewSCStreamConfiguration() SCStreamConfiguration

NewSCStreamConfiguration creates a new SCStreamConfiguration instance.

func SCStreamConfigurationFromID

func SCStreamConfigurationFromID(id objc.ID) SCStreamConfiguration

SCStreamConfigurationFromID constructs a SCStreamConfiguration from an objc.ID.

An instance that provides the output configuration for a stream.

func (SCStreamConfiguration) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (SCStreamConfiguration) CaptureResolution

func (s SCStreamConfiguration) CaptureResolution() SCCaptureResolutionType

The resolution at which to capture source content.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/captureResolution

func (SCStreamConfiguration) CapturesAudio

func (s SCStreamConfiguration) CapturesAudio() bool

A Boolean value that indicates whether to capture audio.

Discussion

A stream doesn’t capture audio by default. Set this value to true if you require audio capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/capturesAudio

func (SCStreamConfiguration) CapturesShadowsOnly

func (s SCStreamConfiguration) CapturesShadowsOnly() bool

A Boolean value that indicates if the stream only captures shadows.

Discussion

The default value is `false`.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/capturesShadowsOnly

func (SCStreamConfiguration) ChannelCount

func (s SCStreamConfiguration) ChannelCount() int

The number of audio channels to capture.

Discussion

The framework supports channel counts of `1` (mono) or `2` (stereo). If you don’t specify a channel count, or specify an unsupported value, the system defaults to stereo audio capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/channelCount

func (SCStreamConfiguration) ColorMatrix

A color matrix to apply to the output surface.

Discussion

You can specify a value for this property if your pixel format is `420v` or `420f`. The value must be one of the strings specified in Display Stream YCbCr to RGB conversion Matrix Options.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/colorMatrix

func (SCStreamConfiguration) ColorSpaceName

A color space to use for the output buffer.

Discussion

If you don’t specify a value, the output buffer uses the same color space as the display. If you specify a value, if must be one of the strings specified in CGColorSpace.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/colorSpaceName

func (SCStreamConfiguration) DestinationRect

func (s SCStreamConfiguration) DestinationRect() corefoundation.CGRect

A rectangle that specifies a destination into which to write the output.

Discussion

If you don’t specify a destination rectangle, the system uses the full dimensions of the output surface.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/destinationRect

func (SCStreamConfiguration) ExcludesCurrentProcessAudio

func (s SCStreamConfiguration) ExcludesCurrentProcessAudio() bool

A Boolean value that indicates whether to exclude audio from your app during capture.

Discussion

The default value is false. If you include your app process in the stream output, you can set this value to true to exclude its audio.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/excludesCurrentProcessAudio

func (SCStreamConfiguration) Height

func (s SCStreamConfiguration) Height() uintptr

The height of the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/height

func (SCStreamConfiguration) IgnoreGlobalClipDisplay

func (s SCStreamConfiguration) IgnoreGlobalClipDisplay() bool

A Boolean value that indicates if the stream ignores content clipped past the edge of a display, when streaming in display style.

Discussion

The display that originates the stream determines clipping bounds. When this value is `true`, the stream contains content moved past the clipping bounds. The default value is `false`.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/ignoreGlobalClipDisplay

func (SCStreamConfiguration) IgnoreGlobalClipSingleWindow

func (s SCStreamConfiguration) IgnoreGlobalClipSingleWindow() bool

A Boolean value that indicates if the stream ignores content clipped past the edge of a display, when streaming in window style.

Discussion

The display that originates the stream determines clipping bounds. When this value is `true`, the stream contains content moved past the clipping bounds. The default value is `false`.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/ignoreGlobalClipSingleWindow

func (SCStreamConfiguration) IgnoreShadowsDisplay

func (s SCStreamConfiguration) IgnoreShadowsDisplay() bool

A Boolean value that indicates if the stream ignores the capturing of window shadows when streaming in display style.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/ignoreShadowsDisplay

func (SCStreamConfiguration) IgnoreShadowsSingleWindow

func (s SCStreamConfiguration) IgnoreShadowsSingleWindow() bool

A Boolean value that indicates if the stream ignores the capturing of window shadows when streaming in window style.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/ignoreShadowsSingleWindow

func (SCStreamConfiguration) Init

Init initializes the instance.

func (SCStreamConfiguration) MinimumFrameInterval

func (s SCStreamConfiguration) MinimumFrameInterval() objectivec.IObject

The desired minimum time between frame updates, in seconds.

Discussion

Use this value to throttle the rate at which you receive updates. The default value is `0`, which indicates that the system uses the maximum supported frame rate.

You specify the minimum frame interval as the reciprocal of the maximum frame rate. For example, to configure the stream to capture at 60 fps, specify a minimum frame interval equal to `1/60`.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/minimumFrameInterval

func (SCStreamConfiguration) PixelFormat

func (s SCStreamConfiguration) PixelFormat() uint32

A pixel format for sample buffers that a stream outputs.

Discussion

A stream supports the following pixel formats:

[BGRA]: Packed little endian ARGB8888. `l10r`: Packed little endian ARGB2101010. `420v`: Two-plane “video” range YCbCr 4:2:0. `420f`: Two-plane “full” range YCbCr 4:2:0.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/pixelFormat

func (SCStreamConfiguration) PresenterOverlayPrivacyAlertSetting

func (s SCStreamConfiguration) PresenterOverlayPrivacyAlertSetting() SCPresenterOverlayAlertSetting

A value indicating if alerts appear to presenters while using Presenter Overlay.

Discussion

The default value is SCPresenterOverlayAlertSetting.system.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/presenterOverlayPrivacyAlertSetting

func (SCStreamConfiguration) PreservesAspectRatio

func (s SCStreamConfiguration) PreservesAspectRatio() bool

A Boolean value that determines if the stream preserves aspect ratio.

Discussion

The default value is `true`.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/preservesAspectRatio

func (SCStreamConfiguration) QueueDepth

func (s SCStreamConfiguration) QueueDepth() int

The maximum number of frames for the queue to store.

Discussion

By default, the system sets the queue depth to its minimum value of three frames. Specifying more frames uses more memory, but may allow you to process frame data without stalling the display stream.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/queueDepth

func (SCStreamConfiguration) SampleRate

func (s SCStreamConfiguration) SampleRate() int

The sample rate for audio capture.

Discussion

The framework supports sample rates of `8000`, `16000`, `24000`, and `48000`. If you don’t specify a sample rate, or specify an unsupported value, the system uses a default sample rate of 48 kHz.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/sampleRate

func (SCStreamConfiguration) ScalesToFit

func (s SCStreamConfiguration) ScalesToFit() bool

A Boolean value that indicates whether to scale the output to fit the configured width and height.

Discussion

The system uses this value during independent window capture.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/scalesToFit

func (SCStreamConfiguration) SetBackgroundColor

func (s SCStreamConfiguration) SetBackgroundColor(value coregraphics.CGColorRef)

func (SCStreamConfiguration) SetCaptureDynamicRange

func (s SCStreamConfiguration) SetCaptureDynamicRange(value SCCaptureDynamicRange)

func (SCStreamConfiguration) SetCaptureMicrophone

func (s SCStreamConfiguration) SetCaptureMicrophone(value bool)

func (SCStreamConfiguration) SetCaptureResolution

func (s SCStreamConfiguration) SetCaptureResolution(value SCCaptureResolutionType)

func (SCStreamConfiguration) SetCapturesAudio

func (s SCStreamConfiguration) SetCapturesAudio(value bool)

func (SCStreamConfiguration) SetCapturesShadowsOnly

func (s SCStreamConfiguration) SetCapturesShadowsOnly(value bool)

func (SCStreamConfiguration) SetChannelCount

func (s SCStreamConfiguration) SetChannelCount(value int)

func (SCStreamConfiguration) SetColorMatrix

func (s SCStreamConfiguration) SetColorMatrix(value corefoundation.CFStringRef)

func (SCStreamConfiguration) SetColorSpaceName

func (s SCStreamConfiguration) SetColorSpaceName(value corefoundation.CFStringRef)

func (SCStreamConfiguration) SetDestinationRect

func (s SCStreamConfiguration) SetDestinationRect(value corefoundation.CGRect)

func (SCStreamConfiguration) SetExcludesCurrentProcessAudio

func (s SCStreamConfiguration) SetExcludesCurrentProcessAudio(value bool)

func (SCStreamConfiguration) SetHeight

func (s SCStreamConfiguration) SetHeight(value uintptr)

func (SCStreamConfiguration) SetIgnoreGlobalClipDisplay

func (s SCStreamConfiguration) SetIgnoreGlobalClipDisplay(value bool)

func (SCStreamConfiguration) SetIgnoreGlobalClipSingleWindow

func (s SCStreamConfiguration) SetIgnoreGlobalClipSingleWindow(value bool)

func (SCStreamConfiguration) SetIgnoreShadowsDisplay

func (s SCStreamConfiguration) SetIgnoreShadowsDisplay(value bool)

func (SCStreamConfiguration) SetIgnoreShadowsSingleWindow

func (s SCStreamConfiguration) SetIgnoreShadowsSingleWindow(value bool)

func (SCStreamConfiguration) SetIncludeChildWindows

func (s SCStreamConfiguration) SetIncludeChildWindows(value bool)

func (SCStreamConfiguration) SetMicrophoneCaptureDeviceID

func (s SCStreamConfiguration) SetMicrophoneCaptureDeviceID(value string)

func (SCStreamConfiguration) SetMinimumFrameInterval

func (s SCStreamConfiguration) SetMinimumFrameInterval(value objectivec.IObject)

func (SCStreamConfiguration) SetPixelFormat

func (s SCStreamConfiguration) SetPixelFormat(value uint32)

func (SCStreamConfiguration) SetPresenterOverlayPrivacyAlertSetting

func (s SCStreamConfiguration) SetPresenterOverlayPrivacyAlertSetting(value SCPresenterOverlayAlertSetting)

func (SCStreamConfiguration) SetPreservesAspectRatio

func (s SCStreamConfiguration) SetPreservesAspectRatio(value bool)

func (SCStreamConfiguration) SetQueueDepth

func (s SCStreamConfiguration) SetQueueDepth(value int)

func (SCStreamConfiguration) SetSampleRate

func (s SCStreamConfiguration) SetSampleRate(value int)

func (SCStreamConfiguration) SetScalesToFit

func (s SCStreamConfiguration) SetScalesToFit(value bool)

func (SCStreamConfiguration) SetShouldBeOpaque

func (s SCStreamConfiguration) SetShouldBeOpaque(value bool)

func (SCStreamConfiguration) SetShowMouseClicks

func (s SCStreamConfiguration) SetShowMouseClicks(value bool)

func (SCStreamConfiguration) SetShowsCursor

func (s SCStreamConfiguration) SetShowsCursor(value bool)

func (SCStreamConfiguration) SetSourceRect

func (s SCStreamConfiguration) SetSourceRect(value corefoundation.CGRect)

func (SCStreamConfiguration) SetStreamName

func (s SCStreamConfiguration) SetStreamName(value string)

func (SCStreamConfiguration) SetWidth

func (s SCStreamConfiguration) SetWidth(value uintptr)

func (SCStreamConfiguration) ShouldBeOpaque

func (s SCStreamConfiguration) ShouldBeOpaque() bool

A Boolean value that indicates if semitransparent content presents as opaque.

Discussion

When this property is `true`, semitransparent content in the stream presents as backed by a solid white background, making the resulting image fully opaque. The default value is `false`.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/shouldBeOpaque

func (SCStreamConfiguration) ShowsCursor

func (s SCStreamConfiguration) ShowsCursor() bool

A Boolean value that determines whether the cursor is visible in the stream.

Discussion

The cursor is visible by default.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/showsCursor

func (SCStreamConfiguration) SourceRect

A rectangle that specifies the source area to capture.

Discussion

If you don’t specify a source rectangle to capture, the system captures the entire display.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/sourceRect

func (SCStreamConfiguration) StreamName

func (s SCStreamConfiguration) StreamName() string

A name that you provide for identifying the stream.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/streamName

func (SCStreamConfiguration) Width

func (s SCStreamConfiguration) Width() uintptr

The width of the output.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/width

type SCStreamConfigurationClass

type SCStreamConfigurationClass struct {
	// contains filtered or unexported fields
}

func GetSCStreamConfigurationClass

func GetSCStreamConfigurationClass() SCStreamConfigurationClass

GetSCStreamConfigurationClass returns the class object for SCStreamConfiguration.

func (SCStreamConfigurationClass) Alloc

Alloc allocates memory for a new instance of the class.

type SCStreamConfigurationPreset

type SCStreamConfigurationPreset int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamConfiguration/Preset

const (
	SCStreamConfigurationPresetCaptureHDRRecordingPreservedSDRHDR10 SCStreamConfigurationPreset = 4
	SCStreamConfigurationPresetCaptureHDRScreenshotCanonicalDisplay SCStreamConfigurationPreset = 3
	SCStreamConfigurationPresetCaptureHDRScreenshotLocalDisplay     SCStreamConfigurationPreset = 2
	SCStreamConfigurationPresetCaptureHDRStreamCanonicalDisplay     SCStreamConfigurationPreset = 1
	SCStreamConfigurationPresetCaptureHDRStreamLocalDisplay         SCStreamConfigurationPreset = 0
)

func (SCStreamConfigurationPreset) String

type SCStreamDelegate

type SCStreamDelegate interface {
	objectivec.IObject
}

A delegate protocol your app implements to respond to stream events.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamDelegate

type SCStreamDelegateConfig

type SCStreamDelegateConfig struct {

	// Responding to stream stoppage
	// StreamDidStopWithError — Tells the delegate that the stream stopped with an error.
	StreamDidStopWithError func(stream SCStream, error_ foundation.NSError)

	// Instance Methods
	StreamDidBecomeActive   func(stream SCStream)
	StreamDidBecomeInactive func(stream SCStream)

	// Other Methods
	// OutputVideoEffectDidStartForStream — Tells the delegate that Presenter Overlay started.
	OutputVideoEffectDidStartForStream func(stream SCStream)
	// OutputVideoEffectDidStopForStream — Tells the delegate that Presenter Overlay stopped.
	OutputVideoEffectDidStopForStream func(stream SCStream)
}

SCStreamDelegateConfig holds optional typed callbacks for SCStreamDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.

See Apple Documentation for protocol details.

type SCStreamDelegateObject

type SCStreamDelegateObject struct {
	objectivec.Object
}

SCStreamDelegateObject wraps an existing Objective-C object that conforms to the SCStreamDelegate protocol.

func NewSCStreamDelegate

func NewSCStreamDelegate(config SCStreamDelegateConfig) SCStreamDelegateObject

NewSCStreamDelegate creates an Objective-C object implementing the SCStreamDelegate protocol.

Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.

The returned SCStreamDelegateObject satisfies the SCStreamDelegate interface and can be passed directly to SetDelegate and similar methods.

See Apple Documentation for protocol details.

func SCStreamDelegateObjectFromID

func SCStreamDelegateObjectFromID(id objc.ID) SCStreamDelegateObject

SCStreamDelegateObjectFromID constructs a SCStreamDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (SCStreamDelegateObject) BaseObject

func (o SCStreamDelegateObject) BaseObject() objectivec.Object

func (SCStreamDelegateObject) OutputVideoEffectDidStartForStream

func (o SCStreamDelegateObject) OutputVideoEffectDidStartForStream(stream ISCStream)

Tells the delegate that Presenter Overlay started.

stream: The stream using Presenter Overlay.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamDelegate/outputVideoEffectDidStart(for:)

func (SCStreamDelegateObject) OutputVideoEffectDidStopForStream

func (o SCStreamDelegateObject) OutputVideoEffectDidStopForStream(stream ISCStream)

Tells the delegate that Presenter Overlay stopped.

stream: The stream that was using Presenter Overlay.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamDelegate/outputVideoEffectDidStop(for:)

func (SCStreamDelegateObject) StreamDidBecomeActive

func (o SCStreamDelegateObject) StreamDidBecomeActive(stream ISCStream)

stream: The SCStream object

Discussion

streamDidBecomeActive:

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:.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamDelegate/streamDidBecomeActive(_:)

func (SCStreamDelegateObject) StreamDidBecomeInactive

func (o SCStreamDelegateObject) StreamDidBecomeInactive(stream ISCStream)

stream: The SCStream object

Discussion

streamDidBecomeInactive:

notifies the delegate that all the windows that are currently being shared are exited. This callback occurs for all content filter types.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamDelegate/streamDidBecomeInactive(_:)

func (SCStreamDelegateObject) StreamDidStopWithError

func (o SCStreamDelegateObject) StreamDidStopWithError(stream ISCStream, error_ foundation.INSError)

Tells the delegate that the stream stopped with an error.

stream: The stream that stopped.

error: The error that caused the stream stoppage.

Discussion

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamDelegate/stream(_:didStopWithError:)

type SCStreamErrorCode

type SCStreamErrorCode int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamError/Code

const (
	// SCStreamErrorAttemptToConfigState: An error message that indicates a stream couldn’t update its configuration.
	SCStreamErrorAttemptToConfigState SCStreamErrorCode = -3810
	// SCStreamErrorAttemptToStartStreamState: An error message that indicates a stream is already running or doesn’t exist when trying to start a stream.
	SCStreamErrorAttemptToStartStreamState SCStreamErrorCode = -3807
	// SCStreamErrorAttemptToStopStreamState: An error message that indicates a stream is already stopped or doesn’t exist when trying to stop a stream.
	SCStreamErrorAttemptToStopStreamState SCStreamErrorCode = -3808
	// SCStreamErrorAttemptToUpdateFilterState: An error message that indicates a stream couldn’t update its content filter.
	SCStreamErrorAttemptToUpdateFilterState SCStreamErrorCode = -3809
	// SCStreamErrorFailedApplicationConnectionInterrupted: An error message that indicates there was an interruption in a connection to an app.
	SCStreamErrorFailedApplicationConnectionInterrupted SCStreamErrorCode = -3805
	// SCStreamErrorFailedApplicationConnectionInvalid: An error message that indicates the stream lost its connection to an app.
	SCStreamErrorFailedApplicationConnectionInvalid SCStreamErrorCode = -3804
	// SCStreamErrorFailedNoMatchingApplicationContext: An error message that indicates there isn’t a matching app context for streaming.
	SCStreamErrorFailedNoMatchingApplicationContext SCStreamErrorCode = -3806
	// SCStreamErrorFailedToStart: An error message that indicates a stream failed to start.
	SCStreamErrorFailedToStart SCStreamErrorCode = -3802
	// SCStreamErrorFailedToStartAudioCapture: An error message that indicates an audio stream failed to start.
	SCStreamErrorFailedToStartAudioCapture SCStreamErrorCode = -3818
	// SCStreamErrorFailedToStartMicrophoneCapture: An error message that indicates microphone capture failed to start.
	SCStreamErrorFailedToStartMicrophoneCapture SCStreamErrorCode = -3820
	// SCStreamErrorFailedToStopAudioCapture: An error message that indicates an audio stream failed to stop.
	SCStreamErrorFailedToStopAudioCapture SCStreamErrorCode = -3819
	// SCStreamErrorInternalError: An error message that indicates a stream can’t start due to a failure in ScreenCaptureKit’s internals.
	SCStreamErrorInternalError SCStreamErrorCode = -3811
	// SCStreamErrorInvalidParameter: An error message that indicates an operation failed because of an invalid parameter value.
	SCStreamErrorInvalidParameter SCStreamErrorCode = -3812
	// SCStreamErrorMissingEntitlements: An error message that indicates missing entitlements in your app.
	SCStreamErrorMissingEntitlements SCStreamErrorCode = -3803
	// SCStreamErrorNoCaptureSource: An error message that indicates a stream doesn’t have a source to capture.
	SCStreamErrorNoCaptureSource SCStreamErrorCode = -3815
	// SCStreamErrorNoDisplayList: An error message that indicates a stream doesn’t have displays available.
	SCStreamErrorNoDisplayList SCStreamErrorCode = -3814
	// SCStreamErrorNoWindowList: An error message that indicates a stream doesn’t have windows available.
	SCStreamErrorNoWindowList SCStreamErrorCode = -3813
	// SCStreamErrorRemovingStream: An error message that indicates a stream wasn’t removed.
	SCStreamErrorRemovingStream SCStreamErrorCode = -3816
	// SCStreamErrorSystemStoppedStream: An error message that indicates the system stopped the stream.
	SCStreamErrorSystemStoppedStream SCStreamErrorCode = -3821
	// SCStreamErrorUserDeclined: An error message that indicates the user didn’t grant Screen Recording permission to your app.
	SCStreamErrorUserDeclined SCStreamErrorCode = -3801
	// SCStreamErrorUserStopped: An error message that indicates the user stopped the stream.
	SCStreamErrorUserStopped SCStreamErrorCode = -3817
)

func (SCStreamErrorCode) String

func (e SCStreamErrorCode) String() string

type SCStreamFrameInfo

type SCStreamFrameInfo = string

SCStreamFrameInfo is an instance that defines metadata keys for a stream frame.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamFrameInfo

type SCStreamOutput

type SCStreamOutput interface {
	objectivec.IObject
}

A delegate protocol your app implements to receive capture stream output events.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamOutput

type SCStreamOutputObject

type SCStreamOutputObject struct {
	objectivec.Object
}

SCStreamOutputObject wraps an existing Objective-C object that conforms to the SCStreamOutput protocol.

func SCStreamOutputObjectFromID

func SCStreamOutputObjectFromID(id objc.ID) SCStreamOutputObject

SCStreamOutputObjectFromID constructs a SCStreamOutputObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (SCStreamOutputObject) BaseObject

func (o SCStreamOutputObject) BaseObject() objectivec.Object

func (SCStreamOutputObject) StreamDidOutputSampleBufferOfType

func (o SCStreamOutputObject) StreamDidOutputSampleBufferOfType(stream ISCStream, sampleBuffer objectivec.IObject, type_ SCStreamOutputType)

Tells the delegate that a capture stream produced a frame.

stream: The frame capture stream that produced this frame.

sampleBuffer: The sample buffer containing capture data.

type: The type of capture contained in the sample buffer.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamOutput/stream(_:didOutputSampleBuffer:of:)

type SCStreamOutputType

type SCStreamOutputType int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamOutputType

const (
	// SCStreamOutputTypeAudio: An output type that represents an audio capture sample buffer.
	SCStreamOutputTypeAudio SCStreamOutputType = 1
	// SCStreamOutputTypeScreen: An output type that represents a screen capture sample buffer.
	SCStreamOutputTypeScreen SCStreamOutputType = 0
)

func (SCStreamOutputType) String

func (e SCStreamOutputType) String() string

type SCStreamType

type SCStreamType int

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCStreamType

const (
	// SCStreamTypeDisplay: The stream is currently on a complete display.
	SCStreamTypeDisplay SCStreamType = 1
	// SCStreamTypeWindow: The stream is currently presented as a window.
	SCStreamTypeWindow SCStreamType = 0
)

func (SCStreamType) String

func (e SCStreamType) String() string

type SCWindow

type SCWindow struct {
	objectivec.Object
}

An instance that represents an onscreen window.

Overview

Retrieve the available windows from an instance of SCShareableContent. Select one or more windows to capture and use them to create an instance of SCContentFilter. Apply the filter to an instance of SCStream to limit its output to content matching your criteria.

Identifying windows

Accessing dimensions

  • SCWindow.Frame: A rectangle the represents the frame of the window within a display.

Determining visibility

  • SCWindow.OnScreen: A Boolean value that indicates whether the window is on screen.
  • SCWindow.Active: A Boolean value that indicates if the window is currently streaming.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCWindow

func NewSCWindow

func NewSCWindow() SCWindow

NewSCWindow creates a new SCWindow instance.

func SCWindowFromID

func SCWindowFromID(id objc.ID) SCWindow

SCWindowFromID constructs a SCWindow from an objc.ID.

An instance that represents an onscreen window.

func (SCWindow) Active

func (w SCWindow) Active() bool

A Boolean value that indicates if the window is currently streaming.

Discussion

When this value is `true`, the window is currently streaming, even if offscreen.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCWindow/isActive

func (SCWindow) Autorelease

func (w SCWindow) Autorelease() SCWindow

Autorelease adds the receiver to the current autorelease pool.

func (SCWindow) Frame

func (w SCWindow) Frame() corefoundation.CGRect

A rectangle the represents the frame of the window within a display.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCWindow/frame

func (SCWindow) Init

func (w SCWindow) Init() SCWindow

Init initializes the instance.

func (SCWindow) OnScreen

func (w SCWindow) OnScreen() bool

A Boolean value that indicates whether the window is on screen.

Discussion

This value represents the macOS window server’s onscreen status of the window.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCWindow/isOnScreen

func (SCWindow) Title

func (w SCWindow) Title() string

The string that displays in a window’s title bar.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCWindow/title

func (SCWindow) WindowID

func (w SCWindow) WindowID() uint32

The Core Graphics window identifier.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCWindow/windowID

func (SCWindow) WindowLayer

func (w SCWindow) WindowLayer() int

The layer of the window relative to other windows.

See: https://developer.apple.com/documentation/ScreenCaptureKit/SCWindow/windowLayer

type SCWindowClass

type SCWindowClass struct {
	// contains filtered or unexported fields
}

func GetSCWindowClass

func GetSCWindowClass() SCWindowClass

GetSCWindowClass returns the class object for SCWindow.

func (SCWindowClass) Alloc

func (sc SCWindowClass) Alloc() SCWindow

Alloc allocates memory for a new instance of the class.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL