8000 Fix compilation warning for iOS/macOS. · commetchat/flutter-webrtc@717ea64 · GitHub
[go: up one dir, main page]

Skip to content

Commit 717ea64

Browse files
committed
Fix compilation warning for iOS/macOS.
1 parent 66646b5 commit 717ea64

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

common/darwin/Classes/FlutterWebRTCPlugin.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
@class FlutterRTCVideoRenderer;
1111
@class FlutterRTCFrameCapturer;
1212

13-
void postEvent(FlutterEventSink sink, id _Nullable event);
13+
void postEvent(FlutterEventSink _Nonnull sink, id _Nullable event);
1414

1515
typedef void (^CompletionHandler)(void);
1616

17-
typedef void (^CapturerStopHandler)(CompletionHandler handler);
17+
typedef void (^CapturerStopHandler)(CompletionHandler _Nonnull handler);
1818

1919
@interface FlutterWebRTCPlugin : NSObject <FlutterPlugin,
2020
RTCPeerConnectionDelegate,
@@ -26,43 +26,43 @@ typedef void (^CapturerStopHandler)(CompletionHandler handler);
2626
#endif
2727
>
2828

29-
@property(nonatomic, strong) RTCPeerConnectionFactory* peerConnectionFactory;
30-
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCPeerConnection*>* peerConnections;
31-
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCMediaStream*>* localStreams;
32-
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCMediaStreamTrack*>* localTracks;
33-
@property(nonatomic, strong) NSMutableDictionary<NSNumber*, FlutterRTCVideoRenderer*>* renders;
29+
@property(nonatomic, strong) RTCPeerConnectionFactory* _Nullable peerConnectionFactory;
30+
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCPeerConnection*>* _Nullable peerConnections;
31+
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCMediaStream*>* _Nullable localStreams;
32+
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCMediaStreamTrack*>* _Nullable localTracks;
33+
@property(nonatomic, strong) NSMutableDictionary<NSNumber*, FlutterRTCVideoRenderer*>* _Nullable renders;
3434
@property(nonatomic, strong)
35-
NSMutableDictionary<NSString*, CapturerStopHandler>* videoCapturerStopHandlers;
35+
NSMutableDictionary<NSString*, CapturerStopHandler>* _Nullable videoCapturerStopHandlers;
3636

37-
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCFrameCryptor*>* frameCryptors;
38-
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCFrameCryptorKeyProvider*>* keyProviders;
37+
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCFrameCryptor*>* _Nullable frameCryptors;
38+
@property(nonatomic, strong) NSMutableDictionary<NSString*, RTCFrameCryptorKeyProvider*>* _Nullable keyProviders;
3939

4040
#if TARGET_OS_IPHONE
4141
@property(nonatomic, retain) UIViewController* viewController; /*for broadcast or ReplayKit */
4242
#endif
4343

44-
@property(nonatomic, strong) FlutterEventSink eventSink;
45-
@property(nonatomic, strong) NSObject<FlutterBinaryMessenger>* messenger;
46-
@property(nonatomic, strong) RTCCameraVideoCapturer* videoCapturer;
47-
@property(nonatomic, strong) FlutterRTCFrameCapturer* frameCapturer;
48-
@property(nonatomic, strong) AVAudioSessionPort preferredInput;
44+
@property(nonatomic, strong) FlutterEventSink _Nullable eventSink;
45+
@property(nonatomic, strong) NSObject<FlutterBinaryMessenger>* _Nonnull messenger;
46+
@property(nonatomic, strong) RTCCameraVideoCapturer* _Nullable videoCapturer;
47+
@property(nonatomic, strong) FlutterRTCFrameCapturer* _Nullable frameCapturer;
48+
@property(nonatomic, strong) AVAudioSessionPort _Nullable preferredInput;
4949
@property(nonatomic) BOOL _usingFrontCamera;
5050
@property(nonatomic) NSInteger _lastTargetWidth;
5151
@property(nonatomic) NSInteger _lastTargetHeight;
5252
@property(nonatomic) NSInteger _lastTargetFps;
5353

54-
- (RTCMediaStream*)streamForId:(NSString*)streamId peerConnectionId:(NSString*)peerConnectionId;
55-
- (RTCRtpTransceiver*)getRtpTransceiverById:(RTCPeerConnection*)peerConnection Id:(NSString*)Id;
56-
- (NSDictionary*)mediaStreamToMap:(RTCMediaStream*)stream ownerTag:(NSString*)ownerTag;
57-
- (NSDictionary*)mediaTrackToMap:(RTCMediaStreamTrack*)track;
58-
- (NSDictionary*)receiverToMap:(RTCRtpReceiver*)receiver;
59-
- (NSDictionary*)transceiverToMap:(RTCRtpTransceiver*)transceiver;
54+
- (RTCMediaStream* _Nullable)streamForId:(NSString* _Nonnull)streamId peerConnectionId:(NSString* _Nonnull)peerConnectionId;
55+
- (RTCRtpTransceiver* _Nullable)getRtpTransceiverById:(RTCPeerConnection* _Nonnull)peerConnection Id:(NSString* _Nonnull)Id;
56+
- (NSDictionary* _Nullable)mediaStreamToMap:(RTCMediaStream* _Nonnull)stream ownerTag:(NSString* _Nonnull)ownerTag;
57+
- (NSDictionary* _Nullable)mediaTrackToMap:(RTCMediaStreamTrack* _Nonnull)track;
58+
- (NSDictionary* _Nullable)receiverToMap:(RTCRtpReceiver* _Nonnull)receiver;
59+
- (NSDictionary* _Nullable)transceiverToMap:(RTCRtpTransceiver* _Nonnull)transceiver;
6060

6161
- (BOOL)hasLocalAudioTrack;
6262
- (void)ensureAudioSession;
6363
- (void)deactiveRtcAudioSession;
6464

65-
- (RTCRtpReceiver*)getRtpReceiverById:(RTCPeerConnection*)peerConnection Id:(NSString*)Id;
66-
- (RTCRtpSender*)getRtpSenderById:(RTCPeerConnection*)peerConnection Id:(NSString*)Id;
65+
- (RTCRtpReceiver* _Nullable)getRtpReceiverById:(RTCPeerConnection* _Nonnull)peerConnection Id:(NSString* _Nonnull)Id;
66+
- (RTCRtpSender* _Nullable)getRtpSenderById:(RTCPeerConnection* _Nonnull)peerConnection Id:(NSString* _Nonnull)Id;
6767

6868
@end

common/darwin/Classes/FlutterWebRTCPlugin.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,10 @@ @implementation VideoEncoderFactorySimulcast
7575
}
7676
@end
7777

78-
void postEvent(FlutterEventSink sink, id _Nullable event) {
79-
if (sink) {
78+
void postEvent(FlutterEventSink _Nonnull sink, id _Nullable event) {
8079
dispatch_async(dispatch_get_main_queue(), ^{
8180
sink(event);
8281
});
83-
}
8482
}
8583

8684
@implementation FlutterWebRTCPlugin {

0 commit comments

Comments
 (0)
0