diff options
author | fischman@webrtc.org <fischman@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-03-25 05:16:29 +0000 |
---|---|---|
committer | fischman@webrtc.org <fischman@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-03-25 05:16:29 +0000 |
commit | 312f57cda5c81c10898a55881ac76256f317c970 (patch) | |
tree | fd698b0a7e0fa9d915c206e2a1528a4afbf4a0c3 /examples | |
parent | 9750eddb6cf86a3958f5fedb4c6ada2d95069919 (diff) | |
download | talk-312f57cda5c81c10898a55881ac76256f317c970.tar.gz |
PeerConnection(iOS): make ARC-clean talk/.../objc* and talk/examples/ios
- Removes a strong-reference cycle between RTCPeerConnection and
RTCPeerConnectionObserver
- Gives RTCPeerConnectionObserver a virtual dtor
- Ensures RTCPeerConnectionTest tears down correctly
- Ensures AppRTCDemo tears down correctly
This is the talk/ half; the webrtc/ half is in https://webrtc-codereview.appspot.com/10539005
BUG=3054,3055,3100
R=noahric@google.com
Review URL: https://webrtc-codereview.appspot.com/10499005
git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@5771 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'examples')
-rw-r--r-- | examples/ios/AppRTCDemo/APPRTCAppDelegate.h | 5 | ||||
-rw-r--r-- | examples/ios/AppRTCDemo/APPRTCAppDelegate.m | 9 | ||||
-rw-r--r-- | examples/ios/AppRTCDemo/APPRTCViewController.m | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/examples/ios/AppRTCDemo/APPRTCAppDelegate.h b/examples/ios/AppRTCDemo/APPRTCAppDelegate.h index 517cade..3e6d600 100644 --- a/examples/ios/AppRTCDemo/APPRTCAppDelegate.h +++ b/examples/ios/AppRTCDemo/APPRTCAppDelegate.h @@ -30,7 +30,7 @@ #import "GAEChannelClient.h" #import "APPRTCAppClient.h" #import "RTCSessionDescriptonDelegate.h" - +#import "RTCVideoSource.h" // Used to send a message to an apprtc.appspot.com "room". @protocol APPRTCSendMessage<NSObject> @@ -43,7 +43,7 @@ @class RTCVideoTrack; // The main application class of the AppRTCDemo iOS app demonstrating -// interoperability between the Objcective C implementation of PeerConnection +// interoperability between the Objective C implementation of PeerConnection // and the apprtc.appspot.com demo webapp. @interface APPRTCAppDelegate : UIResponder<ICEServerDelegate, GAEMessageHandler, @@ -53,6 +53,7 @@ @property(strong, nonatomic) UIWindow* window; @property(strong, nonatomic) APPRTCViewController* viewController; +@property (strong, nonatomic) RTCVideoSource* videoSource; - (void)closeVideoUI; diff --git a/examples/ios/AppRTCDemo/APPRTCAppDelegate.m b/examples/ios/AppRTCDemo/APPRTCAppDelegate.m index ee36604..8610477 100644 --- a/examples/ios/AppRTCDemo/APPRTCAppDelegate.m +++ b/examples/ios/AppRTCDemo/APPRTCAppDelegate.m @@ -246,12 +246,12 @@ RTCVideoCapturer* capturer = [RTCVideoCapturer capturerWithDeviceName:cameraID]; - RTCVideoSource* videoSource = [self.peerConnectionFactory + self.videoSource = [self.peerConnectionFactory videoSourceWithCapturer:capturer constraints:self.client.videoConstraints]; RTCVideoTrack* localVideoTrack = [self.peerConnectionFactory videoTrackWithID:@"ARDAMSv0" - source:videoSource]; + source:self.videoSource]; if (localVideoTrack) { [lms addVideoTrack:localVideoTrack]; } @@ -485,9 +485,10 @@ sendData:[@"{\"type\": \"bye\"}" dataUsingEncoding:NSUTF8StringEncoding]]; [self.peerConnection close]; self.peerConnection = nil; - self.peerConnectionFactory = nil; self.pcObserver = nil; self.client = nil; + self.videoSource = nil; + self.peerConnectionFactory = nil; [RTCPeerConnectionFactory deinitializeSSL]; } @@ -523,8 +524,8 @@ #pragma mark - public methods - (void)closeVideoUI { - [self disconnect]; [self.viewController resetUI]; + [self disconnect]; } @end diff --git a/examples/ios/AppRTCDemo/APPRTCViewController.m b/examples/ios/AppRTCDemo/APPRTCViewController.m index 8c5ccde..3cebb72 100644 --- a/examples/ios/AppRTCDemo/APPRTCViewController.m +++ b/examples/ios/AppRTCDemo/APPRTCViewController.m @@ -77,7 +77,7 @@ [_remoteVideoView removeFromSuperview]; self.remoteVideoView = nil; - [_remoteVideoView renderVideoTrackInterface:nil]; + [_localVideoView renderVideoTrackInterface:nil]; [_localVideoView removeFromSuperview]; self.localVideoView = nil; } |