[AVFoundation] Low hanging fruits and xtro of AVFoundation (#980)
This commit brings all new 10.12 api + most of the unbound AVFoundation API that is macOS specific and was left in the limbo
This commit is contained in:
Родитель
503061f6ab
Коммит
6b65ce9077
|
@ -266,4 +266,61 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[Mac (10, 10), NoiOS, NoWatch, NoTV]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVSampleCursorSyncInfo {
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool IsFullSync;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool IsPartialSync;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool IsDroppable;
|
||||
}
|
||||
|
||||
[Mac (10, 10), NoiOS, NoWatch, NoTV]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVSampleCursorDependencyInfo {
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool IndicatesWhetherItHasDependentSamples;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool HasDependentSamples;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool IndicatesWhetherItDependsOnOthers;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool DependsOnOthers;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool IndicatesWhetherItHasRedundantCoding;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool HasRedundantCoding;
|
||||
}
|
||||
|
||||
[Mac (10, 10), NoiOS, NoWatch, NoTV]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVSampleCursorStorageRange {
|
||||
public long Offset;
|
||||
public long Length;
|
||||
}
|
||||
|
||||
[Mac (10, 10), NoiOS, NoWatch, NoTV]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVSampleCursorChunkInfo {
|
||||
public long SampleCount;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool HasUniformSampleSizes;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool HasUniformSampleDurations;
|
||||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool HasUniformFormatDescriptions;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -692,6 +692,33 @@ namespace XamCore.AVFoundation {
|
|||
AddMovieHeaderToDestination = 0,
|
||||
TruncateDestinationToMovieHeaderOnly = (1 << 0)
|
||||
}
|
||||
|
||||
[Mac (10,10)]
|
||||
[Native]
|
||||
public enum AVContentAuthorizationStatus : nint {
|
||||
Unknown,
|
||||
Completed,
|
||||
Cancelled,
|
||||
TimedOut,
|
||||
Busy,
|
||||
NotAvailable,
|
||||
NotPossible,
|
||||
}
|
||||
|
||||
[Mac (10,10)]
|
||||
[Native]
|
||||
public enum AVSampleBufferRequestDirection : nint {
|
||||
Forward = 1,
|
||||
None = 0,
|
||||
Reverse = -1,
|
||||
}
|
||||
|
||||
[Mac (10,10)]
|
||||
[Native]
|
||||
public enum AVSampleBufferRequestMode : nint {
|
||||
Immediate,
|
||||
Scheduled,
|
||||
}
|
||||
#endif
|
||||
|
||||
[NoTV, NoWatch, NoMac, iOS (10,0)]
|
||||
|
|
|
@ -14,6 +14,24 @@ namespace XamCore.AVKit {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if MONOMAC
|
||||
[Mac (10,10)]
|
||||
[Native]
|
||||
public enum AVCaptureViewControlsStyle : nint {
|
||||
Inline,
|
||||
Floating,
|
||||
InlineDeviceSelection,
|
||||
Default = Inline,
|
||||
}
|
||||
|
||||
[Mac (10,9)]
|
||||
[Native]
|
||||
public enum AVPlayerViewTrimResult : nint {
|
||||
OKButton,
|
||||
CancelButton
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !TVOS && (!MONOMAC || !XAMCORE_4_0)
|
||||
[iOS (9,0)]
|
||||
[Native]
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
65
src/avkit.cs
65
src/avkit.cs
|
@ -256,7 +256,7 @@ namespace XamCore.AVKit {
|
|||
[Export ("playerViewController:didRejectContentProposal:")]
|
||||
void DidRejectContentProposal (AVPlayerViewController playerViewController, AVContentProposal proposal);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
[Mac (10,9, onlyOn64 : true)]
|
||||
|
@ -284,6 +284,69 @@ namespace XamCore.AVKit {
|
|||
[Mac (10,10)]
|
||||
[Export ("contentOverlayView")]
|
||||
NSView ContentOverlayView { get; }
|
||||
|
||||
[Mac (10,9)]
|
||||
[Export ("actionPopUpButtonMenu")]
|
||||
NSMenu ActionPopUpButtonMenu { get; set; }
|
||||
|
||||
[Mac (10,9)] // No async
|
||||
[Export ("beginTrimmingWithCompletionHandler:")]
|
||||
void BeginTrimming (Action<AVPlayerViewTrimResult> handler);
|
||||
|
||||
[Mac (10,9)]
|
||||
[Export ("canBeginTrimming")]
|
||||
bool CanBeginTrimming { get; }
|
||||
|
||||
[Mac (10,9)]
|
||||
[Export ("flashChapterNumber:chapterTitle:")]
|
||||
void FlashChapter (nuint chapterNumber, string chapterTitle);
|
||||
|
||||
[Mac (10,9)]
|
||||
[Export ("showsFrameSteppingButtons")]
|
||||
bool ShowsFrameSteppingButtons { get; set; }
|
||||
|
||||
[Mac (10,9)]
|
||||
[Export ("showsFullScreenToggleButton")]
|
||||
bool ShowsFullScreenToggleButton { get; set; }
|
||||
|
||||
[Mac (10,9)]
|
||||
[Export ("showsSharingServiceButton")]
|
||||
bool ShowsSharingServiceButton { get; set; }
|
||||
}
|
||||
|
||||
[Mac (10,10, onlyOn64 : true)]
|
||||
[BaseType (typeof (NSView))]
|
||||
interface AVCaptureView {
|
||||
|
||||
[Export ("session"), NullAllowed]
|
||||
AVCaptureSession Session { get; }
|
||||
|
||||
[Export ("setSession:showVideoPreview:showAudioPreview:")]
|
||||
void SetSession ([NullAllowed] AVCaptureSession session, bool showVideoPreview, bool showAudioPreview);
|
||||
|
||||
[Export ("fileOutput"), NullAllowed]
|
||||
AVCaptureFileOutput FileOutput { get; }
|
||||
|
||||
[Export ("delegate", ArgumentSemantic.Weak), NullAllowed]
|
||||
IAVCaptureViewDelegate Delegate { get; set; }
|
||||
|
||||
[Export ("controlsStyle")]
|
||||
AVCaptureViewControlsStyle ControlsStyle { get; set; }
|
||||
|
||||
// TODO: Create an enum version of this property
|
||||
[Export ("videoGravity", ArgumentSemantic.Copy)]
|
||||
NSString WeakVideoGravity { get; set; }
|
||||
}
|
||||
|
||||
interface IAVCaptureViewDelegate { }
|
||||
|
||||
[Protocol, Model]
|
||||
[Mac (10,10, onlyOn64 : true)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
interface AVCaptureViewDelegate {
|
||||
[Abstract]
|
||||
[Export ("captureView:startRecordingToFileOutput:")]
|
||||
void StartRecording (AVCaptureView captureView, AVCaptureFileOutput fileOutput);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
#if XAMCORE_2_0
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
@ -49,6 +50,23 @@ namespace MonoTouchFixtures.AVFoundation {
|
|||
Assert.That (nfloat.IsNaN (r.Height), "Height");
|
||||
}
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
[Preserve (AllMembers = true)]
|
||||
public class AVStructTest {
|
||||
|
||||
[Test]
|
||||
public void StructSizeTest ()
|
||||
{
|
||||
if (!TestRuntime.CheckXcodeVersion (6, 1))
|
||||
Assert.Ignore ("Ignoring Tests: Requires Xcode 6.1+ API");
|
||||
|
||||
Assert.That (Marshal.SizeOf (typeof (AVSampleCursorSyncInfo)), Is.EqualTo (3), "AVSampleCursorSyncInfo Size");
|
||||
Assert.That (Marshal.SizeOf (typeof (AVSampleCursorDependencyInfo)), Is.EqualTo (6), "AVSampleCursorDependencyInfo Size");
|
||||
Assert.That (Marshal.SizeOf (typeof (AVSampleCursorStorageRange)), Is.EqualTo (16), "AVSampleCursorStorageRange Size");
|
||||
Assert.That (Marshal.SizeOf (typeof (AVSampleCursorChunkInfo)), Is.EqualTo (IntPtr.Size == 8 ? 16 : 12), "AVSampleCursorChunkInfo Size");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !__WATCHOS__
|
||||
|
|
|
@ -1,5 +1,145 @@
|
|||
# OSX specific issues we want to ignore
|
||||
|
||||
## AVFoundation
|
||||
|
||||
# Won't be used as a Delegate protocol so no need to mark this one as abstract
|
||||
!incorrect-protocol-member! AVFragmentMinding::isAssociatedWithFragmentMinder is REQUIRED and should be abstract
|
||||
|
||||
#iOS Only. Available on OSX but probably private selector mostly decorated with NS_AVAILABLE_IOS
|
||||
!missing-enum! AVCaptureAutoFocusSystem not bound
|
||||
!missing-field! AVAssetResourceLoadingRequestStreamingContentKeyRequestRequiresPersistentKey not bound
|
||||
!missing-field! AVAudioTimePitchAlgorithmLowQualityZeroLatency not bound
|
||||
!missing-field! AVCaptureDeviceSubjectAreaDidChangeNotification not bound
|
||||
!missing-field! AVCaptureExposureDurationCurrent not bound
|
||||
!missing-field! AVCaptureExposureTargetBiasCurrent not bound
|
||||
!missing-field! AVCaptureISOCurrent not bound
|
||||
!missing-field! AVCaptureLensPositionCurrent not bound
|
||||
!missing-field! AVCaptureSessionPresetInputPriority not bound
|
||||
!missing-field! AVCaptureWhiteBalanceGainsCurrent not bound
|
||||
!missing-field! AVMediaCharacteristicEasyToRead not bound
|
||||
!missing-field! AVMediaTypeMetadataObject not bound
|
||||
!missing-field! AVMetadataObjectTypeAztecCode not bound
|
||||
!missing-field! AVMetadataObjectTypeCode128Code not bound
|
||||
!missing-field! AVMetadataObjectTypeCode39Code not bound
|
||||
!missing-field! AVMetadataObjectTypeCode39Mod43Code not bound
|
||||
!missing-field! AVMetadataObjectTypeCode93Code not bound
|
||||
!missing-field! AVMetadataObjectTypeDataMatrixCode not bound
|
||||
!missing-field! AVMetadataObjectTypeEAN13Code not bound
|
||||
!missing-field! AVMetadataObjectTypeEAN8Code not bound
|
||||
!missing-field! AVMetadataObjectTypeFace not bound
|
||||
!missing-field! AVMetadataObjectTypeITF14Code not bound
|
||||
!missing-field! AVMetadataObjectTypeInterleaved2of5Code not bound
|
||||
!missing-field! AVMetadataObjectTypePDF417Code not bound
|
||||
!missing-field! AVMetadataObjectTypeQRCode not bound
|
||||
!missing-field! AVMetadataObjectTypeUPCECode not bound
|
||||
!missing-field! AVURLAssetAllowsCellularAccessKey not bound
|
||||
!missing-field! AVURLAssetHTTPCookiesKey not bound
|
||||
!missing-selector! AVAssetResourceLoadingRequest::persistentContentKeyFromKeyVendorResponse:options:error: not bound
|
||||
!missing-selector! AVAudioRecorder::deviceCurrentTime not bound
|
||||
!missing-selector! AVAudioRecorder::recordAtTime: not bound
|
||||
!missing-selector! AVAudioRecorder::recordAtTime:forDuration: not bound
|
||||
!missing-selector! AVCaptureAudioDataOutput::recommendedAudioSettingsForAssetWriterWithOutputFileType: not bound
|
||||
!missing-selector! AVCaptureDevice::ISO not bound
|
||||
!missing-selector! AVCaptureDevice::setAutoFocusRangeRestriction: not bound
|
||||
!missing-selector! AVCaptureDevice::autoFocusRangeRestriction not bound
|
||||
!missing-selector! AVCaptureDevice::setAutomaticallyAdjustsVideoHDREnabled: not bound
|
||||
!missing-selector! AVCaptureDevice::automaticallyAdjustsVideoHDREnabled not bound
|
||||
!missing-selector! AVCaptureDevice::setAutomaticallyEnablesLowLightBoostWhenAvailable: not bound
|
||||
!missing-selector! AVCaptureDevice::automaticallyEnablesLowLightBoostWhenAvailable not bound
|
||||
!missing-selector! AVCaptureDevice::chromaticityValuesForDeviceWhiteBalanceGains: not bound
|
||||
!missing-selector! AVCaptureDevice::deviceWhiteBalanceGains not bound
|
||||
!missing-selector! AVCaptureDevice::deviceWhiteBalanceGainsForChromaticityValues: not bound
|
||||
!missing-selector! AVCaptureDevice::deviceWhiteBalanceGainsForTemperatureAndTintValues: not bound
|
||||
!missing-selector! AVCaptureDevice::exposureDuration not bound
|
||||
!missing-selector! AVCaptureDevice::exposureTargetBias not bound
|
||||
!missing-selector! AVCaptureDevice::exposureTargetOffset not bound
|
||||
!missing-selector! AVCaptureDevice::grayWorldDeviceWhiteBalanceGains not bound
|
||||
!missing-selector! AVCaptureDevice::isAutoFocusRangeRestrictionSupported not bound
|
||||
!missing-selector! AVCaptureDevice::isFlashActive not bound
|
||||
!missing-selector! AVCaptureDevice::isFlashAvailable not bound
|
||||
!missing-selector! AVCaptureDevice::isLowLightBoostEnabled not bound
|
||||
!missing-selector! AVCaptureDevice::isLowLightBoostSupported not bound
|
||||
!missing-selector! AVCaptureDevice::isRampingVideoZoom not bound
|
||||
!missing-selector! AVCaptureDevice::isSmoothAutoFocusEnabled not bound
|
||||
!missing-selector! AVCaptureDevice::isSmoothAutoFocusSupported not bound
|
||||
!missing-selector! AVCaptureDevice::isSubjectAreaChangeMonitoringEnabled not bound
|
||||
!missing-selector! AVCaptureDevice::isTorchActive not bound
|
||||
!missing-selector! AVCaptureDevice::isTorchAvailable not bound
|
||||
!missing-selector! AVCaptureDevice::isVideoHDREnabled not bound
|
||||
!missing-selector! AVCaptureDevice::lensAperture not bound
|
||||
!missing-selector! AVCaptureDevice::lensPosition not bound
|
||||
!missing-selector! AVCaptureDevice::maxExposureTargetBias not bound
|
||||
!missing-selector! AVCaptureDevice::maxWhiteBalanceGain not bound
|
||||
!missing-selector! AVCaptureDevice::minExposureTargetBias not bound
|
||||
!missing-selector! AVCaptureDevice::rampToVideoZoomFactor:withRate: not bound
|
||||
!missing-selector! AVCaptureDevice::setExposureModeCustomWithDuration:ISO:completionHandler: not bound
|
||||
!missing-selector! AVCaptureDevice::setExposureTargetBias:completionHandler: not bound
|
||||
!missing-selector! AVCaptureDevice::setFocusModeLockedWithLensPosition:completionHandler: not bound
|
||||
!missing-selector! AVCaptureDevice::setSmoothAutoFocusEnabled: not bound
|
||||
!missing-selector! AVCaptureDevice::setSubjectAreaChangeMonitoringEnabled: not bound
|
||||
!missing-selector! AVCaptureDevice::setTorchModeOnWithLevel:error: not bound
|
||||
!missing-selector! AVCaptureDevice::setVideoHDREnabled: not bound
|
||||
!missing-selector! AVCaptureDevice::setVideoZoomFactor: not bound
|
||||
!missing-selector! AVCaptureDevice::setWhiteBalanceModeLockedWithDeviceWhiteBalanceGains:completionHandler: not bound
|
||||
!missing-selector! AVCaptureDevice::temperatureAndTintValuesForDeviceWhiteBalanceGains: not bound
|
||||
!missing-selector! AVCaptureDevice::torchLevel not bound
|
||||
!missing-selector! AVCaptureDevice::transportControlsSpeed not bound
|
||||
!missing-selector! AVCaptureDevice::videoZoomFactor not bound
|
||||
!missing-selector! AVCaptureMetadataOutput::availableMetadataObjectTypes not bound
|
||||
!missing-selector! AVCaptureMetadataOutput::metadataObjectTypes not bound
|
||||
!missing-selector! AVCaptureMetadataOutput::metadataObjectsCallbackQueue not bound
|
||||
!missing-selector! AVCaptureMetadataOutput::metadataObjectsDelegate not bound
|
||||
!missing-selector! AVCaptureMetadataOutput::rectOfInterest not bound
|
||||
!missing-selector! AVCaptureMetadataOutput::setMetadataObjectTypes: not bound
|
||||
!missing-selector! AVCaptureMetadataOutput::setMetadataObjectsDelegate:queue: not bound
|
||||
!missing-selector! AVCaptureMetadataOutput::setRectOfInterest: not bound
|
||||
!missing-selector! AVCaptureMetadataInput::appendTimedMetadataGroup:error: not bound
|
||||
!missing-selector! AVCaptureMetadataInput::initWithFormatDescription:clock: not bound
|
||||
!missing-selector! AVCaptureOutput::metadataOutputRectOfInterestForRect: not bound
|
||||
!missing-selector! AVCaptureOutput::rectForMetadataOutputRectOfInterest: not bound
|
||||
!missing-selector! AVCaptureOutput::transformedMetadataObjectForMetadataObject:connection: not bound
|
||||
!missing-selector! AVCaptureVideoDataOutput::recommendedVideoSettingsForAssetWriterWithOutputFileType: not bound
|
||||
!missing-selector! AVCaptureVideoPreviewLayer::captureDevicePointOfInterestForPoint: not bound
|
||||
!missing-selector! AVCaptureVideoPreviewLayer::metadataOutputRectOfInterestForRect: not bound
|
||||
!missing-selector! AVCaptureVideoPreviewLayer::pointForCaptureDevicePointOfInterest: not bound
|
||||
!missing-selector! AVCaptureVideoPreviewLayer::rectForMetadataOutputRectOfInterest: not bound
|
||||
!missing-selector! AVCaptureVideoPreviewLayer::transformedMetadataObjectForMetadataObject: not bound
|
||||
!missing-selector! AVMetadataMachineReadableCodeObject::corners not bound
|
||||
!missing-selector! AVMetadataMachineReadableCodeObject::stringValue not bound
|
||||
!missing-selector! AVPlayer::setUsesExternalPlaybackWhileExternalScreenIsActive: not bound
|
||||
!missing-selector! AVPlayer::usesExternalPlaybackWhileExternalScreenIsActive not bound
|
||||
!missing-protocol! AVCaptureMetadataOutputObjectsDelegate not bound
|
||||
!missing-type! AVCaptureMetadataInput not bound
|
||||
!missing-type! AVMetadataMachineReadableCodeObject not bound
|
||||
!missing-type! AVCaptureMetadataOutput not bound
|
||||
|
||||
# Manually bound
|
||||
!missing-field! AVOutputSettingsPreset1280x720 not bound
|
||||
!missing-field! AVOutputSettingsPreset1920x1080 not bound
|
||||
!missing-field! AVOutputSettingsPreset3840x2160 not bound
|
||||
!missing-field! AVOutputSettingsPreset640x480 not bound
|
||||
!missing-field! AVOutputSettingsPreset960x540 not bound
|
||||
|
||||
# Deprecated so won't bind it
|
||||
!missing-selector! AVAudioUnitComponent::componentURL not bound
|
||||
!missing-selector! AVCaptureConnection::isVideoMaxFrameDurationSupported not bound
|
||||
!missing-selector! AVCaptureConnection::setVideoMaxFrameDuration: not bound
|
||||
!missing-selector! AVCaptureConnection::videoMaxFrameDuration not bound
|
||||
|
||||
# TODO: Verify Later, could not find it on header
|
||||
!missing-selector! AVAssetReaderTrackOutput::setAudioTimePitchAlgorithm: not bound
|
||||
!missing-selector! AVPlayerItem::contentAuthorizationRequestStatus not bound
|
||||
!missing-selector! AVPlayerItem::isApplicationAuthorizedForPlayback not bound
|
||||
!missing-selector! AVPlayerItem::isAuthorizationRequiredForPlayback not bound
|
||||
!missing-selector! AVPlayerItem::isContentAuthorizedForPlayback not bound
|
||||
!missing-selector! AVPlayerItem::requestContentAuthorizationAsynchronouslyWithTimeoutInterval:completionHandler: not bound
|
||||
|
||||
# TODO: Not bound, needed unbound type
|
||||
!missing-selector! AVPlayerItemOutput::itemTimeForCVTimeStamp: not bound
|
||||
!missing-selector! AVAudioEngine::musicSequence not bound
|
||||
!missing-selector! AVAudioEngine::setMusicSequence: not bound
|
||||
|
||||
# --- End of AVFoundation - AVKit ---
|
||||
|
||||
# OSX only - API not exposed in XI even if it's in the header files
|
||||
!missing-selector! NEVPNProtocol::identityReference is not bound
|
||||
|
|
Загрузка…
Ссылка в новой задаче