diff --git a/src/AVFoundation/AVPlayerItemVideoOutput.cs b/src/AVFoundation/AVPlayerItemVideoOutput.cs index 4e196a14fe1d..49e1ecef022c 100644 --- a/src/AVFoundation/AVPlayerItemVideoOutput.cs +++ b/src/AVFoundation/AVPlayerItemVideoOutput.cs @@ -13,16 +13,16 @@ public partial class AVPlayerItemVideoOutput { enum InitMode { PixelAttributes, OutputSettings - } + } - AVPlayerItemVideoOutput (NSDictionary data, AVPlayerItemVideoOutput.InitMode mode) : this (IntPtr.Zero) + AVPlayerItemVideoOutput (NSDictionary data, AVPlayerItemVideoOutput.InitMode mode) : base (NSObjectFlag.Empty) { switch (mode) { case InitMode.PixelAttributes: - Handle = _FromPixelBufferAttributes (data); + InitializeHandle (_FromPixelBufferAttributes (data), "initWithPixelBufferAttributes:"); break; case InitMode.OutputSettings: - Handle = _FromOutputSettings (data); + InitializeHandle (_FromOutputSettings (data), "initWithOutputSettings:"); break; default: throw new ArgumentException (nameof (mode)); @@ -30,7 +30,7 @@ enum InitMode { } [DesignatedInitializer] - [Advice ("Please use the constructor that uses one of the available StrongDictionaries. This constructor expects Pixelbugger attributes.")] + [Advice ("Please use the constructor that uses one of the available StrongDictionaries. This constructor expects PixelBuffer attributes.")] protected AVPlayerItemVideoOutput (NSDictionary pixelBufferAttributes) : this (pixelBufferAttributes, InitMode.PixelAttributes) {} } } diff --git a/src/avfoundation.cs b/src/avfoundation.cs index 5224876e2980..aadf11371f8e 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -9945,11 +9945,11 @@ interface AVPlayerItemVideoOutput { [Export ("delegateQueue"), NullAllowed] DispatchQueue DelegateQueue { get; } - [Internal, Static] + [Internal] [Export ("initWithPixelBufferAttributes:")] IntPtr _FromPixelBufferAttributes ([NullAllowed] NSDictionary pixelBufferAttributes); - [Internal, Static] + [Internal] [Export ("initWithOutputSettings:")] IntPtr _FromOutputSettings ([NullAllowed] NSDictionary outputSettings); diff --git a/tests/monotouch-test/AVFoundation/PlayerItemVideoOutputTest.cs b/tests/monotouch-test/AVFoundation/PlayerItemVideoOutputTest.cs new file mode 100644 index 000000000000..bd0c00fd25a9 --- /dev/null +++ b/tests/monotouch-test/AVFoundation/PlayerItemVideoOutputTest.cs @@ -0,0 +1,44 @@ +// +// Unit tests for AVPlayerItemVideoOutput +// +// Authors: +// Sebastien Pouliot +// +// Copyright 2016 Xamarin Inc. All rights reserved. +// + +#if !__WATCHOS__ + +using System; +#if XAMCORE_2_0 +using AVFoundation; +using CoreVideo; +using Foundation; +using UIKit; +#else +using MonoTouch.AVFoundation; +using MonoTouch.CoreVideo; +using MonoTouch.Foundation; +using MonoTouch.UIKit; +#endif +using NUnit.Framework; + +namespace MonoTouchFixtures.AVFoundation { + + [TestFixture] + [Preserve (AllMembers = true)] + public class PlayerItemVideoOutputTest { + + [Test] + public void Ctor_CVPixelBufferAttributes () + { + var attributes = new CVPixelBufferAttributes () { + PixelFormatType = CVPixelFormatType.CV32BGRA + }; + using (var output = new AVPlayerItemVideoOutput (attributes)) + Assert.That (output.Handle, Is.Not.EqualTo (IntPtr.Zero), "valid"); + } + } +} + +#endif // !__WATCHOS__ diff --git a/tests/monotouch-test/monotouch-test.csproj b/tests/monotouch-test/monotouch-test.csproj index 27e700c367e2..ea16af810f85 100644 --- a/tests/monotouch-test/monotouch-test.csproj +++ b/tests/monotouch-test/monotouch-test.csproj @@ -644,6 +644,7 @@ +