Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1019)

Unified Diff: webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm

Issue 2745193002: iOS: Add new RTCVideoSource interface (Closed)
Patch Set: Remove didStart/didStop callbacks. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm b/webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm
index 83a8b79ebe72339a6fc89b8cdf4a0188d81c8779..ec5591750c244b5a558c2e5f188454f7f4fdc4f4 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm
@@ -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,19 @@
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 {

Powered by Google App Engine
This is Rietveld 408576698