OLD | NEW |
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/RTCVideoTrack+Private.h" | 18 #import "webrtc/api/objc/RTCVideoTrack+Private.h" |
19 #import "webrtc/base/objc/NSString+StdString.h" | 19 #import "webrtc/base/objc/NSString+StdString.h" |
20 | 20 |
| 21 // TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 |
| 22 |
21 @implementation RTCMediaStream { | 23 @implementation RTCMediaStream { |
22 NSMutableArray *_audioTracks; | 24 NSMutableArray *_audioTracks; |
23 NSMutableArray *_videoTracks; | 25 NSMutableArray *_videoTracks; |
24 rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream; | 26 rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream; |
25 } | 27 } |
26 | 28 |
27 - (NSArray<RTCAudioTrack *> *)audioTracks { | 29 - (NSArray *)audioTracks { |
| 30 // - (NSArray<RTCAudioTrack *> *)audioTracks { |
28 return [_audioTracks copy]; | 31 return [_audioTracks copy]; |
29 } | 32 } |
30 | 33 |
31 - (NSArray<RTCVideoTrack *> *)videoTracks { | 34 - (NSArray *)videoTracks { |
| 35 // - (NSArray<RTCVideoTrack *> *)videoTracks { |
32 return [_videoTracks copy]; | 36 return [_videoTracks copy]; |
33 } | 37 } |
34 | 38 |
35 - (NSString *)streamId { | 39 - (NSString *)streamId { |
36 return [NSString stringForStdString:_nativeMediaStream->label()]; | 40 return [NSString stringForStdString:_nativeMediaStream->label()]; |
37 } | 41 } |
38 | 42 |
39 - (void)addAudioTrack:(RTCAudioTrack *)audioTrack { | 43 - (void)addAudioTrack:(RTCAudioTrack *)audioTrack { |
40 if (_nativeMediaStream->AddTrack(audioTrack.nativeAudioTrack)) { | 44 if (_nativeMediaStream->AddTrack(audioTrack.nativeAudioTrack)) { |
41 [_audioTracks addObject:audioTrack]; | 45 [_audioTracks addObject:audioTrack]; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 RTCMediaStreamTrackType type = RTCMediaStreamTrackTypeVideo; | 107 RTCMediaStreamTrackType type = RTCMediaStreamTrackTypeVideo; |
104 RTCVideoTrack *videoTrack = | 108 RTCVideoTrack *videoTrack = |
105 [[RTCVideoTrack alloc] initWithNativeTrack:track type:type]; | 109 [[RTCVideoTrack alloc] initWithNativeTrack:track type:type]; |
106 [_videoTracks addObject:videoTrack]; | 110 [_videoTracks addObject:videoTrack]; |
107 } | 111 } |
108 } | 112 } |
109 return self; | 113 return self; |
110 } | 114 } |
111 | 115 |
112 @end | 116 @end |
OLD | NEW |