OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 rtc::scoped_refptr<webrtc::MediaStreamInterface> nativeMediaStream = | 118 rtc::scoped_refptr<webrtc::MediaStreamInterface> nativeMediaStream = |
119 self.nativeFactory->CreateLocalMediaStream([label UTF8String]); | 119 self.nativeFactory->CreateLocalMediaStream([label UTF8String]); |
120 return [[RTCMediaStream alloc] initWithMediaStream:nativeMediaStream]; | 120 return [[RTCMediaStream alloc] initWithMediaStream:nativeMediaStream]; |
121 } | 121 } |
122 | 122 |
123 - (RTCVideoSource*)videoSourceWithCapturer:(RTCVideoCapturer*)capturer | 123 - (RTCVideoSource*)videoSourceWithCapturer:(RTCVideoCapturer*)capturer |
124 constraints:(RTCMediaConstraints*)constraints { | 124 constraints:(RTCMediaConstraints*)constraints { |
125 if (!capturer) { | 125 if (!capturer) { |
126 return nil; | 126 return nil; |
127 } | 127 } |
128 rtc::scoped_refptr<webrtc::VideoSourceInterface> source = | 128 rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> source = |
129 self.nativeFactory->CreateVideoSource([capturer takeNativeCapturer], | 129 self.nativeFactory->CreateVideoSource([capturer takeNativeCapturer], const
raints.constraints); |
130 constraints.constraints); | |
131 return [[RTCVideoSource alloc] initWithMediaSource:source]; | 130 return [[RTCVideoSource alloc] initWithMediaSource:source]; |
132 } | 131 } |
133 | 132 |
134 - (RTCVideoTrack*)videoTrackWithID:(NSString*)videoId | 133 - (RTCVideoTrack*)videoTrackWithID:(NSString*)videoId |
135 source:(RTCVideoSource*)source { | 134 source:(RTCVideoSource*)source { |
136 rtc::scoped_refptr<webrtc::VideoTrackInterface> track = | 135 rtc::scoped_refptr<webrtc::VideoTrackInterface> track = |
137 self.nativeFactory->CreateVideoTrack([videoId UTF8String], | 136 self.nativeFactory->CreateVideoTrack([videoId UTF8String], |
138 source.videoSource); | 137 source.videoSource); |
139 return [[RTCVideoTrack alloc] initWithMediaTrack:track]; | 138 return [[RTCVideoTrack alloc] initWithMediaTrack:track]; |
140 } | 139 } |
141 | 140 |
142 - (RTCAudioTrack*)audioTrackWithID:(NSString*)audioId { | 141 - (RTCAudioTrack*)audioTrackWithID:(NSString*)audioId { |
143 rtc::scoped_refptr<webrtc::AudioTrackInterface> track = | 142 rtc::scoped_refptr<webrtc::AudioTrackInterface> track = |
144 self.nativeFactory->CreateAudioTrack([audioId UTF8String], NULL); | 143 self.nativeFactory->CreateAudioTrack([audioId UTF8String], NULL); |
145 return [[RTCAudioTrack alloc] initWithMediaTrack:track]; | 144 return [[RTCAudioTrack alloc] initWithMediaTrack:track]; |
146 } | 145 } |
147 | 146 |
148 @end | 147 @end |
OLD | NEW |