Skip to content
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
11 changes: 2 additions & 9 deletions src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,8 @@
using CoreImage;
using MediaToolbox;

// cinematic is not present in certain platforms
#if __MACCATALYST__
using CNAssetInfo = Foundation.NSObject;
using CNCompositionInfo = Foundation.NSObject;
#else
using Cinematic;
#endif

using AudioToolbox;
using Cinematic;
using CoreMedia;
using ObjCRuntime;
using Foundation;
Expand Down Expand Up @@ -13347,7 +13340,7 @@ interface AVMutableComposition {
CGSize NaturalSize { get; set; }

// from @interface CNComposition (AVMutableComposition)
[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[Export ("addTracksForCinematicAssetInfo:preferredStartingTrackID:")]
CNCompositionInfo AddTracks (CNAssetInfo assetInfo, int preferredStartingTrackID);

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 @@ -406,6 +406,7 @@ partial class Frameworks {
"BusinessChat",
"CallKit",
"CFNetwork",
"Cinematic",
"ClassKit",
"CloudKit",
"Compression",
Expand Down
106 changes: 89 additions & 17 deletions src/cinematic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Cinematic {

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[ErrorDomain ("CNCinematicErrorDomain")]
[Native]
public enum CNCinematicErrorCode : long {
Expand All @@ -24,7 +24,7 @@ public enum CNCinematicErrorCode : long {
Cancelled = 7,
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[Native]
public enum CNRenderingQuality : long {
Thumbnail,
Expand All @@ -50,7 +50,79 @@ public enum CNDetectionType : long {
Custom = 102,
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (26, 0), MacCatalyst (26, 0), Mac (26, 0), iOS (26, 0)]
[Native]
public enum CNSpatialAudioRenderingStyle : long {
Cinematic = 0,
Studio = 1,
InFrame = 2,
CinematicBackgroundStem = 3,
CinematicForegroundStem = 4,
StudioForegroundStem = 5,
InFrameForegroundStem = 6,
Standard = 7,
StudioBackgroundStem = 8,
InFrameBackgroundStem = 9,
}

[TV (26, 0), MacCatalyst (26, 0), Mac (26, 0), iOS (26, 0)]
[Native]
public enum CNSpatialAudioContentType : long {
Stereo,
Spatial,
}

[TV (26, 0), MacCatalyst (26, 0), Mac (26, 0), iOS (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNAssetSpatialAudioInfo {
[Static]
[Export ("isSupported")]
bool IsSupported { get; }

[Async]
[Static]
[Export ("checkIfContainsSpatialAudio:completionHandler:")]
void CheckIfContainsSpatialAudio (AVAsset asset, CNAssetSpatialAudioInfoCheckIfContainsSpatialAudioCallback completionHandler);

[Async]
[Static]
[Export ("loadFromAsset:completionHandler:")]
void Load (AVAsset asset, CNAssetSpatialAudioInfoLoadCallback completionHandler);

// From the CNAssetSpatialAudioInfo (Properties) category
[Export ("defaultSpatialAudioTrack")]
AVAssetTrack DefaultSpatialAudioTrack { get; }

// From the CNAssetSpatialAudioInfo (Properties) category
[Export ("defaultEffectIntensity")]
float DefaultEffectIntensity { get; }

// From the CNAssetSpatialAudioInfo (Properties) category
[Export ("defaultRenderingStyle")]
CNSpatialAudioRenderingStyle DefaultRenderingStyle { get; }

// From the CNAssetSpatialAudioInfo (Properties) category
[Export ("spatialAudioMixMetadata")]
NSData SpatialAudioMixMetadata { get; }

// From the CNAssetSpatialAudioInfo (SynthesizeAVFoundationObjects) category
[Export ("audioMixWithEffectIntensity:renderingStyle:")]
AVAudioMix CreateAudioMix (float effectIntensity, CNSpatialAudioRenderingStyle renderingStyle);

// From the CNAssetSpatialAudioInfo (SynthesizeAVFoundationObjects) category
[Export ("assetReaderOutputSettingsForContentType:")]
NSDictionary<NSString, NSObject> GetAssetReaderOutputSettings (CNSpatialAudioContentType contentType);

// From the CNAssetSpatialAudioInfo (SynthesizeAVFoundationObjects) category
[Export ("assetWriterInputSettingsForContentType:")]
NSDictionary<NSString, NSObject> GetAssetWriterInputSettingsFor (CNSpatialAudioContentType contentType);
}

delegate void CNAssetSpatialAudioInfoCheckIfContainsSpatialAudioCallback (bool result);
delegate void CNAssetSpatialAudioInfoLoadCallback ([NullAllowed] CNAssetSpatialAudioInfo assetInfo, [NullAllowed] NSError error);

[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNAssetInfo {
Expand Down Expand Up @@ -106,14 +178,14 @@ interface CNAssetInfo {
NSNumber [] SampleDataTrackIds { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (CNAssetInfo))]
interface CNCompositionInfo {
[Export ("insertTimeRange:ofCinematicAssetInfo:atTime:error:")]
bool InsertTimeRange (CMTimeRange timeRange, CNAssetInfo assetInfo, CMTime startTime, [NullAllowed] out NSError outError);
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNRenderingSessionAttributes {
Expand All @@ -126,7 +198,7 @@ interface CNRenderingSessionAttributes {
nint RenderingVersion { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNRenderingSessionFrameAttributes : NSCopying, NSMutableCopying {
Expand All @@ -143,7 +215,7 @@ interface CNRenderingSessionFrameAttributes : NSCopying, NSMutableCopying {
float FNumber { get; set; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNRenderingSession {
Expand Down Expand Up @@ -180,7 +252,7 @@ interface CNRenderingSession {
NSNumber [] DestinationPixelFormatTypes { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNDetection : NSCopying {
Expand Down Expand Up @@ -222,7 +294,7 @@ interface CNDetection : NSCopying {
float DisparityInNormalizedRect (CGRect normalizedRect, CVPixelBuffer sourceDisparity, CNDetectionType detectionType, float priorDisparity);
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNDecision : NSCopying {
Expand Down Expand Up @@ -253,7 +325,7 @@ interface CNDecision : NSCopying {
bool StrongDecision { [Bind ("isStrongDecision")] get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNDetectionTrack : NSCopying {
Expand Down Expand Up @@ -284,7 +356,7 @@ interface CNDetectionTrack : NSCopying {
CNDetection [] GetDetectionsInTimeRange (CMTimeRange timeRange);
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (CNDetectionTrack))]
interface CNFixedDetectionTrack {
[Export ("initWithFocusDisparity:")]
Expand All @@ -300,7 +372,7 @@ interface CNFixedDetectionTrack {
CNDetection OriginalDetection { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (CNDetectionTrack))]
interface CNCustomDetectionTrack {
[Export ("initWithDetections:smooth:")]
Expand All @@ -310,7 +382,7 @@ interface CNCustomDetectionTrack {
CNDetection [] AllDetections { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNScript {
Expand Down Expand Up @@ -403,7 +475,7 @@ interface CNScript {
CNDetectionTrack [] AddedDetectionTracks { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNScriptChanges {
Expand All @@ -423,7 +495,7 @@ interface CNScriptChanges {
CNDetectionTrack [] AddedDetectionTracks { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNScriptFrame : NSCopying {
Expand All @@ -448,7 +520,7 @@ interface CNScriptFrame : NSCopying {
CNDetection GetBestDetectionForGroupId (long detectionGroupId);
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
interface CNBoundsPrediction : NSCopying, NSMutableCopying {
[Export ("normalizedBounds", ArgumentSemantic.Assign)]
Expand All @@ -458,7 +530,7 @@ interface CNBoundsPrediction : NSCopying, NSMutableCopying {
float Confidence { get; set; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), NoMacCatalyst]
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CNObjectTracker {
Expand Down
4 changes: 1 addition & 3 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,7 @@ COMMON_FRAMEWORKS = \
Accelerate \
AuthenticationServices \
AVFoundation \
Cinematic \
CoreBluetooth \
CoreData \
CoreFoundation \
Expand Down Expand Up @@ -1979,7 +1980,6 @@ MACOS_FRAMEWORKS = \
BrowserEngineKit \
CallKit \
CFNetwork \
Cinematic \
ClassKit \
CloudKit \
Contacts \
Expand Down Expand Up @@ -2101,7 +2101,6 @@ IOS_FRAMEWORKS = \
CallKit \
CarPlay \
CFNetwork \
Cinematic \
ClassKit \
CloudKit \
Contacts \
Expand Down Expand Up @@ -2207,7 +2206,6 @@ TVOS_FRAMEWORKS = \
BackgroundTasks \
BrowserEngineKit \
CFNetwork \
Cinematic \
CloudKit \
CoreAnimation \
CoreGraphics \
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 @@ -19,6 +19,7 @@
-d:HAS_BUSINESSCHAT
-d:HAS_CALLKIT
-d:HAS_CFNETWORK
-d:HAS_CINEMATIC
-d:HAS_CLASSKIT
-d:HAS_CLOUDKIT
-d:HAS_COMPRESSION
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 @@ -3446,6 +3446,7 @@ public void AppendRuntimeIdentifierToOutputPath_DisableDirectoryBuildProps (Appl
"/System/iOSSupport/System/Library/Frameworks/AVKit.framework/Versions/A/AVKit",
"/System/iOSSupport/System/Library/Frameworks/BusinessChat.framework/Versions/A/BusinessChat",
"/System/iOSSupport/System/Library/Frameworks/ContactsUI.framework/Versions/A/ContactsUI",
"/System/iOSSupport/System/Library/Frameworks/Cinematic.framework/Versions/A/Cinematic",
"/System/iOSSupport/System/Library/Frameworks/CoreAudioKit.framework/Versions/A/CoreAudioKit",
"/System/iOSSupport/System/Library/Frameworks/CoreLocationUI.framework/Versions/A/CoreLocationUI",
"/System/iOSSupport/System/Library/Frameworks/CoreNFC.framework/Versions/A/CoreNFC",
Expand Down
Loading