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
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "APPRTCConnectionManager.h"
|
||||
#import "RTCEAGLVideoView.h"
|
||||
#import "RTCVideoTrack.h"
|
||||
|
||||
// Padding space for local video view with its parent.
|
||||
static CGFloat const kLocalViewPadding = 20;
|
||||
@@ -47,6 +48,8 @@ static CGFloat const kLocalViewPadding = 20;
|
||||
|
||||
@implementation APPRTCViewController {
|
||||
APPRTCConnectionManager* _connectionManager;
|
||||
RTCVideoTrack* _localVideoTrack;
|
||||
RTCVideoTrack* _remoteVideoTrack;
|
||||
CGSize _localVideoSize;
|
||||
CGSize _remoteVideoSize;
|
||||
}
|
||||
@@ -101,13 +104,15 @@ static CGFloat const kLocalViewPadding = 20;
|
||||
|
||||
- (void)connectionManager:(APPRTCConnectionManager*)manager
|
||||
didReceiveLocalVideoTrack:(RTCVideoTrack*)localVideoTrack {
|
||||
_localVideoTrack = localVideoTrack;
|
||||
[_localVideoTrack addRenderer:self.localVideoView];
|
||||
self.localVideoView.hidden = NO;
|
||||
self.localVideoView.videoTrack = localVideoTrack;
|
||||
}
|
||||
|
||||
- (void)connectionManager:(APPRTCConnectionManager*)manager
|
||||
didReceiveRemoteVideoTrack:(RTCVideoTrack*)remoteVideoTrack {
|
||||
self.remoteVideoView.videoTrack = remoteVideoTrack;
|
||||
_remoteVideoTrack = remoteVideoTrack;
|
||||
[_remoteVideoTrack addRenderer:self.remoteVideoView];
|
||||
}
|
||||
|
||||
- (void)connectionManagerDidReceiveHangup:(APPRTCConnectionManager*)manager {
|
||||
@@ -193,8 +198,16 @@ static CGFloat const kLocalViewPadding = 20;
|
||||
self.instructionsView.hidden = NO;
|
||||
self.logView.hidden = YES;
|
||||
self.logView.text = nil;
|
||||
self.localVideoView.videoTrack = nil;
|
||||
self.remoteVideoView.videoTrack = nil;
|
||||
if (_localVideoTrack) {
|
||||
[_localVideoTrack removeRenderer:self.localVideoView];
|
||||
_localVideoTrack = nil;
|
||||
[self.localVideoView renderFrame:nil];
|
||||
}
|
||||
if (_remoteVideoTrack) {
|
||||
[_remoteVideoTrack removeRenderer:self.remoteVideoView];
|
||||
_remoteVideoTrack = nil;
|
||||
[self.remoteVideoView renderFrame:nil];
|
||||
}
|
||||
self.blackView.hidden = YES;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user