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

Unified Diff: webrtc/examples/objc/AppRTCDemo/ARDAppClient.m

Issue 1820193002: Refactor some ObjC API init methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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
« no previous file with comments | « webrtc/api/objc/RTCVideoTrack+Private.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
diff --git a/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m b/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
index 32d237a36af4bae8c5768ec2a47e8d4d5432fd4d..d8dc7714248af61d4ff560d557682749a180433d 100644
--- a/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
+++ b/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
@@ -502,10 +502,9 @@ static BOOL const kARDAppClientEnableTracing = NO;
RTCMediaConstraints *constraints = [self defaultPeerConnectionConstraints];
RTCConfiguration *config = [[RTCConfiguration alloc] init];
config.iceServers = _iceServers;
- _peerConnection = [[RTCPeerConnection alloc] initWithFactory:_factory
- configuration:config
- constraints:constraints
- delegate:self];
+ _peerConnection = [_factory peerConnectionWithConfiguration:config
+ constraints:constraints
+ delegate:self];
// Create AV media stream and add it to the peer connection.
RTCMediaStream *localStream = [self createLocalMediaStream];
[_peerConnection addStream:localStream];
@@ -608,16 +607,14 @@ static BOOL const kARDAppClientEnableTracing = NO;
}
- (RTCMediaStream *)createLocalMediaStream {
- RTCMediaStream *localStream =
- [[RTCMediaStream alloc] initWithFactory:_factory streamId:@"ARDAMS"];
+ RTCMediaStream *localStream = [_factory mediaStreamWithStreamId:@"ARDAMS"];
RTCVideoTrack *localVideoTrack = [self createLocalVideoTrack];
if (localVideoTrack) {
[localStream addVideoTrack:localVideoTrack];
[_delegate appClient:self didReceiveLocalVideoTrack:localVideoTrack];
}
RTCAudioTrack *localAudioTrack =
- [[RTCAudioTrack alloc] initWithFactory:_factory
- trackId:@"ARDAMSa0"];
+ [_factory audioTrackWithTrackId:@"ARDAMSa0"];
[localStream addAudioTrack:localAudioTrack];
return localStream;
}
@@ -634,12 +631,10 @@ static BOOL const kARDAppClientEnableTracing = NO;
RTCMediaConstraints *mediaConstraints =
[self defaultMediaStreamConstraints];
RTCAVFoundationVideoSource *source =
- [[RTCAVFoundationVideoSource alloc] initWithFactory:_factory
- constraints:mediaConstraints];
+ [_factory avFoundationVideoSourceWithConstraints:mediaConstraints];
localVideoTrack =
- [[RTCVideoTrack alloc] initWithFactory:_factory
- source:source
- trackId:@"ARDAMSv0"];
+ [_factory videoTrackWithSource:source
+ trackId:@"ARDAMSv0"];
}
#endif
return localVideoTrack;
« no previous file with comments | « webrtc/api/objc/RTCVideoTrack+Private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698