OLD | NEW |
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 1226 matching lines...) Loading... |
1237 | 1237 |
1238 void WebRtcSession::SetRawAudioSink(uint32_t ssrc, | 1238 void WebRtcSession::SetRawAudioSink(uint32_t ssrc, |
1239 rtc::scoped_ptr<AudioSinkInterface> sink) { | 1239 rtc::scoped_ptr<AudioSinkInterface> sink) { |
1240 ASSERT(signaling_thread()->IsCurrent()); | 1240 ASSERT(signaling_thread()->IsCurrent()); |
1241 if (!voice_channel_) | 1241 if (!voice_channel_) |
1242 return; | 1242 return; |
1243 | 1243 |
1244 voice_channel_->SetRawAudioSink(ssrc, rtc::ScopedToUnique(std::move(sink))); | 1244 voice_channel_->SetRawAudioSink(ssrc, rtc::ScopedToUnique(std::move(sink))); |
1245 } | 1245 } |
1246 | 1246 |
| 1247 RtpParameters WebRtcSession::GetAudioRtpParameters(uint32_t ssrc) const { |
| 1248 ASSERT(signaling_thread()->IsCurrent()); |
| 1249 if (voice_channel_) { |
| 1250 return voice_channel_->GetRtpParameters(ssrc); |
| 1251 } |
| 1252 return RtpParameters(); |
| 1253 } |
| 1254 |
| 1255 bool WebRtcSession::SetAudioRtpParameters(uint32_t ssrc, |
| 1256 const RtpParameters& parameters) { |
| 1257 ASSERT(signaling_thread()->IsCurrent()); |
| 1258 if (!voice_channel_) { |
| 1259 return false; |
| 1260 } |
| 1261 return voice_channel_->SetRtpParameters(ssrc, parameters); |
| 1262 } |
| 1263 |
1247 bool WebRtcSession::SetCaptureDevice(uint32_t ssrc, | 1264 bool WebRtcSession::SetCaptureDevice(uint32_t ssrc, |
1248 cricket::VideoCapturer* camera) { | 1265 cricket::VideoCapturer* camera) { |
1249 ASSERT(signaling_thread()->IsCurrent()); | 1266 ASSERT(signaling_thread()->IsCurrent()); |
1250 | 1267 |
1251 if (!video_channel_) { | 1268 if (!video_channel_) { |
1252 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't | 1269 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't |
1253 // support video. | 1270 // support video. |
1254 LOG(LS_WARNING) << "Video not used in this call."; | 1271 LOG(LS_WARNING) << "Video not used in this call."; |
1255 return false; | 1272 return false; |
1256 } | 1273 } |
(...skipping 33 matching lines...) Loading... |
1290 return; | 1307 return; |
1291 } | 1308 } |
1292 if (!video_channel_->SetVideoSend(ssrc, enable, options)) { | 1309 if (!video_channel_->SetVideoSend(ssrc, enable, options)) { |
1293 // Allow that MuteStream fail if |enable| is false but assert otherwise. | 1310 // Allow that MuteStream fail if |enable| is false but assert otherwise. |
1294 // This in the normal case when the underlying media channel has already | 1311 // This in the normal case when the underlying media channel has already |
1295 // been deleted. | 1312 // been deleted. |
1296 ASSERT(enable == false); | 1313 ASSERT(enable == false); |
1297 } | 1314 } |
1298 } | 1315 } |
1299 | 1316 |
| 1317 RtpParameters WebRtcSession::GetVideoRtpParameters(uint32_t ssrc) const { |
| 1318 ASSERT(signaling_thread()->IsCurrent()); |
| 1319 if (video_channel_) { |
| 1320 return video_channel_->GetRtpParameters(ssrc); |
| 1321 } |
| 1322 return RtpParameters(); |
| 1323 } |
| 1324 |
| 1325 bool WebRtcSession::SetVideoRtpParameters(uint32_t ssrc, |
| 1326 const RtpParameters& parameters) { |
| 1327 ASSERT(signaling_thread()->IsCurrent()); |
| 1328 if (!video_channel_) { |
| 1329 return false; |
| 1330 } |
| 1331 return video_channel_->SetRtpParameters(ssrc, parameters); |
| 1332 } |
| 1333 |
1300 bool WebRtcSession::CanInsertDtmf(const std::string& track_id) { | 1334 bool WebRtcSession::CanInsertDtmf(const std::string& track_id) { |
1301 ASSERT(signaling_thread()->IsCurrent()); | 1335 ASSERT(signaling_thread()->IsCurrent()); |
1302 if (!voice_channel_) { | 1336 if (!voice_channel_) { |
1303 LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists."; | 1337 LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists."; |
1304 return false; | 1338 return false; |
1305 } | 1339 } |
1306 uint32_t send_ssrc = 0; | 1340 uint32_t send_ssrc = 0; |
1307 // The Dtmf is negotiated per channel not ssrc, so we only check if the ssrc | 1341 // The Dtmf is negotiated per channel not ssrc, so we only check if the ssrc |
1308 // exists. | 1342 // exists. |
1309 if (!local_desc_ || | 1343 if (!local_desc_ || |
(...skipping 816 matching lines...) Loading... |
2126 } | 2160 } |
2127 } | 2161 } |
2128 | 2162 |
2129 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2163 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
2130 const rtc::SentPacket& sent_packet) { | 2164 const rtc::SentPacket& sent_packet) { |
2131 RTC_DCHECK(worker_thread()->IsCurrent()); | 2165 RTC_DCHECK(worker_thread()->IsCurrent()); |
2132 media_controller_->call_w()->OnSentPacket(sent_packet); | 2166 media_controller_->call_w()->OnSentPacket(sent_packet); |
2133 } | 2167 } |
2134 | 2168 |
2135 } // namespace webrtc | 2169 } // namespace webrtc |
OLD | NEW |