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

Side by Side Diff: webrtc/api/webrtcsession.cc

Issue 1766653002: Replace SetCapturer and SetCaptureDevice by SetSource. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Make SetSource tolerate unknown ssrc and source == NULL. 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 1242
1243 void WebRtcSession::SetRawAudioSink(uint32_t ssrc, 1243 void WebRtcSession::SetRawAudioSink(uint32_t ssrc,
1244 rtc::scoped_ptr<AudioSinkInterface> sink) { 1244 rtc::scoped_ptr<AudioSinkInterface> sink) {
1245 ASSERT(signaling_thread()->IsCurrent()); 1245 ASSERT(signaling_thread()->IsCurrent());
1246 if (!voice_channel_) 1246 if (!voice_channel_)
1247 return; 1247 return;
1248 1248
1249 voice_channel_->SetRawAudioSink(ssrc, std::move(sink)); 1249 voice_channel_->SetRawAudioSink(ssrc, std::move(sink));
1250 } 1250 }
1251 1251
1252 bool WebRtcSession::SetCaptureDevice(uint32_t ssrc, 1252 bool WebRtcSession::SetSource(
1253 cricket::VideoCapturer* camera) { 1253 uint32_t ssrc,
1254 rtc::VideoSourceInterface<cricket::VideoFrame>* source) {
1254 ASSERT(signaling_thread()->IsCurrent()); 1255 ASSERT(signaling_thread()->IsCurrent());
1255 1256
1256 if (!video_channel_) { 1257 if (!video_channel_) {
1257 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't 1258 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't
1258 // support video. 1259 // support video.
1259 LOG(LS_WARNING) << "Video not used in this call."; 1260 LOG(LS_WARNING) << "Video not used in this call.";
1260 return false; 1261 return false;
1261 } 1262 }
1262 if (!video_channel_->SetCapturer(ssrc, camera)) { 1263 video_channel_->SetSource(ssrc, source);
1263 // Allow that SetCapturer fail if |camera| is NULL but assert otherwise.
1264 // This in the normal case when the underlying media channel has already
1265 // been deleted.
1266 ASSERT(camera == NULL);
1267 return false;
1268 }
1269 return true; 1264 return true;
1270 } 1265 }
1271 1266
1272 void WebRtcSession::SetVideoPlayout( 1267 void WebRtcSession::SetVideoPlayout(
1273 uint32_t ssrc, 1268 uint32_t ssrc,
1274 bool enable, 1269 bool enable,
1275 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) { 1270 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) {
1276 ASSERT(signaling_thread()->IsCurrent()); 1271 ASSERT(signaling_thread()->IsCurrent());
1277 if (!video_channel_) { 1272 if (!video_channel_) {
1278 LOG(LS_WARNING) << "SetVideoPlayout: No video channel exists."; 1273 LOG(LS_WARNING) << "SetVideoPlayout: No video channel exists.";
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 } 2108 }
2114 } 2109 }
2115 2110
2116 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, 2111 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel,
2117 const rtc::SentPacket& sent_packet) { 2112 const rtc::SentPacket& sent_packet) {
2118 RTC_DCHECK(worker_thread()->IsCurrent()); 2113 RTC_DCHECK(worker_thread()->IsCurrent());
2119 media_controller_->call_w()->OnSentPacket(sent_packet); 2114 media_controller_->call_w()->OnSentPacket(sent_packet);
2120 } 2115 }
2121 2116
2122 } // namespace webrtc 2117 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698