Skip to content

Commit

Permalink
[AVKit] Add support for xcode 12 beta 5. (#12551)
Browse files Browse the repository at this point in the history
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
  • Loading branch information
mandel-macaque and rolfbjarne committed Aug 26, 2021
1 parent 143a221 commit 53988e1
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 92 deletions.
4 changes: 4 additions & 0 deletions src/avfoundation.cs
Expand Up @@ -11736,6 +11736,10 @@ interface AVPlayerItem : NSCopying {
[NoWatch]
[Export ("appliesPerFrameHDRDisplayMetadata")]
bool AppliesPerFrameHdrDisplayMetadata { get; set; }

[TV (15, 0), NoWatch, NoMac, NoiOS, NoMacCatalyst]
[Export ("translatesPlayerInterstitialEvents")]
bool TranslatesPlayerInterstitialEvents { get; set; }
}

[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
Expand Down
164 changes: 156 additions & 8 deletions src/avkit.cs
Expand Up @@ -34,6 +34,8 @@
using UIView = AppKit.NSView;
using UIViewController = Foundation.NSObject;
using UIWindow = Foundation.NSObject;
using UIAction = Foundation.NSObject;
using UIMenuElement = Foundation.NSObject;
#endif // !MONOMAC

namespace AVKit {
Expand All @@ -52,8 +54,12 @@ interface AVPictureInPictureController
bool IsPictureInPictureSupported { get; }

[Export ("initWithPlayerLayer:")]
[DesignatedInitializer]
IntPtr Constructor (AVPlayerLayer playerLayer);

[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("initWithContentSource:")]
[DesignatedInitializer]
IntPtr Constructor (AVPictureInPictureControllerContentSource contentSource);

[Export ("playerLayer")]
AVPlayerLayer PlayerLayer { get; }
Expand Down Expand Up @@ -104,15 +110,23 @@ interface AVPictureInPictureController
[Export ("requiresLinearPlayback")]
bool RequiresLinearPlayback { get; set; }

[NoWatch, NoMac, NoiOS]
[NoWatch, NoMac, NoiOS, MacCatalyst (15,0)]
[Export ("canStopPictureInPicture")]
bool CanStopPictureInPicture { get; }

[iOS (14,2)]
[NoWatch, NoTV, NoMac]
[NoMacCatalyst]
[NoWatch, NoTV, NoMac, MacCatalyst (15,0)]
[Export ("canStartPictureInPictureAutomaticallyFromInline")]
bool CanStartPictureInPictureAutomaticallyFromInline { get; set; }

[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("invalidatePlaybackState")]
void InvalidatePlaybackState ();

[NullAllowed]
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("contentSource", ArgumentSemantic.Strong)]
AVPictureInPictureControllerContentSource ContentSource { get; set; }
}

interface IAVPictureInPictureControllerDelegate {}
Expand Down Expand Up @@ -250,6 +264,7 @@ interface AVPlayerViewController {

[NullAllowed]
[NoiOS, TV (11, 0), NoWatch, NoMac]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CustomInfoViewControllers' instead.")]
[Export ("customInfoViewController", ArgumentSemantic.Assign)]
UIViewController CustomInfoViewController { get; set; }

Expand All @@ -270,10 +285,29 @@ interface AVPlayerViewController {
bool ShowsTimecodes { get; set; }

[iOS (14,2)]
[NoWatch, NoTV]
[NoMacCatalyst]
[NoWatch, NoTV, MacCatalyst (15,0)]
[Export ("canStartPictureInPictureAutomaticallyFromInline")]
bool CanStartPictureInPictureAutomaticallyFromInline { get; set; }

[TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst]
[Export ("contextualActions", ArgumentSemantic.Copy)]
UIAction[] ContextualActions { get; set; }

[TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst]
[Export ("infoViewActions", ArgumentSemantic.Copy)]
UIAction[] InfoViewActions { get; set; }

[TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst]
[Export ("customInfoViewControllers", ArgumentSemantic.Copy)]
UIViewController[] CustomInfoViewControllers { get; set; }

[TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst]
[Export ("transportBarCustomMenuItems", ArgumentSemantic.Copy)]
UIMenuElement[] TransportBarCustomMenuItems { get; set; }

[TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst]
[Export ("transportBarIncludesTitleView")]
bool TransportBarIncludesTitleView { get; set; }
}

[NoMac]
Expand Down Expand Up @@ -400,6 +434,10 @@ interface AVPlayerViewControllerDelegate
[TV (13,0), NoiOS, NoWatch, NoMac]
[Export ("previousChannelInterstitialViewControllerForPlayerViewController:")]
UIViewController GetPreviousChannelInterstitialViewController (AVPlayerViewController playerViewController);

[iOS (15,0), NoTV, NoMac, NoWatch, MacCatalyst (15,0)]
[Export ("playerViewController:restoreUserInterfaceForFullScreenExitWithCompletionHandler:")]
void RestoreUserInterfaceForFullScreenExit (AVPlayerViewController playerViewController, Action<bool> completionHandler);
}

[NoWatch, NoTV, NoMac, iOS (13,0)]
Expand Down Expand Up @@ -497,6 +535,15 @@ interface AVPlayerView {
[Mac (10,15)]
[Export ("showsTimecodes")]
bool ShowsTimecodes { get; set; }

[Mac (12,0)]
[Wrap ("WeakDelegate")]
[Protocolize]
AVPlayerViewDelegate Delegate { get; set; }

[Mac (12,0)]
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
NSObject WeakDelegate { get; set; }
}

interface IAVPlayerViewPictureInPictureDelegate {}
Expand Down Expand Up @@ -684,7 +731,7 @@ interface AVRoutePickerView {
UIColor ActiveTintColor { get; set; }

[NoiOS]
[NoMac, NoWatch]
[NoMac, NoWatch, MacCatalyst (15,0)]
[Export ("routePickerButtonStyle", ArgumentSemantic.Assign)]
AVRoutePickerViewButtonStyle RoutePickerButtonStyle { get; set; }

Expand All @@ -711,7 +758,7 @@ interface AVRoutePickerView {
}

[NoMac]
[TV (11,0), NoiOS]
[TV (11,0), NoiOS, MacCatalyst (15,0)]
[Native]
public enum AVRoutePickerViewButtonStyle : long {
System,
Expand Down Expand Up @@ -773,4 +820,105 @@ interface UIWindow_AVAdditions {
[Export ("avDisplayManager")]
AVDisplayManager GetAVDisplayManager ();
}

[NoTV, NoWatch, NoMac, iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (UIViewController))]
interface AVPictureInPictureVideoCallViewController {
[DesignatedInitializer]
[Export ("initWithNibName:bundle:")]
IntPtr Constructor ([NullAllowed] string nibName, [NullAllowed] NSBundle bundle);
}

[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface AVPictureInPictureControllerContentSource
{
[Export ("initWithPlayerLayer:")]
IntPtr Constructor (AVPlayerLayer playerLayer);

[NullAllowed, Export ("playerLayer")]
AVPlayerLayer PlayerLayer { get; }

// interface AVPictureInPictureControllerContentSource_VideoCallSupport
[NoWatch, NoTV, NoMac]
[Export ("initWithActiveVideoCallSourceView:contentViewController:")]
IntPtr Constructor (UIView sourceView, AVPictureInPictureVideoCallViewController contentViewController);

[NullAllowed]
[NoWatch, NoTV, NoMac]
[Export ("activeVideoCallSourceView", ArgumentSemantic.Weak)]
UIView ActiveVideoCallSourceView { get; }

[NoWatch, NoTV, NoMac]
[Export ("activeVideoCallContentViewController")]
AVPictureInPictureVideoCallViewController ActiveVideoCallContentViewController { get; }

// interface AVPictureInPictureControllerContentSource_AVSampleBufferDisplayLayerSupport
[Export ("initWithSampleBufferDisplayLayer:playbackDelegate:")]
IntPtr Constructor (AVSampleBufferDisplayLayer sampleBufferDisplayLayer, IAVPictureInPictureSampleBufferPlaybackDelegate playbackDelegate);

[NullAllowed, Export ("sampleBufferDisplayLayer")]
AVSampleBufferDisplayLayer SampleBufferDisplayLayer { get; }

[Wrap ("WeakSampleBufferPlaybackDelegate")]
[NullAllowed]
IAVPictureInPictureSampleBufferPlaybackDelegate SampleBufferPlaybackDelegate { get; }

[NullAllowed, Export ("sampleBufferPlaybackDelegate", ArgumentSemantic.Weak)]
NSObject WeakSampleBufferPlaybackDelegate { get; }
}

interface IAVPictureInPictureSampleBufferPlaybackDelegate {}

[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Protocol, Model (AutoGeneratedName = true)]
[BaseType (typeof(NSObject))]
interface AVPictureInPictureSampleBufferPlaybackDelegate
{
[Abstract]
[Export ("pictureInPictureController:setPlaying:")]
void SetPlaying (AVPictureInPictureController pictureInPictureController, bool playing);

[Abstract]
[Export ("pictureInPictureControllerTimeRangeForPlayback:")]
CMTimeRange GetTimeRange (AVPictureInPictureController pictureInPictureController);

[Abstract]
[Export ("pictureInPictureControllerIsPlaybackPaused:")]
bool IsPlaybackPaused (AVPictureInPictureController pictureInPictureController);

[Abstract]
[Export ("pictureInPictureController:didTransitionToRenderSize:")]
void DidTransitionToRenderSize (AVPictureInPictureController pictureInPictureController, CMVideoDimensions newRenderSize);

[Abstract]
[Export ("pictureInPictureController:skipByInterval:completionHandler:")]
void SkipByInterval (AVPictureInPictureController pictureInPictureController, CMTime skipInterval, Action completionHandler);

[Export ("pictureInPictureControllerShouldProhibitBackgroundAudioPlayback:")]
bool ShouldProhibitBackgroundAudioPlayback (AVPictureInPictureController pictureInPictureController);
}

[Mac (12,0), NoiOS, NoTV, NoMacCatalyst]
[Protocol, Model (AutoGeneratedName = true)]
[BaseType (typeof(NSObject))]
interface AVPlayerViewDelegate
{
[Export ("playerViewWillEnterFullScreen:")]
void WillEnterFullScreen (AVPlayerView playerView);

[Export ("playerViewDidEnterFullScreen:")]
void DidEnterFullScreen (AVPlayerView playerView);

[Export ("playerViewWillExitFullScreen:")]
void WillExitFullScreen (AVPlayerView playerView);

[Export ("playerViewDidExitFullScreen:")]
void DidExitFullScreen (AVPlayerView playerView);

[Export ("playerView:restoreUserInterfaceForFullScreenExitWithCompletionHandler:")]
void RestoreUserInterfaceForFullScreenExit (AVPlayerView playerView, Action<bool> completionHandler);
}

}
26 changes: 0 additions & 26 deletions tests/xtro-sharpie/MacCatalyst-AVKit.todo

This file was deleted.

17 changes: 0 additions & 17 deletions tests/xtro-sharpie/iOS-AVKit.todo

This file was deleted.

15 changes: 0 additions & 15 deletions tests/xtro-sharpie/macOS-AVKit.todo

This file was deleted.

26 changes: 0 additions & 26 deletions tests/xtro-sharpie/tvOS-AVKit.todo

This file was deleted.

5 comments on commit 53988e1

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

Packages generated

View packages

Test results

3 tests failed, 246 tests passed.

Failed tests

  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • introspection/iOS Unified 64-bits - simulator/Debug (iOS 11.4) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (static registrar) [dotnet]: Failed

Pipeline on Agent XAMBOT-1027.BigSur'
[AVKit] Add support for xcode 12 beta 5. (#12551)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[AVKit] Add support for xcode 12 beta 5. (#12551)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[AVKit] Add support for xcode 12 beta 5. (#12551)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Tests failed on macOS M1 - Mac Big Sur (11.5) ❌

Tests failed on M1 - Mac Big Sur (11.5).

Failed tests are:

  • xammac_tests

Pipeline on Agent
[AVKit] Add support for xcode 12 beta 5. (#12551)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Tests passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
[AVKit] Add support for xcode 12 beta 5. (#12551)

Please sign in to comment.