[VideoToolbox] Updated to Xcode 8.3 Beta 1

* Updated API to reflect Xcode 8.3 beta 1 changes
* This commit also fixes availability metadata to avoid duplicating it
  by moving member availability metadata into its container class where
  possible.
* Enables VideoToolbox tests for tvOS.
This commit is contained in:
Alex Soto 2017-02-09 00:39:36 -06:00 коммит произвёл Sebastien Pouliot
Родитель b1f9ac84bc
Коммит 3a1276a992
18 изменённых файлов: 96 добавлений и 263 удалений

Просмотреть файл

@ -17,7 +17,6 @@ using XamCore.CoreVideo;
namespace XamCore.VideoToolbox {
public partial class VTCompressionProperties {
[Mac (10,8), iOS (8,0)]
public VTProfileLevel ProfileLevel {
get {
var key = GetNSStringValue (VTCompressionPropertyKey.ProfileLevel);
@ -275,7 +274,7 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,9), iOS (8,0)]
[Mac (10,9)]
public VTH264EntropyMode H264EntropyMode {
get {
var key = GetNSStringValue (VTCompressionPropertyKey.H264EntropyMode);
@ -303,7 +302,6 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,8), iOS (8,0)]
public List<VTDataRateLimit> DataRateLimits {
get {
using (var arr = GetNativeValue <NSArray> (VTCompressionPropertyKey.DataRateLimits)) {
@ -340,7 +338,6 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,8), iOS (8,0)]
public VTFieldDetail FieldDetail {
get {
var key = GetNSStringValue (VTCompressionPropertyKey.FieldDetail);
@ -378,7 +375,6 @@ namespace XamCore.VideoToolbox {
}
}
#if XAMCORE_2_0
[Mac (10,8), iOS (8,0)]
public VTColorPrimaries ColorPrimaries {
get {
var key = GetNSStringValue (VTCompressionPropertyKey.ColorPrimaries);
@ -417,7 +413,6 @@ namespace XamCore.VideoToolbox {
}
#endif
[Mac (10,8), iOS (8,0)]
public VTTransferFunction TransferFunction {
get {
var key = GetNSStringValue (VTCompressionPropertyKey.TransferFunction);
@ -450,7 +445,6 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,8), iOS (8,0)]
public VTYCbCrMatrix YCbCrMatrix {
get {
var key = GetNSStringValue (VTCompressionPropertyKey.YCbCrMatrix);
@ -483,7 +477,6 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,8), iOS (8,0)]
public VTMultiPassStorage MultiPassStorage {
get {
return GetNativeValue<VTMultiPassStorage> (VTCompressionPropertyKey.MultiPassStorage);

Просмотреть файл

@ -17,7 +17,7 @@ using XamCore.CoreMedia;
using XamCore.CoreVideo;
namespace XamCore.VideoToolbox {
[Mac (10,8), iOS (8,0)]
[Mac (10,8), iOS (8,0), TV (10,2)]
public class VTCompressionSession : VTSession {
GCHandle callbackHandle;

Просмотреть файл

@ -17,14 +17,12 @@ using XamCore.CoreVideo;
namespace XamCore.VideoToolbox {
public partial class VTDecompressionProperties {
[Mac (10,8), iOS (8,0)]
public CVPixelBufferPool PixelBufferPool {
get {
return GetNativeValue<CVPixelBufferPool> (VTDecompressionPropertyKey.PixelBufferPool);
}
}
[Mac (10,8), iOS (8,0)]
public VTFieldMode FieldMode {
get {
var key = GetNSStringValue (VTDecompressionPropertyKey.FieldMode);
@ -67,7 +65,6 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,8), iOS (8,0)]
public VTDeinterlaceMode DeinterlaceMode {
get {
var key = GetNSStringValue (VTDecompressionPropertyKey.DeinterlaceMode);
@ -95,7 +92,6 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,8), iOS (8,0)]
public VTOnlyTheseFrames OnlyTheseFrames {
get {
var key = GetNSStringValue (VTDecompressionPropertyKey.OnlyTheseFrames);

Просмотреть файл

@ -17,7 +17,7 @@ using XamCore.CoreMedia;
using XamCore.CoreVideo;
namespace XamCore.VideoToolbox {
[Mac (10,8), iOS (8,0)]
[Mac (10,8), iOS (8,0), TV (10,2)]
public class VTDecompressionSession : VTSession {
GCHandle callbackHandle;

Просмотреть файл

@ -16,7 +16,7 @@ using XamCore.Foundation;
using XamCore.CoreMedia;
namespace XamCore.VideoToolbox {
[Mac (10,10), iOS (8,0)]
[Mac (10,10), iOS (8,0), TV (10,2)]
public class VTFrameSilo : INativeObject, IDisposable {
IntPtr handle;
GCHandle callbackHandle;

Просмотреть файл

@ -16,7 +16,7 @@ using XamCore.Foundation;
using XamCore.CoreMedia;
namespace XamCore.VideoToolbox {
[Mac (10,10), iOS (8,0)]
[Mac (10,10), iOS (8,0), TV (10,2)]
public class VTMultiPassStorage : INativeObject, IDisposable {
IntPtr handle;
bool closed;

Просмотреть файл

@ -20,7 +20,6 @@ using XamCore.AVFoundation;
namespace XamCore.VideoToolbox {
public partial class VTPixelTransferProperties : DictionaryContainer {
[Mac (10,8), iOS (9,0)]
public VTScalingMode ScalingMode {
get {
var key = GetNSStringValue (VTPixelTransferPropertyKeys.ScalingMode);
@ -58,7 +57,6 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,8), iOS (9,0)]
public VTDownsamplingMode DownsamplingMode {
get {
var key = GetNSStringValue (VTPixelTransferPropertyKeys.DownsamplingMode);
@ -86,8 +84,8 @@ namespace XamCore.VideoToolbox {
}
}
#if MONOMAC && XAMCORE_2_0
[Mac (10,8)]
#if XAMCORE_2_0
[iOS (10,0)]
public VTColorPrimaries DestinationColorPrimaries {
get {
var key = GetNSStringValue (VTPixelTransferPropertyKeys.DestinationColorPrimaries);
@ -125,8 +123,8 @@ namespace XamCore.VideoToolbox {
}
}
#endif
#if MONOMAC
[Mac (10,8)]
[iOS (10,0)]
public VTTransferFunction DestinationTransferFunction {
get {
var key = GetNSStringValue (VTPixelTransferPropertyKeys.DestinationTransferFunction);
@ -158,8 +156,7 @@ namespace XamCore.VideoToolbox {
}
}
}
#endif
[Mac (10,8), iOS (9,0)]
public VTYCbCrMatrix DestinationYCbCrMatrix {
get {
var key = GetNSStringValue (VTPixelTransferPropertyKeys.DestinationYCbCrMatrix);

Просмотреть файл

@ -18,7 +18,6 @@ using XamCore.CoreVideo;
namespace XamCore.VideoToolbox {
public partial class VTPropertyOptions {
[Mac (10,8), iOS (8,0)]
public VTPropertyType Type {
get {
var key = GetNSStringValue (VTPropertyKeys.Type);
@ -51,7 +50,6 @@ namespace XamCore.VideoToolbox {
}
}
[Mac (10,8), iOS (8,0)]
public VTReadWriteStatus ReadWriteStatus {
get {
var key = GetNSStringValue (VTPropertyKeys.ReadWriteStatus);

Просмотреть файл

@ -16,7 +16,7 @@ using XamCore.CoreMedia;
using XamCore.CoreVideo;
namespace XamCore.VideoToolbox {
[Mac (10,8), iOS (8,0)]
[Mac (10,8), iOS (8,0), TV (10,2)]
public class VTSession : INativeObject, IDisposable {
IntPtr handle;

Просмотреть файл

@ -15,8 +15,8 @@ using XamCore.CoreGraphics;
using XamCore.CoreVideo;
namespace XamCore.VideoToolbox {
[Mac (10,11), iOS (9,0), TV (10,2)]
public static class VTUtilities {
[Mac (10,11), iOS (9,0)]
[DllImport (Constants.VideoToolboxLibrary)]
extern static VTStatus VTCreateCGImageFromCVPixelBuffer (
/* CM_NONNULL CVPixelBufferRef */ IntPtr pixelBuffer,
@ -26,7 +26,6 @@ namespace XamCore.VideoToolbox {
// intentionally not exposing the (NSDictionary options) argument
// since header docs indicate that there are no options available
// as of 9.0/10.11 and to always pass NULL
[Mac (10,11), iOS (9,0)]
public static VTStatus ToCGImage (this CVPixelBuffer pixelBuffer, out CGImage image)
{
if (pixelBuffer == null)

Просмотреть файл

@ -12,7 +12,7 @@ using XamCore.ObjCRuntime;
using XamCore.Foundation;
namespace XamCore.VideoToolbox {
[Mac (10,8), iOS (8,0)]
[Mac (10,8), iOS (8,0), TV (10,2)]
public class VTVideoEncoder {
[DllImport (Constants.VideoToolboxLibrary)]

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -8,7 +8,7 @@
// Copyright 2015 Xamarin Inc. All rights reserved.
//
#if !__TVOS__ && !__WATCHOS__
#if !__WATCHOS__
using System;
@ -149,5 +149,5 @@ namespace MonoTouchFixtures.VideoToolbox {
}
}
#endif // !__TVOS__ && !__WATCHOS__
#endif // !__WATCHOS__

Просмотреть файл

@ -8,7 +8,7 @@
// Copyright 2015 Xamarin Inc. All rights reserved.
//
#if !__TVOS__ && !__WATCHOS__
#if !__WATCHOS__
using System;
@ -111,4 +111,4 @@ namespace MonoTouchFixtures.VideoToolbox {
}
}
#endif // !__TVOS__ && !__WATCHOS__
#endif // !__WATCHOS__

Просмотреть файл

@ -8,7 +8,7 @@
// Copyright 2015 Xamarin Inc. All rights reserved.
//
#if !__TVOS__ && !__WATCHOS__
#if !__WATCHOS__
using System;
@ -84,4 +84,4 @@ namespace MonoTouchFixtures.VideoToolbox {
}
}
#endif // !__TVOS__ && !__WATCHOS__
#endif // !__WATCHOS__

Просмотреть файл

@ -8,7 +8,7 @@
// Copyright 2015 Xamarin Inc. All rights reserved.
//
#if !__TVOS__ && !__WATCHOS__
#if !__WATCHOS__
using System;
@ -59,4 +59,4 @@ namespace MonoTouchFixtures.VideoToolbox {
}
}
#endif // !__TVOS__ && !__WATCHOS__
#endif // !__WATCHOS__

Просмотреть файл

@ -8,7 +8,7 @@
// Copyright 2015 Xamarin Inc. All rights reserved.
//
#if !__TVOS__ && !__WATCHOS__
#if !__WATCHOS__
using System;
using System.Drawing;
@ -76,14 +76,21 @@ namespace MonoTouchFixtures.VideoToolbox {
var pxbuffer = new CVPixelBuffer (originalCGImage.Width, originalCGImage.Height, CVPixelFormatType.CV32ARGB,
new CVPixelBufferAttributes { CGImageCompatibility = true, CGBitmapContextCompatibility = true });
#if !__TVOS__
pxbuffer.Lock (CVOptionFlags.None);
#else
pxbuffer.Lock (CVPixelBufferLock.None);
#endif
using (var colorSpace = CGColorSpace.CreateDeviceRGB ())
using (var ctx = new CGBitmapContext (pxbuffer.BaseAddress, originalCGImage.Width, originalCGImage.Height, 8,
4 * originalCGImage.Width, colorSpace, CGBitmapFlags.NoneSkipLast)) {
ctx.RotateCTM (0);
ctx.DrawImage (new RectangleF (0, 0, originalCGImage.Width, originalCGImage.Height), originalCGImage);
#if !__TVOS__
pxbuffer.Unlock (CVOptionFlags.None);
#else
pxbuffer.Unlock (CVPixelBufferLock.None);
#endif
}
Assert.NotNull (pxbuffer, "VTUtilitiesTests.ToCGImageTest pxbuffer should not be null");
@ -102,4 +109,4 @@ namespace MonoTouchFixtures.VideoToolbox {
}
}
#endif // !__TVOS__ && !__WATCHOS__
#endif // !__WATCHOS__

Просмотреть файл

@ -8,7 +8,7 @@
// Copyright 2015 Xamarin Inc. All rights reserved.
//
#if !__TVOS__ && !__WATCHOS__
#if !__WATCHOS__
using System;
#if XAMCORE_2_0
@ -39,4 +39,4 @@ namespace MonoTouchFixtures.VideoToolbox {
}
}
#endif // !__TVOS__ && !__WATCHOS__
#endif // !__WATCHOS__