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

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

Issue 1917193008: Adding getParameters/setParameters APIs to RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding nil check and removing unneeded methods. Created 4 years, 7 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 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 1237
1238 void WebRtcSession::SetRawAudioSink(uint32_t ssrc, 1238 void WebRtcSession::SetRawAudioSink(uint32_t ssrc,
1239 std::unique_ptr<AudioSinkInterface> sink) { 1239 std::unique_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, std::move(sink)); 1244 voice_channel_->SetRawAudioSink(ssrc, std::move(sink));
1245 } 1245 }
1246 1246
1247 RtpParameters WebRtcSession::GetAudioRtpParameters(uint32_t ssrc) const { 1247 RtpParameters WebRtcSession::GetAudioRtpSendParameters(uint32_t ssrc) const {
1248 ASSERT(signaling_thread()->IsCurrent()); 1248 ASSERT(signaling_thread()->IsCurrent());
1249 if (voice_channel_) { 1249 if (voice_channel_) {
1250 return voice_channel_->GetRtpParameters(ssrc); 1250 return voice_channel_->GetRtpSendParameters(ssrc);
1251 } 1251 }
1252 return RtpParameters(); 1252 return RtpParameters();
1253 } 1253 }
1254 1254
1255 bool WebRtcSession::SetAudioRtpParameters(uint32_t ssrc, 1255 bool WebRtcSession::SetAudioRtpSendParameters(uint32_t ssrc,
1256 const RtpParameters& parameters) { 1256 const RtpParameters& parameters) {
1257 ASSERT(signaling_thread()->IsCurrent()); 1257 ASSERT(signaling_thread()->IsCurrent());
1258 if (!voice_channel_) { 1258 if (!voice_channel_) {
1259 return false; 1259 return false;
1260 } 1260 }
1261 return voice_channel_->SetRtpParameters(ssrc, parameters); 1261 return voice_channel_->SetRtpSendParameters(ssrc, parameters);
1262 }
1263
1264 RtpParameters WebRtcSession::GetAudioRtpReceiveParameters(uint32_t ssrc) const {
1265 ASSERT(signaling_thread()->IsCurrent());
1266 if (voice_channel_) {
1267 return voice_channel_->GetRtpReceiveParameters(ssrc);
1268 }
1269 return RtpParameters();
1270 }
1271
1272 bool WebRtcSession::SetAudioRtpReceiveParameters(
1273 uint32_t ssrc,
1274 const RtpParameters& parameters) {
1275 ASSERT(signaling_thread()->IsCurrent());
1276 if (!voice_channel_) {
1277 return false;
1278 }
1279 return voice_channel_->SetRtpReceiveParameters(ssrc, parameters);
1262 } 1280 }
1263 1281
1264 bool WebRtcSession::SetSource( 1282 bool WebRtcSession::SetSource(
1265 uint32_t ssrc, 1283 uint32_t ssrc,
1266 rtc::VideoSourceInterface<cricket::VideoFrame>* source) { 1284 rtc::VideoSourceInterface<cricket::VideoFrame>* source) {
1267 ASSERT(signaling_thread()->IsCurrent()); 1285 ASSERT(signaling_thread()->IsCurrent());
1268 1286
1269 if (!video_channel_) { 1287 if (!video_channel_) {
1270 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't 1288 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't
1271 // support video. 1289 // support video.
(...skipping 30 matching lines...) Expand all
1302 return; 1320 return;
1303 } 1321 }
1304 if (!video_channel_->SetVideoSend(ssrc, enable, options)) { 1322 if (!video_channel_->SetVideoSend(ssrc, enable, options)) {
1305 // Allow that MuteStream fail if |enable| is false but assert otherwise. 1323 // Allow that MuteStream fail if |enable| is false but assert otherwise.
1306 // This in the normal case when the underlying media channel has already 1324 // This in the normal case when the underlying media channel has already
1307 // been deleted. 1325 // been deleted.
1308 ASSERT(enable == false); 1326 ASSERT(enable == false);
1309 } 1327 }
1310 } 1328 }
1311 1329
1312 RtpParameters WebRtcSession::GetVideoRtpParameters(uint32_t ssrc) const { 1330 RtpParameters WebRtcSession::GetVideoRtpSendParameters(uint32_t ssrc) const {
1313 ASSERT(signaling_thread()->IsCurrent()); 1331 ASSERT(signaling_thread()->IsCurrent());
1314 if (video_channel_) { 1332 if (video_channel_) {
1315 return video_channel_->GetRtpParameters(ssrc); 1333 return video_channel_->GetRtpSendParameters(ssrc);
1316 } 1334 }
1317 return RtpParameters(); 1335 return RtpParameters();
1318 } 1336 }
1319 1337
1320 bool WebRtcSession::SetVideoRtpParameters(uint32_t ssrc, 1338 bool WebRtcSession::SetVideoRtpSendParameters(uint32_t ssrc,
1321 const RtpParameters& parameters) { 1339 const RtpParameters& parameters) {
1322 ASSERT(signaling_thread()->IsCurrent()); 1340 ASSERT(signaling_thread()->IsCurrent());
1323 if (!video_channel_) { 1341 if (!video_channel_) {
1324 return false; 1342 return false;
1325 } 1343 }
1326 return video_channel_->SetRtpParameters(ssrc, parameters); 1344 return video_channel_->SetRtpSendParameters(ssrc, parameters);
1345 }
1346
1347 RtpParameters WebRtcSession::GetVideoRtpReceiveParameters(uint32_t ssrc) const {
1348 ASSERT(signaling_thread()->IsCurrent());
1349 if (video_channel_) {
1350 return video_channel_->GetRtpReceiveParameters(ssrc);
1351 }
1352 return RtpParameters();
1353 }
1354
1355 bool WebRtcSession::SetVideoRtpReceiveParameters(
1356 uint32_t ssrc,
1357 const RtpParameters& parameters) {
1358 ASSERT(signaling_thread()->IsCurrent());
1359 if (!video_channel_) {
1360 return false;
1361 }
1362 return video_channel_->SetRtpReceiveParameters(ssrc, parameters);
1327 } 1363 }
1328 1364
1329 bool WebRtcSession::CanInsertDtmf(const std::string& track_id) { 1365 bool WebRtcSession::CanInsertDtmf(const std::string& track_id) {
1330 ASSERT(signaling_thread()->IsCurrent()); 1366 ASSERT(signaling_thread()->IsCurrent());
1331 if (!voice_channel_) { 1367 if (!voice_channel_) {
1332 LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists."; 1368 LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists.";
1333 return false; 1369 return false;
1334 } 1370 }
1335 uint32_t send_ssrc = 0; 1371 uint32_t send_ssrc = 0;
1336 // The Dtmf is negotiated per channel not ssrc, so we only check if the ssrc 1372 // The Dtmf is negotiated per channel not ssrc, so we only check if the ssrc
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 } 2191 }
2156 } 2192 }
2157 2193
2158 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, 2194 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel,
2159 const rtc::SentPacket& sent_packet) { 2195 const rtc::SentPacket& sent_packet) {
2160 RTC_DCHECK(worker_thread()->IsCurrent()); 2196 RTC_DCHECK(worker_thread()->IsCurrent());
2161 media_controller_->call_w()->OnSentPacket(sent_packet); 2197 media_controller_->call_w()->OnSentPacket(sent_packet);
2162 } 2198 }
2163 2199
2164 } // namespace webrtc 2200 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698