Documentation
¶
Overview ¶
Package sck captures a macOS display with ScreenCaptureKit through purego, with no cgo. ScreenCaptureKit calls back on a GCD serial queue thread; the callback runs Go code directly on that foreign thread.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoDisplay = errors.New("sck: display not in shareable content")
ErrNoDisplay means the display is not in ScreenCaptureKit's shareable content (disconnected, or the process lacks Screen Recording permission).
Functions ¶
Types ¶
type Sample ¶
type Sample struct {
Pixels uintptr
DisplayTime int64 // mach-clock ns when the frame was shown
Delivered int64 // mach-clock ns when the callback started
}
Sample is one delivered frame. Pixels is a retained CVPixelBufferRef that the receiver must release with apple.CFRelease.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func Open ¶
Open starts capturing the main display scaled to width x height at up to fps, in pixel format (vt.PixelBGRA or vt.Pixel420v).
func OpenDisplay ¶
OpenDisplay is Open for the display with this CGDirectDisplayID.
func (*Source) Next ¶
Next adapts NextSample to capture.Source. Presented and Acquired are mach-clock nanoseconds.
func (*Source) NextSample ¶
NextSample waits for the next complete frame.