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

Unified Diff: webrtc/api/objc/RTCMediaStream.mm

Issue 1696673003: Tweaks for new Objective-C API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Don't use object subscripting Created 4 years, 10 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
« no previous file with comments | « webrtc/api/objc/RTCMediaStream.h ('k') | webrtc/api/objc/RTCMediaStreamTrack.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/objc/RTCMediaStream.mm
diff --git a/webrtc/api/objc/RTCMediaStream.mm b/webrtc/api/objc/RTCMediaStream.mm
index dcdef9d1a456438f6b1ab8ed503593361e6224f1..3c3e4d906455cedbc4e343d086df6903007f12a2 100644
--- a/webrtc/api/objc/RTCMediaStream.mm
+++ b/webrtc/api/objc/RTCMediaStream.mm
@@ -15,6 +15,7 @@
#import "webrtc/api/objc/RTCAudioTrack+Private.h"
#import "webrtc/api/objc/RTCMediaStream+Private.h"
#import "webrtc/api/objc/RTCMediaStreamTrack+Private.h"
+#import "webrtc/api/objc/RTCPeerConnectionFactory+Private.h"
#import "webrtc/api/objc/RTCVideoTrack+Private.h"
#import "webrtc/base/objc/NSString+StdString.h"
@@ -26,6 +27,16 @@
rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream;
}
+- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
+ streamId:(NSString *)streamId {
+ NSParameterAssert(factory);
+ NSParameterAssert(streamId.length);
+ std::string nativeId = [NSString stdStringForString:streamId];
+ rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
+ factory.nativeFactory->CreateLocalMediaStream(nativeId);
+ return [self initWithNativeMediaStream:stream];
+}
+
- (NSArray *)audioTracks {
// - (NSArray<RTCAudioTrack *> *)audioTracks {
return [_audioTracks copy];
« no previous file with comments | « webrtc/api/objc/RTCMediaStream.h ('k') | webrtc/api/objc/RTCMediaStreamTrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698