| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 } | 371 } |
| 372 | 372 |
| 373 int ViEChannel::GetRequiredNackListSize(int target_delay_ms) { | 373 int ViEChannel::GetRequiredNackListSize(int target_delay_ms) { |
| 374 // The max size of the nack list should be large enough to accommodate the | 374 // The max size of the nack list should be large enough to accommodate the |
| 375 // the number of packets (frames) resulting from the increased delay. | 375 // the number of packets (frames) resulting from the increased delay. |
| 376 // Roughly estimating for ~40 packets per frame @ 30fps. | 376 // Roughly estimating for ~40 packets per frame @ 30fps. |
| 377 return target_delay_ms * 40 * 30 / 1000; | 377 return target_delay_ms * 40 * 30 / 1000; |
| 378 } | 378 } |
| 379 | 379 |
| 380 int ViEChannel::SetSendTimestampOffsetStatus(bool enable, int id) { | 380 int ViEChannel::SetSendTimestampOffsetStatus(int id) { |
| 381 // Disable any previous registrations of this extension to avoid errors. | |
| 382 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | |
| 383 rtp_rtcp->DeregisterSendRtpHeaderExtension( | |
| 384 kRtpExtensionTransmissionTimeOffset); | |
| 385 } | |
| 386 if (!enable) | |
| 387 return 0; | |
| 388 // Enable the extension. | 381 // Enable the extension. |
| 389 int error = 0; | 382 int error = 0; |
| 390 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 383 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 391 error |= rtp_rtcp->RegisterSendRtpHeaderExtension( | 384 error |= rtp_rtcp->RegisterSendRtpHeaderExtension( |
| 392 kRtpExtensionTransmissionTimeOffset, id); | 385 kRtpExtensionTransmissionTimeOffset, id); |
| 393 } | 386 } |
| 394 return error; | 387 return error; |
| 395 } | 388 } |
| 396 | 389 |
| 397 int ViEChannel::SetSendAbsoluteSendTimeStatus(bool enable, int id) { | 390 int ViEChannel::SetSendAbsoluteSendTimeStatus(int id) { |
| 398 // Disable any previous registrations of this extension to avoid errors. | |
| 399 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | |
| 400 rtp_rtcp->DeregisterSendRtpHeaderExtension(kRtpExtensionAbsoluteSendTime); | |
| 401 if (!enable) | |
| 402 return 0; | |
| 403 // Enable the extension. | 391 // Enable the extension. |
| 404 int error = 0; | 392 int error = 0; |
| 405 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 393 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 406 error |= rtp_rtcp->RegisterSendRtpHeaderExtension( | 394 error |= rtp_rtcp->RegisterSendRtpHeaderExtension( |
| 407 kRtpExtensionAbsoluteSendTime, id); | 395 kRtpExtensionAbsoluteSendTime, id); |
| 408 } | 396 } |
| 409 return error; | 397 return error; |
| 410 } | 398 } |
| 411 | 399 |
| 412 int ViEChannel::SetSendVideoRotationStatus(bool enable, int id) { | 400 int ViEChannel::SetSendVideoRotationStatus(int id) { |
| 413 // Disable any previous registrations of this extension to avoid errors. | |
| 414 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | |
| 415 rtp_rtcp->DeregisterSendRtpHeaderExtension(kRtpExtensionVideoRotation); | |
| 416 if (!enable) | |
| 417 return 0; | |
| 418 // Enable the extension. | 401 // Enable the extension. |
| 419 int error = 0; | 402 int error = 0; |
| 420 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 403 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 421 error |= rtp_rtcp->RegisterSendRtpHeaderExtension( | 404 error |= rtp_rtcp->RegisterSendRtpHeaderExtension( |
| 422 kRtpExtensionVideoRotation, id); | 405 kRtpExtensionVideoRotation, id); |
| 423 } | 406 } |
| 424 return error; | 407 return error; |
| 425 } | 408 } |
| 426 | 409 |
| 427 int ViEChannel::SetSendTransportSequenceNumber(bool enable, int id) { | 410 int ViEChannel::SetSendTransportSequenceNumber(int id) { |
| 428 RTC_DCHECK(sender_); | 411 RTC_DCHECK(sender_); |
| 429 // Disable any previous registrations of this extension to avoid errors. | |
| 430 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | |
| 431 rtp_rtcp->DeregisterSendRtpHeaderExtension( | |
| 432 kRtpExtensionTransportSequenceNumber); | |
| 433 } | |
| 434 if (!enable) | |
| 435 return 0; | |
| 436 // Enable the extension. | 412 // Enable the extension. |
| 437 int error = 0; | 413 int error = 0; |
| 438 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 414 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 439 error |= rtp_rtcp->RegisterSendRtpHeaderExtension( | 415 error |= rtp_rtcp->RegisterSendRtpHeaderExtension( |
| 440 kRtpExtensionTransportSequenceNumber, id); | 416 kRtpExtensionTransportSequenceNumber, id); |
| 441 } | 417 } |
| 442 return error; | 418 return error; |
| 443 } | 419 } |
| 444 | 420 |
| 445 RtpState ViEChannel::GetRtpStateForSsrc(uint32_t ssrc) const { | 421 RtpState ViEChannel::GetRtpStateForSsrc(uint32_t ssrc) const { |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 rtc::CritScope lock(&crit_); | 705 rtc::CritScope lock(&crit_); |
| 730 receive_stats_callback_ = receive_statistics_proxy; | 706 receive_stats_callback_ = receive_statistics_proxy; |
| 731 } | 707 } |
| 732 | 708 |
| 733 void ViEChannel::SetIncomingVideoStream( | 709 void ViEChannel::SetIncomingVideoStream( |
| 734 IncomingVideoStream* incoming_video_stream) { | 710 IncomingVideoStream* incoming_video_stream) { |
| 735 rtc::CritScope lock(&crit_); | 711 rtc::CritScope lock(&crit_); |
| 736 incoming_video_stream_ = incoming_video_stream; | 712 incoming_video_stream_ = incoming_video_stream; |
| 737 } | 713 } |
| 738 } // namespace webrtc | 714 } // namespace webrtc |
| OLD | NEW |