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 @implementation RTCMediaStream { | 21 @implementation RTCMediaStream { |
22 NSMutableArray *_audioTracks; | 22 NSMutableArray *_audioTracks; |
23 NSMutableArray *_videoTracks; | 23 NSMutableArray *_videoTracks; |
24 rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream; | 24 rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream; |
25 } | 25 } |
26 | 26 |
27 - (NSArray<RTCAudioTrack *> *)audioTracks { | 27 - (NSArray/*<RTCAudioTrack *>*/ *)audioTracks { |
28 return [_audioTracks copy]; | 28 return [_audioTracks copy]; |
29 } | 29 } |
30 | 30 |
31 - (NSArray<RTCVideoTrack *> *)videoTracks { | 31 - (NSArray/*<RTCVideoTrack *>*/ *)videoTracks { |
32 return [_videoTracks copy]; | 32 return [_videoTracks copy]; |
33 } | 33 } |
34 | 34 |
35 - (NSString *)streamId { | 35 - (NSString *)streamId { |
36 return [NSString stringForStdString:_nativeMediaStream->label()]; | 36 return [NSString stringForStdString:_nativeMediaStream->label()]; |
37 } | 37 } |
38 | 38 |
39 - (void)addAudioTrack:(RTCAudioTrack *)audioTrack { | 39 - (void)addAudioTrack:(RTCAudioTrack *)audioTrack { |
40 if (_nativeMediaStream->AddTrack(audioTrack.nativeAudioTrack)) { | 40 if (_nativeMediaStream->AddTrack(audioTrack.nativeAudioTrack)) { |
41 [_audioTracks addObject:audioTrack]; | 41 [_audioTracks addObject:audioTrack]; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 RTCMediaStreamTrackType type = RTCMediaStreamTrackTypeVideo; | 103 RTCMediaStreamTrackType type = RTCMediaStreamTrackTypeVideo; |
104 RTCVideoTrack *videoTrack = | 104 RTCVideoTrack *videoTrack = |
105 [[RTCVideoTrack alloc] initWithNativeTrack:track type:type]; | 105 [[RTCVideoTrack alloc] initWithNativeTrack:track type:type]; |
106 [_videoTracks addObject:videoTrack]; | 106 [_videoTracks addObject:videoTrack]; |
107 } | 107 } |
108 } | 108 } |
109 return self; | 109 return self; |
110 } | 110 } |
111 | 111 |
112 @end | 112 @end |
OLD | NEW |