Skip to content

Commit

Permalink
[Cinematic] Add support for Xcode 15 beta 6. (#18686)
Browse files Browse the repository at this point in the history
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
  • Loading branch information
4 people committed Aug 28, 2023
1 parent 6e4ca1a commit 642889a
Show file tree
Hide file tree
Showing 24 changed files with 599 additions and 816 deletions.
45 changes: 45 additions & 0 deletions src/Cinematic/CNDecision.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using CoreMedia;
using Foundation;
using ObjCRuntime;

#nullable enable

#if !WATCH && !__MACCATALYST__

namespace Cinematic {

#if NET
[SupportedOSPlatform ("tvos17.0")]
[SupportedOSPlatform ("macos14.0")]
[SupportedOSPlatform ("ios17.0")]
[SupportedOSPlatform ("maccatalyst17.0")]
#else
[NoWatch, TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
#endif
public enum CNDecisionIdentifierType {
Single,
Group,
}

public partial class CNDecision {

public CNDecision (CMTime time, long detectionId, bool isStrong, CNDecisionIdentifierType identifierType)
: base (NSObjectFlag.Empty)
{

switch (identifierType) {
case CNDecisionIdentifierType.Single:
InitializeHandle (_InitWithSingleIdentifier (time, detectionId, isStrong), "initWithTime:detectionID:strong:");
break;
case CNDecisionIdentifierType.Group:
InitializeHandle (_InitWithGroupIdentifier (time, detectionId, isStrong), "initWithTime:detectionGroupID:strong:");
break;
default:
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (identifierType), $"Unknown identifier type: {identifierType}");
break;
}
}
}
}
#endif
15 changes: 15 additions & 0 deletions src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
// hack: ease compilation without extra defines
using CIBarcodeDescriptor = Foundation.NSObject;
#endif

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

using AudioToolbox;
using CoreMedia;
using ObjCRuntime;
Expand Down Expand Up @@ -8335,6 +8344,7 @@ interface AVMutableCompositionTrack {
[MacCatalyst (13, 1)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }

}

[Watch (6, 0)]
Expand Down Expand Up @@ -8490,6 +8500,11 @@ interface AVMutableComposition {
[Export ("naturalSize")]
[Override]
CGSize NaturalSize { get; set; }

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

[Watch (6, 0)]
Expand Down
Loading

1 comment on commit 642889a

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.