Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ScreenCaptureKit] Implement Xcode 16.2 beta 1-3 changes. #21730

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ScreenCaptureKit/SCContentFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace ScreenCaptureKit {
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("tvos")]
[SupportedOSPlatform ("macos12.3")]
[UnsupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("maccatalyst18.2")]
public enum SCContentFilterOption {
/// <summary>The specified windows or applications are included in the filter.</summary>
Include,
Expand Down
1 change: 1 addition & 0 deletions src/build/dotnet/generator-frameworks.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ partial class Frameworks {
"ReplayKit",
"SafariServices",
"SceneKit",
"ScreenCaptureKit",
"ScreenTime",
"Security",
"SensitiveContentAnalysis",
Expand Down
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2523,6 +2523,7 @@ MACCATALYST_FRAMEWORKS = \
QuickLookThumbnailing \
ReplayKit \
SafariServices \
ScreenCaptureKit \
ScreenTime \
Security \
SensitiveContentAnalysis \
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/maccatalyst-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
-d:HAS_REPLAYKIT
-d:HAS_SAFARISERVICES
-d:HAS_SCENEKIT
-d:HAS_SCREENCAPTUREKIT
-d:HAS_SCREENTIME
-d:HAS_SECURITY
-d:HAS_SENSITIVECONTENTANALYSIS
Expand Down
88 changes: 60 additions & 28 deletions src/screencapturekit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace ScreenCaptureKit {

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[ErrorDomain ("SCStreamErrorDomain")]
[Native]
enum SCStreamErrorCode : long {
Expand All @@ -50,7 +50,7 @@ enum SCStreamErrorCode : long {
SystemStoppedStream = -3821,
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[Native]
enum SCFrameStatus : long {
Complete,
Expand All @@ -61,7 +61,7 @@ enum SCFrameStatus : long {
Stopped,
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[Native]
enum SCStreamOutputType : long {
Screen,
Expand All @@ -79,23 +79,23 @@ public enum SCStreamType : long {
Display,
}

[NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[Native]
public enum SCPresenterOverlayAlertSetting : long {
System,
Never,
Always,
}

[NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[Native]
public enum SCCaptureResolutionType : long {
Automatic,
Best,
Nominal,
}

[Flags, NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
[Flags, NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[Native]
public enum SCContentSharingPickerMode : ulong {
SingleWindow = 1 << 0,
Expand All @@ -105,7 +105,7 @@ public enum SCContentSharingPickerMode : ulong {
SingleDisplay = 1 << 4,
}

[NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[Native]
public enum SCShareableContentStyle : long {
None,
Expand All @@ -114,15 +114,15 @@ public enum SCShareableContentStyle : long {
Application,
}

[NoiOS, NoTV, NoWatch, Mac (15, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (15, 0), MacCatalyst (18, 2)]
[Native]
public enum SCCaptureDynamicRange : long {
Sdr,
HdrLocalDisplay,
HdrCanonicalDisplay,
}

[NoiOS, NoTV, NoWatch, Mac (15, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (15, 0), MacCatalyst (18, 2)]
[Native]
public enum SCStreamConfigurationPreset : long {
CaptureHdrStreamLocalDisplay,
Expand All @@ -131,7 +131,7 @@ public enum SCStreamConfigurationPreset : long {
CaptureHdrScreenshotCanonicalDisplay,
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[Static]
interface SCStreamFrameInfoKeys {

Expand Down Expand Up @@ -166,7 +166,7 @@ interface SCStreamFrameInfoKeys {
NSString PresenterOverlayContentRect { get; }
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCRunningApplication {
Expand All @@ -181,7 +181,7 @@ interface SCRunningApplication {
int ProcessId { get; }
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCWindow {
Expand Down Expand Up @@ -210,7 +210,7 @@ interface SCWindow {
}


[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCDisplay {
Expand All @@ -228,7 +228,7 @@ interface SCDisplay {
CGRect Frame { get; }
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCShareableContent {
Expand Down Expand Up @@ -274,7 +274,7 @@ interface SCShareableContent {
SCShareableContentInfo GetInfo (SCContentFilter filter);
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCContentFilter {
Expand All @@ -301,6 +301,7 @@ interface SCContentFilter {
// per docs, the following selectors are available for 12.3+
// but return types are SCStreamType and SCShareableContentStyle are 14.0+
[Deprecated (PlatformName.MacOSX, 14, 2, message: "Use 'Style' instead.")]
[NoMacCatalyst]
[Mac (14, 0)]
[Export ("streamType")]
SCStreamType StreamType { get; }
Expand All @@ -320,9 +321,21 @@ interface SCContentFilter {
[Mac (14, 2)]
[Export ("includeMenuBar")]
bool IncludeMenuBar { get; set; }

[Mac (15, 2), MacCatalyst (18, 2)]
[Export ("includedDisplays")]
SCDisplay [] IncludedDisplays { get; }

[Mac (15, 2), MacCatalyst (18, 2)]
[Export ("includedApplications")]
SCRunningApplication [] IncludedApplications { get; }

[Mac (15, 2), MacCatalyst (18, 2)]
[Export ("includedWindows")]
SCWindow [] IncludedWindows { get; }
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
interface SCStreamConfiguration {

Expand Down Expand Up @@ -435,6 +448,7 @@ interface SCStreamConfiguration {
[Export ("captureMicrophone", ArgumentSemantic.Assign)]
bool CaptureMicrophone { get; set; }

[NoMacCatalyst]
[Mac (15, 0)]
[Export ("microphoneCaptureDeviceID", ArgumentSemantic.Strong), NullAllowed]
string MicrophoneCaptureDeviceId { get; set; }
Expand All @@ -449,7 +463,7 @@ interface SCStreamConfiguration {
SCStreamConfiguration Create (SCStreamConfigurationPreset preset);
}

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCStream {
Expand Down Expand Up @@ -481,7 +495,8 @@ interface SCStream {

[Mac (13, 0)]
[Export ("synchronizationClock")]
CMClock SynchronizationClock { [return: NullAllowed] get; }
[NullAllowed]
CMClock SynchronizationClock { get; }

[Mac (15, 0)]
[Export ("addRecordingOutput:error:")]
Expand All @@ -494,7 +509,7 @@ interface SCStream {

interface ISCStreamDelegate { }

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[Protocol]
#if NET
[Model]
Expand All @@ -512,6 +527,7 @@ interface SCStreamDelegate {
[EditorBrowsable (EditorBrowsableState.Never)]
[Obsolete ("Do not use this method.")]
[Mac (14, 4)]
[NoMacCatalyst]
[Export ("userDidStopStream:")]
void UserDidStop (SCStream stream);
#endif
Expand All @@ -523,19 +539,27 @@ interface SCStreamDelegate {
[Mac (14, 0)]
[Export ("outputVideoEffectDidStopForStream:")]
void OutputVideoEffectDidStop (SCStream stream);

[Mac (15, 2), MacCatalyst (18, 2)]
[Export ("streamDidBecomeActive:")]
void StreamDidBecomeActive (SCStream stream);

[Mac (15, 2), MacCatalyst (18, 2)]
[Export ("streamDidBecomeInactive:")]
void StreamDidBecomeInactive (SCStream stream);
}

interface ISCStreamOutput { }

[NoiOS, NoTV, NoWatch, Mac (12, 3), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (12, 3), MacCatalyst (18, 2)]
[Protocol]
interface SCStreamOutput {

[Export ("stream:didOutputSampleBuffer:ofType:")]
void DidOutputSampleBuffer (SCStream stream, CMSampleBuffer sampleBuffer, SCStreamOutputType type);
}

[NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
interface SCContentSharingPickerConfiguration {
[Export ("allowedPickerModes", ArgumentSemantic.Assign)]
Expand All @@ -551,7 +575,7 @@ interface SCContentSharingPickerConfiguration {
bool AllowsChangingSelectedContent { get; set; }
}

[NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCContentSharingPicker {
Expand Down Expand Up @@ -594,7 +618,7 @@ interface SCContentSharingPicker {

interface ISCContentSharingPickerObserver { }

[NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[Protocol]
[Model]
[BaseType (typeof (NSObject))]
Expand All @@ -612,7 +636,7 @@ interface SCContentSharingPickerObserver {
void DidFail (NSError error);
}

[NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
[NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCShareableContentInfo {
Expand All @@ -626,7 +650,9 @@ interface SCShareableContentInfo {
CGRect ContentRect { get; }
}

[NoiOS, NoTV, NoWatch, Mac (14, 0), NoMacCatalyst]
delegate void SCScreenshotManagerCaptureImageCallback ([NullAllowed] CGImage image, [NullAllowed] NSError error);

[NoiOS, NoTV, NoWatch, Mac (14, 0), MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCScreenshotManager {
Expand All @@ -639,9 +665,15 @@ interface SCScreenshotManager {
[Export ("captureImageWithFilter:configuration:completionHandler:")]
[Async]
void CaptureImage (SCContentFilter contentFilter, SCStreamConfiguration config, [NullAllowed] Action<CGImage, NSError> completionHandler);

[Mac (15, 2)]
[Static]
[Export ("captureImageInRect:completionHandler:")]
[Async]
void CaptureImage (CGRect rect, [NullAllowed] SCScreenshotManagerCaptureImageCallback completionHandler);
}

[Mac (15, 0), NoiOS, NoTV, NoWatch, NoMacCatalyst]
[Mac (15, 0), NoiOS, NoTV, NoWatch, MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
interface SCRecordingOutputConfiguration {
[Export ("outputURL", ArgumentSemantic.Copy)]
Expand All @@ -664,7 +696,7 @@ interface SCRecordingOutputConfiguration {
NSString [] AvailableOutputFileTypes { get; }
}

[Mac (15, 0), NoiOS, NoTV, NoWatch, NoMacCatalyst]
[Mac (15, 0), NoiOS, NoTV, NoWatch, MacCatalyst (18, 2)]
[Protocol (BackwardsCompatibleCodeGeneration = false), Model]
[BaseType (typeof (NSObject))]
interface SCRecordingOutputDelegate {
Expand All @@ -680,7 +712,7 @@ interface SCRecordingOutputDelegate {

interface ISCRecordingOutputDelegate { }

[Mac (15, 0), NoiOS, NoTV, NoWatch, NoMacCatalyst]
[Mac (15, 0), NoiOS, NoTV, NoWatch, MacCatalyst (18, 2)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SCRecordingOutput {
Expand Down
12 changes: 12 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43044,7 +43044,11 @@ M:ScreenCaptureKit.ISCRecordingOutputDelegate.DidStartRecording(ScreenCaptureKit
M:ScreenCaptureKit.ISCStreamDelegate.DidStop(ScreenCaptureKit.SCStream,Foundation.NSError)
M:ScreenCaptureKit.ISCStreamDelegate.OutputVideoEffectDidStart(ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.ISCStreamDelegate.OutputVideoEffectDidStop(ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.ISCStreamDelegate.StreamDidBecomeActive(ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.ISCStreamDelegate.StreamDidBecomeInactive(ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.ISCStreamOutput.DidOutputSampleBuffer(ScreenCaptureKit.SCStream,CoreMedia.CMSampleBuffer,ScreenCaptureKit.SCStreamOutputType)
M:ScreenCaptureKit.SCScreenshotManager.CaptureImage(CoreGraphics.CGRect,ScreenCaptureKit.SCScreenshotManagerCaptureImageCallback)
M:ScreenCaptureKit.SCScreenshotManager.CaptureImageAsync(CoreGraphics.CGRect)
M:ScreenCaptureKit.SCScreenshotManager.CaptureImageAsync(ScreenCaptureKit.SCContentFilter,ScreenCaptureKit.SCStreamConfiguration)
M:ScreenCaptureKit.SCScreenshotManager.CaptureSampleBufferAsync(ScreenCaptureKit.SCContentFilter,ScreenCaptureKit.SCStreamConfiguration)
M:ScreenCaptureKit.SCShareableContent.GetCurrentProcessShareableContentAsync
Expand All @@ -43058,6 +43062,10 @@ M:ScreenCaptureKit.SCStreamConfiguration.Dispose(System.Boolean)
M:ScreenCaptureKit.SCStreamDelegate_Extensions.DidStop(ScreenCaptureKit.ISCStreamDelegate,ScreenCaptureKit.SCStream,Foundation.NSError)
M:ScreenCaptureKit.SCStreamDelegate_Extensions.OutputVideoEffectDidStart(ScreenCaptureKit.ISCStreamDelegate,ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.SCStreamDelegate_Extensions.OutputVideoEffectDidStop(ScreenCaptureKit.ISCStreamDelegate,ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.SCStreamDelegate_Extensions.StreamDidBecomeActive(ScreenCaptureKit.ISCStreamDelegate,ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.SCStreamDelegate_Extensions.StreamDidBecomeInactive(ScreenCaptureKit.ISCStreamDelegate,ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.SCStreamDelegate.StreamDidBecomeActive(ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.SCStreamDelegate.StreamDidBecomeInactive(ScreenCaptureKit.SCStream)
M:ScreenCaptureKit.SCStreamOutput_Extensions.DidOutputSampleBuffer(ScreenCaptureKit.ISCStreamOutput,ScreenCaptureKit.SCStream,CoreMedia.CMSampleBuffer,ScreenCaptureKit.SCStreamOutputType)
M:ScreenTime.STScreenTimeConfiguration.EncodeTo(Foundation.NSCoder)
M:ScreenTime.STScreenTimeConfigurationObserver.#ctor(CoreFoundation.DispatchQueue)
Expand Down Expand Up @@ -67016,6 +67024,9 @@ P:SceneKit.SCNView.JitteringEnabled
P:SceneKit.SCNView.Playing
P:SceneKit.SCNView.SceneRendererDelegate
P:SceneKit.SCNView.TemporalAntialiasingEnabled
P:ScreenCaptureKit.SCContentFilter.IncludedApplications
P:ScreenCaptureKit.SCContentFilter.IncludedDisplays
P:ScreenCaptureKit.SCContentFilter.IncludedWindows
P:ScreenCaptureKit.SCContentSharingPicker.Active
P:ScreenCaptureKit.SCStreamFrameInfoKeys.BoundingRect
P:ScreenCaptureKit.SCStreamFrameInfoKeys.ContentRect
Expand Down Expand Up @@ -75630,6 +75641,7 @@ T:ScreenCaptureKit.SCContentSharingPickerObserver
T:ScreenCaptureKit.SCFrameStatus
T:ScreenCaptureKit.SCPresenterOverlayAlertSetting
T:ScreenCaptureKit.SCRecordingOutputDelegate
T:ScreenCaptureKit.SCScreenshotManagerCaptureImageCallback
T:ScreenCaptureKit.SCShareableContentStyle
T:ScreenCaptureKit.SCStreamConfigurationPreset
T:ScreenCaptureKit.SCStreamDelegate
Expand Down
1 change: 1 addition & 0 deletions tests/dotnet/UnitTests/ProjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2897,6 +2897,7 @@ public void AppendRuntimeIdentifierToOutputPath_DisableDirectoryBuildProps (Appl
"/System/iOSSupport/System/Library/Frameworks/ReplayKit.framework/Versions/A/ReplayKit",
"/System/iOSSupport/System/Library/Frameworks/SafariServices.framework/Versions/A/SafariServices",
"/System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit",
"/System/iOSSupport/System/Library/Frameworks/ScreenCaptureKit.framework/Versions/A/ScreenCaptureKit",
"/System/iOSSupport/System/Library/Frameworks/ScreenTime.framework/Versions/A/ScreenTime",
"/System/iOSSupport/System/Library/Frameworks/SharedWithYou.framework/Versions/A/SharedWithYou",
"/System/iOSSupport/System/Library/Frameworks/Social.framework/Versions/A/Social",
Expand Down
Loading
Loading