Cleanup RTCVideoRenderer interface.

RTCVideoRenderer should be a protocol not a class. This change includes
an adapter for use with the C++ apis. The video views have been refactored
to implement that protocol.

BUG=3795
R=glaznev@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/23279004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7626 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/examples/objc/AppRTCDemo/mac/APPRTCViewController.m b/talk/examples/objc/AppRTCDemo/mac/APPRTCViewController.m
index cf5b836..08acac9 100644
--- a/talk/examples/objc/AppRTCDemo/mac/APPRTCViewController.m
+++ b/talk/examples/objc/AppRTCDemo/mac/APPRTCViewController.m
@@ -30,6 +30,7 @@
 #import <AVFoundation/AVFoundation.h>
 #import "APPRTCConnectionManager.h"
 #import "RTCNSGLVideoView.h"
+#import "RTCVideoTrack.h"
 
 static NSUInteger const kContentWidth = 1280;
 static NSUInteger const kContentHeight = 720;
@@ -227,6 +228,8 @@
 
 @implementation APPRTCViewController {
   APPRTCConnectionManager* _connectionManager;
+  RTCVideoTrack* _localVideoTrack;
+  RTCVideoTrack* _remoteVideoTrack;
 }
 
 - (instancetype)initWithNibName:(NSString*)nibName
@@ -258,12 +261,13 @@
 
 - (void)connectionManager:(APPRTCConnectionManager*)manager
     didReceiveLocalVideoTrack:(RTCVideoTrack*)localVideoTrack {
-  self.mainView.localVideoView.videoTrack = localVideoTrack;
+  _localVideoTrack = localVideoTrack;
 }
 
 - (void)connectionManager:(APPRTCConnectionManager*)manager
     didReceiveRemoteVideoTrack:(RTCVideoTrack*)remoteVideoTrack {
-  self.mainView.remoteVideoView.videoTrack = remoteVideoTrack;
+  _remoteVideoTrack = remoteVideoTrack;
+  [_remoteVideoTrack addRenderer:self.mainView.remoteVideoView];
 }
 
 - (void)connectionManagerDidReceiveHangup:(APPRTCConnectionManager*)manager {
@@ -305,7 +309,9 @@
 }
 
 - (void)disconnect {
-  self.mainView.remoteVideoView.videoTrack = nil;
+  [_remoteVideoTrack removeRenderer:self.mainView.remoteVideoView];
+  _remoteVideoTrack = nil;
+  [self.mainView.remoteVideoView renderFrame:nil];
   [_connectionManager disconnect];
 }