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 "RTCPeerConnectionFactory+Private.h" | 11 #import "RTCPeerConnectionFactory+Private.h" |
12 | 12 |
13 #import "NSString+StdString.h" | 13 #import "NSString+StdString.h" |
14 #import "RTCAVFoundationVideoSource+Private.h" | 14 #import "RTCAVFoundationVideoSource+Private.h" |
15 #import "RTCAudioSource+Private.h" | 15 #import "RTCAudioSource+Private.h" |
16 #import "RTCAudioTrack+Private.h" | 16 #import "RTCAudioTrack+Private.h" |
17 #import "RTCMediaConstraints+Private.h" | 17 #import "RTCMediaConstraints+Private.h" |
18 #import "RTCMediaStream+Private.h" | 18 #import "RTCMediaStream+Private.h" |
19 #import "RTCPeerConnection+Private.h" | 19 #import "RTCPeerConnection+Private.h" |
20 #import "RTCVideoSource+Private.h" | 20 #import "RTCVideoSource+Private.h" |
21 #import "RTCVideoTrack+Private.h" | 21 #import "RTCVideoTrack+Private.h" |
22 #import "WebRTC/RTCLogging.h" | 22 #import "WebRTC/RTCLogging.h" |
23 | 23 |
24 #include "objcvideotracksource.h" | |
24 #include "videotoolboxvideocodecfactory.h" | 25 #include "videotoolboxvideocodecfactory.h" |
25 | 26 |
26 @implementation RTCPeerConnectionFactory { | 27 @implementation RTCPeerConnectionFactory { |
27 std::unique_ptr<rtc::Thread> _networkThread; | 28 std::unique_ptr<rtc::Thread> _networkThread; |
28 std::unique_ptr<rtc::Thread> _workerThread; | 29 std::unique_ptr<rtc::Thread> _workerThread; |
29 std::unique_ptr<rtc::Thread> _signalingThread; | 30 std::unique_ptr<rtc::Thread> _signalingThread; |
30 BOOL _hasStartedAecDump; | 31 BOOL _hasStartedAecDump; |
31 } | 32 } |
32 | 33 |
33 @synthesize nativeFactory = _nativeFactory; | 34 @synthesize nativeFactory = _nativeFactory; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 source:source | 81 source:source |
81 trackId:trackId]; | 82 trackId:trackId]; |
82 } | 83 } |
83 | 84 |
84 - (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints: | 85 - (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints: |
85 (nullable RTCMediaConstraints *)constraints { | 86 (nullable RTCMediaConstraints *)constraints { |
86 return [[RTCAVFoundationVideoSource alloc] initWithFactory:self | 87 return [[RTCAVFoundationVideoSource alloc] initWithFactory:self |
87 constraints:constraints]; | 88 constraints:constraints]; |
88 } | 89 } |
89 | 90 |
91 - (RTCVideoSource *)newVideoSource { | |
daniela-webrtc
2017/03/20 14:23:10
No need for the `new` prefix here. ARC will handle
magjed_webrtc
2017/03/27 12:35:11
Done.
| |
92 rtc::scoped_refptr<webrtc::ObjcVideoTrackSource> objc_video_track_source( | |
93 new rtc::RefCountedObject<webrtc::ObjcVideoTrackSource>()); | |
94 return [[RTCVideoSource alloc] | |
95 initWithNativeVideoSource:objc_video_track_source]; | |
96 } | |
97 | |
90 - (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source | 98 - (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source |
91 trackId:(NSString *)trackId { | 99 trackId:(NSString *)trackId { |
92 return [[RTCVideoTrack alloc] initWithFactory:self | 100 return [[RTCVideoTrack alloc] initWithFactory:self |
93 source:source | 101 source:source |
94 trackId:trackId]; | 102 trackId:trackId]; |
95 } | 103 } |
96 | 104 |
97 - (RTCMediaStream *)mediaStreamWithStreamId:(NSString *)streamId { | 105 - (RTCMediaStream *)mediaStreamWithStreamId:(NSString *)streamId { |
98 return [[RTCMediaStream alloc] initWithFactory:self | 106 return [[RTCMediaStream alloc] initWithFactory:self |
99 streamId:streamId]; | 107 streamId:streamId]; |
(...skipping 28 matching lines...) Expand all Loading... | |
128 _hasStartedAecDump = _nativeFactory->StartAecDump(fd, maxSizeInBytes); | 136 _hasStartedAecDump = _nativeFactory->StartAecDump(fd, maxSizeInBytes); |
129 return _hasStartedAecDump; | 137 return _hasStartedAecDump; |
130 } | 138 } |
131 | 139 |
132 - (void)stopAecDump { | 140 - (void)stopAecDump { |
133 _nativeFactory->StopAecDump(); | 141 _nativeFactory->StopAecDump(); |
134 _hasStartedAecDump = NO; | 142 _hasStartedAecDump = NO; |
135 } | 143 } |
136 | 144 |
137 @end | 145 @end |
OLD | NEW |