Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[replaykit] Update up to beta 5 #2484

Merged
merged 2 commits into from
Aug 14, 2017
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
12 changes: 12 additions & 0 deletions src/ReplayKit/RPEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public enum RPRecordingError : nint {
ContentResize = -5807,
BroadcastInvalidSession = -5808,
SystemDormancy = -5809,
Entitlements = -5810,
ActivePhoneCall = -5811,
FailedToSave = -5812,
CarPlay = -5813,
}

[NoiOS]
Expand All @@ -45,4 +49,12 @@ public enum RPSampleBufferType : nint {
AudioApp,
AudioMic
}

[Native]
[iOS (11,0)]
[NoTV]
public enum RPCameraPosition : nint {
Front = 1,
Back,
}
}
48 changes: 48 additions & 0 deletions src/replaykit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ bool MicrophoneEnabled {
[NoTV, iOS (10,0)]
[NullAllowed, Export ("cameraPreviewView")]
UIView CameraPreviewView { get; }

[NoTV][iOS (11,0)]
[Export ("cameraPosition", ArgumentSemantic.Assign)]
RPCameraPosition CameraPosition { get; set; }

[TV (11,0)][iOS (11,0)]
[Async]
[Export ("startCaptureWithHandler:completionHandler:")]
void StartCapture ([NullAllowed] Action<CMSampleBuffer, RPSampleBufferType, NSError> captureHandler, [NullAllowed] Action<NSError> completionHandler);

[TV (11,0), iOS (11,0)]
[Async]
[Export ("stopCaptureWithHandler:")]
void StopCapture ([NullAllowed] Action<NSError> handler);
}

interface IRPScreenRecorderDelegate { }
Expand All @@ -112,9 +126,15 @@ interface IRPScreenRecorderDelegate { }
[BaseType (typeof (NSObject))]
interface RPScreenRecorderDelegate {

[Deprecated (PlatformName.TvOS, 11,0, message: "Use 'DidStopRecording(RPScreenRecorder,RPPreviewViewController,NSError)' instead.")]
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'DidStopRecording(RPScreenRecorder,RPPreviewViewController,NSError)' instead.")]
[Export ("screenRecorder:didStopRecordingWithError:previewViewController:")]
void DidStopRecording (RPScreenRecorder screenRecorder, NSError error, [NullAllowed] RPPreviewViewController previewViewController);

[TV (11,0)][iOS (11,0)]
[Export ("screenRecorder:didStopRecordingWithPreviewViewController:error:")]
void DidStopRecording (RPScreenRecorder screenRecorder, [NullAllowed] RPPreviewViewController previewViewController, [NullAllowed] NSError error);

[Export ("screenRecorderDidChangeAvailability:")]
void DidChangeAvailability (RPScreenRecorder screenRecorder);
}
Expand All @@ -135,6 +155,12 @@ interface RPBroadcastActivityViewController {

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

[iOS (11,0)]
[NoTV]
[Static]
[Export ("loadBroadcastActivityViewControllerWithPreferredExtension:handler:")]
void LoadBroadcastActivityViewController ([NullAllowed] string preferredExtension, Action<RPBroadcastActivityViewController, NSError> handler);
}

interface IRPBroadcastActivityViewControllerDelegate {}
Expand Down Expand Up @@ -168,6 +194,8 @@ interface RPBroadcastController {
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
IRPBroadcastControllerDelegate Delegate { get; set; }

[Deprecated (PlatformName.TvOS, 11,0)]
[Deprecated (PlatformName.iOS, 11,0)]
[Export ("broadcastExtensionBundleID")]
string BroadcastExtensionBundleID { get; }

Expand Down Expand Up @@ -198,10 +226,16 @@ interface RPBroadcastControllerDelegate {

[Export ("broadcastController:didUpdateServiceInfo:")]
void DidUpdateServiceInfo (RPBroadcastController broadcastController, NSDictionary<NSString, INSCoding> serviceInfo);

[TV (11,0), iOS (11,0)]
[Export ("broadcastController:didUpdateBroadcastURL:")]
void DidUpdateBroadcastUrl (RPBroadcastController broadcastController, NSUrl broadcastUrl);
}

[iOS (10,0)]
[TV (10,0)]
[Deprecated (PlatformName.TvOS, 11,0)]
[Deprecated (PlatformName.iOS, 11,0)]
[BaseType (typeof (NSObject))]
interface RPBroadcastConfiguration : NSCoding, NSSecureCoding {
[Export ("clipDuration")]
Expand All @@ -221,8 +255,14 @@ interface NSExtensionContext_RPBroadcastExtension {
[Export ("loadBroadcastingApplicationInfoWithCompletion:")]
void LoadBroadcastingApplicationInfo (LoadBroadcastingHandler handler);

[Deprecated (PlatformName.TvOS, 11,0, message: "Use 'CompleteRequest(NSUrl,NSDictionary<NSString,INSCoding>)' instead.")]
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'CompleteRequest(NSUrl,NSDictionary<NSString,INSCoding>)' instead.")]
[Export ("completeRequestWithBroadcastURL:broadcastConfiguration:setupInfo:")]
void CompleteRequest (NSUrl broadcastURL, RPBroadcastConfiguration broadcastConfiguration, [NullAllowed] NSDictionary<NSString, INSCoding> setupInfo);

[TV (11,0)][iOS (11,0)]
[Export ("completeRequestWithBroadcastURL:setupInfo:")]
void CompleteRequest (NSUrl broadcastURL, [NullAllowed] NSDictionary<NSString, INSCoding> setupInfo);
}

[iOS (10,0)]
Expand All @@ -231,10 +271,18 @@ interface NSExtensionContext_RPBroadcastExtension {
interface RPBroadcastHandler : NSExtensionRequestHandling {
[Export ("updateServiceInfo:")]
void UpdateServiceInfo (NSDictionary<NSString, INSCoding> serviceInfo);

// NSInvalidArgumentException -[RPBroadcastHandler updateBroadcastURL:]: unrecognized selector sent to instance 0x608001a4b160
// https://trello.com/c/eA440suj/91-33875315-rpbroadcasthandler-updatebroadcasturl-unrecognized-selector
//[TV (11,0)][iOS (11,0)]
//[Export ("updateBroadcastURL:")]
//void UpdateBroadcastUrl (NSUrl broadcastUrl);
}

[iOS (10,0)]
[TV (10,0)]
[Deprecated (PlatformName.TvOS, 11,0, message: "Use 'RPBroadcastSampleHandler' instead.")]
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'RPBroadcastSampleHandler' instead.")]
[BaseType (typeof (RPBroadcastHandler))]
interface RPBroadcastMP4ClipHandler {
[Export ("processMP4ClipWithURL:setupInfo:finished:")]
Expand Down
10 changes: 10 additions & 0 deletions tests/monotouch-test/ReplayKit/BroadcastHandlerTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
namespace monotouchtest.ReplayKit
{
public class BroadcastHandlerTest
{
public BroadcastHandlerTest ()
{
}
}
}
6 changes: 6 additions & 0 deletions tests/xtro-sharpie/common.pending
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
!missing-field! PHLivePhotoShouldRenderAtPlaybackTime not bound


# ReplayKit

## https://trello.com/c/eA440suj/91-33875315-rpbroadcasthandler-updatebroadcasturl-unrecognized-selector
!missing-selector! RPBroadcastHandler::updateBroadcastURL: not bound


# SpriteKit

## Deprecated in iOS 10
Expand Down
6 changes: 6 additions & 0 deletions tests/xtro-sharpie/tvos.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@
!missing-selector! MPNowPlayingInfoCenter::setPlaybackState: not bound


# ReplayKit

## Not used on tvOS (no camera)
!missing-enum! RPCameraPosition not bound


# StoreKit

## SKStoreProductViewController is not in tvOS and the only member of the delegate is not either
Expand Down