iOS: Add new RTCVideoSource interface

The new RTCVideoSource interface can be used by custom implementations of RTCVideoCapturer.

BUG=webrtc:7177
TBR=tommi

Review-Url: https://codereview.webrtc.org/2745193002
Cr-Commit-Position: refs/heads/master@{#17409}
This commit is contained in:
magjed
2017-03-28 01:56:41 -07:00
committed by Commit bot
parent c4adacfb15
commit abb84b8128
12 changed files with 226 additions and 3 deletions

View File

@ -11,7 +11,11 @@
#import "RTCVideoSource+Private.h"
#include "webrtc/base/checks.h"
#include "webrtc/sdk/objc/Framework/Classes/objcvideotracksource.h"
// TODO(magjed): Refactor this class and target ObjcVideoTrackSource only once
// RTCAVFoundationVideoSource is gone. See http://crbug/webrtc/7177 for more
// info.
@implementation RTCVideoSource {
rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> _nativeVideoSource;
}
@ -38,6 +42,15 @@
return [NSString stringWithFormat:@"RTCVideoSource( %p ): %@", self, stateString];
}
- (void)capturer:(RTCVideoCapturer *)capturer didCaptureVideoFrame:(RTCVideoFrame *)frame {
static_cast<webrtc::ObjcVideoTrackSource *>(_nativeVideoSource.get())->OnCapturedFrame(frame);
}
- (void)adaptOutputFormatToWidth:(int)width height:(int)height fps:(int)fps {
static_cast<webrtc::ObjcVideoTrackSource *>(_nativeVideoSource.get())
->OnOutputFormatRequest(width, height, fps);
}
#pragma mark - Private
- (rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>)nativeVideoSource {