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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/objc/RTCMediaStream.h ('k') | webrtc/api/objc/RTCMediaStreamTrack.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #import "RTCMediaStream.h" 11 #import "RTCMediaStream.h"
12 12
13 #include <vector> 13 #include <vector>
14 14
15 #import "webrtc/api/objc/RTCAudioTrack+Private.h" 15 #import "webrtc/api/objc/RTCAudioTrack+Private.h"
16 #import "webrtc/api/objc/RTCMediaStream+Private.h" 16 #import "webrtc/api/objc/RTCMediaStream+Private.h"
17 #import "webrtc/api/objc/RTCMediaStreamTrack+Private.h" 17 #import "webrtc/api/objc/RTCMediaStreamTrack+Private.h"
18 #import "webrtc/api/objc/RTCPeerConnectionFactory+Private.h"
18 #import "webrtc/api/objc/RTCVideoTrack+Private.h" 19 #import "webrtc/api/objc/RTCVideoTrack+Private.h"
19 #import "webrtc/base/objc/NSString+StdString.h" 20 #import "webrtc/base/objc/NSString+StdString.h"
20 21
21 // TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 22 // TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
22 23
23 @implementation RTCMediaStream { 24 @implementation RTCMediaStream {
24 NSMutableArray *_audioTracks; 25 NSMutableArray *_audioTracks;
25 NSMutableArray *_videoTracks; 26 NSMutableArray *_videoTracks;
26 rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream; 27 rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream;
27 } 28 }
28 29
30 - (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
31 streamId:(NSString *)streamId {
32 NSParameterAssert(factory);
33 NSParameterAssert(streamId.length);
34 std::string nativeId = [NSString stdStringForString:streamId];
35 rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
36 factory.nativeFactory->CreateLocalMediaStream(nativeId);
37 return [self initWithNativeMediaStream:stream];
38 }
39
29 - (NSArray *)audioTracks { 40 - (NSArray *)audioTracks {
30 // - (NSArray<RTCAudioTrack *> *)audioTracks { 41 // - (NSArray<RTCAudioTrack *> *)audioTracks {
31 return [_audioTracks copy]; 42 return [_audioTracks copy];
32 } 43 }
33 44
34 - (NSArray *)videoTracks { 45 - (NSArray *)videoTracks {
35 // - (NSArray<RTCVideoTrack *> *)videoTracks { 46 // - (NSArray<RTCVideoTrack *> *)videoTracks {
36 return [_videoTracks copy]; 47 return [_videoTracks copy];
37 } 48 }
38 49
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 RTCMediaStreamTrackType type = RTCMediaStreamTrackTypeVideo; 118 RTCMediaStreamTrackType type = RTCMediaStreamTrackTypeVideo;
108 RTCVideoTrack *videoTrack = 119 RTCVideoTrack *videoTrack =
109 [[RTCVideoTrack alloc] initWithNativeTrack:track type:type]; 120 [[RTCVideoTrack alloc] initWithNativeTrack:track type:type];
110 [_videoTracks addObject:videoTrack]; 121 [_videoTracks addObject:videoTrack];
111 } 122 }
112 } 123 }
113 return self; 124 return self;
114 } 125 }
115 126
116 @end 127 @end
OLDNEW
« 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