ObjC: RTCVideoSource cleanup

RTCVideoSource was recently added in
https://codereview.webrtc.org/2745193002/. This CL addresses some post
commit feedback.

BUG=webrtc:7177

Review-Url: https://codereview.webrtc.org/2812533003
Cr-Commit-Position: refs/heads/master@{#17649}
This commit is contained in:
magjed
2017-04-11 04:50:15 -07:00
committed by Commit bot
parent 29dbb1992a
commit 24da37b0bf
6 changed files with 19 additions and 18 deletions

View File

@ -89,9 +89,9 @@
}
- (RTCVideoSource *)videoSource {
rtc::scoped_refptr<webrtc::ObjcVideoTrackSource> objc_video_track_source(
rtc::scoped_refptr<webrtc::ObjcVideoTrackSource> objcVideoTrackSource(
new rtc::RefCountedObject<webrtc::ObjcVideoTrackSource>());
return [[RTCVideoSource alloc] initWithNativeVideoSource:objc_video_track_source];
return [[RTCVideoSource alloc] initWithNativeVideoSource:objcVideoTrackSource];
}
- (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source

View File

@ -10,19 +10,16 @@
#import "WebRTC/RTCVideoCapturer.h"
@implementation RTCVideoCapturer {
__weak id<RTCVideoCapturerDelegate> _delegate;
}
@implementation RTCVideoCapturer
@synthesize delegate = _delegate;
- (instancetype)initWithDelegate:(id<RTCVideoCapturerDelegate>)delegate {
NSAssert(delegate != nil, @"delegate cannot be nil");
if (self = [super init]) {
_delegate = delegate;
}
return self;
}
- (id<RTCVideoCapturerDelegate>)delegate {
return _delegate;
}
@end

View File

@ -11,11 +11,12 @@
#ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_OBJCVIDEOTRACKSOURCE_H_
#define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_OBJCVIDEOTRACKSOURCE_H_
#import <WebRTC/RTCVideoFrame.h>
#include "WebRTC/RTCMacros.h"
#include "webrtc/base/timestampaligner.h"
#include "webrtc/media/base/adaptedvideotracksource.h"
RTC_FWD_DECL_OBJC_CLASS(RTCVideoFrame);
namespace webrtc {
class ObjcVideoTrackSource : public rtc::AdaptedVideoTrackSource {