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
28 changes: 28 additions & 0 deletions src/AVKit/AVLegibleMediaOptionsMenuState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#nullable enable

#if !TVOS
namespace AVKit {
[SupportedOSPlatform ("ios26.4")]
[SupportedOSPlatform ("macos26.4")]
[SupportedOSPlatform ("maccatalyst26.4")]
[UnsupportedOSPlatform ("tvos")]
[StructLayout (LayoutKind.Sequential)]
public struct AVLegibleMediaOptionsMenuState {
#if !COREBUILD
byte enabled;

public bool Enabled {
get => enabled != 0;
set => enabled = value.AsByte ();
}

nint reason;

public AVLegibleMediaOptionsMenuStateChangeReason Reason {
get => (AVLegibleMediaOptionsMenuStateChangeReason) (long) reason;
set => reason = (nint) (long) value;
}
#endif
}
}
#endif
16 changes: 16 additions & 0 deletions src/AVKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,20 @@ public enum AVRoutePickerViewButtonState : long {
ActiveHighlighted,
}

[NoTV, Mac (26, 4), iOS (26, 4), MacCatalyst (26, 4)]
[Native]
public enum AVLegibleMediaOptionsMenuStateChangeReason : long {
None = 0,
LanguageMismatch,
}

[Flags]
[NoTV, Mac (26, 4), iOS (26, 4), MacCatalyst (26, 4)]
[Native]
public enum AVLegibleMediaOptionsMenuContents : long {
Legible = 1L << 0,
CaptionAppearance = 1L << 1,
All = Legible | CaptionAppearance,
}

}
44 changes: 44 additions & 0 deletions src/avkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@
using UIViewController = Foundation.NSObject;
using UIWindow = Foundation.NSObject;
using UIAction = Foundation.NSObject;
using UIMenu = Foundation.NSObject;
using UIMenuElement = Foundation.NSObject;
#endif // !MONOMAC

#if TVOS
using AVCustomRoutingController = Foundation.NSObject;
using AVCustomRoutingEvent = Foundation.NSObject;
using AVCustomRoutingActionItem = Foundation.NSObject;
using AVLegibleMediaOptionsMenuState = Foundation.NSObject;
#else
using AVRouting;
#endif
Expand Down Expand Up @@ -1388,4 +1390,46 @@ public enum AVDisplayDynamicRange : long {
ConstrainedHigh = 2,
High = 3,
}

interface IAVLegibleMediaOptionsMenuControllerDelegate { }

[NoTV, Mac (26, 4), iOS (26, 4), MacCatalyst (26, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface AVLegibleMediaOptionsMenuController {
[Export ("initWithPlayer:")]
[DesignatedInitializer]
NativeHandle Constructor (AVPlayer player);

[Export ("menuWithContents:")]
[return: NullAllowed]
UIMenu BuildMenu (AVLegibleMediaOptionsMenuContents contents);

[Export ("player", ArgumentSemantic.Assign)]
AVPlayer Player { get; set; }

[Wrap ("WeakDelegate")]
[NullAllowed]
IAVLegibleMediaOptionsMenuControllerDelegate Delegate { get; set; }

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

[Export ("menuState")]
AVLegibleMediaOptionsMenuState MenuState { get; }
}

[NoTV, Mac (26, 4), iOS (26, 4), MacCatalyst (26, 4)]
[Protocol (BackwardsCompatibleCodeGeneration = false), Model]
[BaseType (typeof (NSObject))]
interface AVLegibleMediaOptionsMenuControllerDelegate {
[Export ("legibleMenuController:didChangeMenuState:")]
void DidChangeMenuState (AVLegibleMediaOptionsMenuController menuController, AVLegibleMediaOptionsMenuState state);

[Export ("legibleMenuController:didRequestCaptionPreviewForProfileID:")]
void DidRequestCaptionPreviewForProfileId (AVLegibleMediaOptionsMenuController menuController, string profileId);

[Export ("legibleMenuControllerDidRequestStoppingSubtitleCaptionPreview:")]
void DidRequestStoppingSubtitleCaptionPreview (AVLegibleMediaOptionsMenuController menuController);
}
}
3 changes: 3 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ AVFOUNDATION_SOURCES = \

# AVKit

AVKIT_CORE_SOURCES = \
AVKit/AVLegibleMediaOptionsMenuState.cs \

AVKIT_API_SOURCES = \
AVKit/Enums.cs \

Expand Down
15 changes: 15 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,11 @@ F:AVKit.AVKitError.ContentDisallowedByPasscode
F:AVKit.AVKitError.ContentDisallowedByProfile
F:AVKit.AVKitError.ContentRatingUnknown
F:AVKit.AVKitError.RecordingFailed
F:AVKit.AVLegibleMediaOptionsMenuContents.All
F:AVKit.AVLegibleMediaOptionsMenuContents.CaptionAppearance
F:AVKit.AVLegibleMediaOptionsMenuContents.Legible
F:AVKit.AVLegibleMediaOptionsMenuStateChangeReason.LanguageMismatch
F:AVKit.AVLegibleMediaOptionsMenuStateChangeReason.None
F:AVKit.AVRoutePickerViewButtonState.Active
F:AVKit.AVRoutePickerViewButtonState.ActiveHighlighted
F:AVKit.AVRoutePickerViewButtonState.Normal
Expand Down Expand Up @@ -9721,6 +9726,7 @@ M:AVKit.AVCustomRoutingControllerDelegate.DidSelectItem(AVRouting.AVCustomRoutin
M:AVKit.AVCustomRoutingControllerDelegate.EventDidTimeOut(AVRouting.AVCustomRoutingController,AVRouting.AVCustomRoutingEvent)
M:AVKit.AVCustomRoutingControllerDelegate.HandleEvent(AVRouting.AVCustomRoutingController,AVRouting.AVCustomRoutingEvent,AVKit.AVCustomRoutingControllerDelegateCompletionHandler)
M:AVKit.AVInputPickerInteraction.Dispose(System.Boolean)
M:AVKit.AVLegibleMediaOptionsMenuController.Dispose(System.Boolean)
M:AVKit.AVPictureInPictureController.Dispose(System.Boolean)
M:AVKit.AVPictureInPictureControllerContentSource.Dispose(System.Boolean)
M:AVKit.AVPictureInPictureSampleBufferPlaybackDelegate_Extensions.ShouldProhibitBackgroundAudioPlayback(AVKit.IAVPictureInPictureSampleBufferPlaybackDelegate,AVKit.AVPictureInPictureController)
Expand Down Expand Up @@ -9774,6 +9780,9 @@ M:AVKit.IAVInputPickerInteractionDelegate.DidEndDismissing(AVKit.AVInputPickerIn
M:AVKit.IAVInputPickerInteractionDelegate.DidEndPresenting(AVKit.AVInputPickerInteraction)
M:AVKit.IAVInputPickerInteractionDelegate.WillBeginDismissing(AVKit.AVInputPickerInteraction)
M:AVKit.IAVInputPickerInteractionDelegate.WillBeginPresenting(AVKit.AVInputPickerInteraction)
M:AVKit.IAVLegibleMediaOptionsMenuControllerDelegate.DidChangeMenuState(AVKit.AVLegibleMediaOptionsMenuController,AVKit.AVLegibleMediaOptionsMenuState)
M:AVKit.IAVLegibleMediaOptionsMenuControllerDelegate.DidRequestCaptionPreviewForProfileId(AVKit.AVLegibleMediaOptionsMenuController,System.String)
M:AVKit.IAVLegibleMediaOptionsMenuControllerDelegate.DidRequestStoppingSubtitleCaptionPreview(AVKit.AVLegibleMediaOptionsMenuController)
M:AVKit.IAVPictureInPictureSampleBufferPlaybackDelegate.DidTransitionToRenderSize(AVKit.AVPictureInPictureController,CoreMedia.CMVideoDimensions)
M:AVKit.IAVPictureInPictureSampleBufferPlaybackDelegate.GetTimeRange(AVKit.AVPictureInPictureController)
M:AVKit.IAVPictureInPictureSampleBufferPlaybackDelegate.IsPlaybackPaused(AVKit.AVPictureInPictureController)
Expand Down Expand Up @@ -20536,6 +20545,9 @@ P:AVKit.AVDisplayManager.DisplayCriteriaMatchingEnabled
P:AVKit.AVDisplayManager.DisplayModeSwitchInProgress
P:AVKit.AVInputPickerInteraction.Delegate
P:AVKit.AVInputPickerInteraction.Presented
P:AVKit.AVLegibleMediaOptionsMenuController.Delegate
P:AVKit.AVLegibleMediaOptionsMenuState.Enabled
P:AVKit.AVLegibleMediaOptionsMenuState.Reason
P:AVKit.AVPictureInPictureControllerContentSource.SampleBufferPlaybackDelegate
P:AVKit.AVPlayerView.Delegate
P:AVKit.AVPlayerView.PictureInPictureDelegate
Expand Down Expand Up @@ -28429,6 +28441,9 @@ T:AVKit.AVCaptureViewControlsStyle
T:AVKit.AVCustomRoutingControllerDelegateCompletionHandler
T:AVKit.AVDisplayDynamicRange
T:AVKit.AVKitMetadataIdentifier
T:AVKit.AVLegibleMediaOptionsMenuContents
T:AVKit.AVLegibleMediaOptionsMenuState
T:AVKit.AVLegibleMediaOptionsMenuStateChangeReason
T:AVKit.AVPlayerViewTrimResult
T:AVKit.AVRoutePickerViewButtonState
T:AVKit.AVRoutePickerViewButtonStyle
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Causes segfault so clearly not allowed
!missing-null-allowed! 'System.Void AVKit.AVLegibleMediaOptionsMenuController::.ctor(AVFoundation.AVPlayer)' is missing an [NullAllowed] on parameter #0
11 changes: 0 additions & 11 deletions tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-AVKit.todo

This file was deleted.

2 changes: 2 additions & 0 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-AVKit.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Causes segfault so clearly not allowed
!missing-null-allowed! 'System.Void AVKit.AVLegibleMediaOptionsMenuController::.ctor(AVFoundation.AVPlayer)' is missing an [NullAllowed] on parameter #0
11 changes: 0 additions & 11 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-AVKit.todo

This file was deleted.

2 changes: 2 additions & 0 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-AVKit.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Causes segfault so clearly not allowed
!missing-null-allowed! 'System.Void AVKit.AVLegibleMediaOptionsMenuController::.ctor(AVFoundation.AVPlayer)' is missing an [NullAllowed] on parameter #0
11 changes: 0 additions & 11 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-AVKit.todo

This file was deleted.

Loading