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 |
11 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" |
12 | 12 |
13 #include <string.h> | 13 #include <string.h> |
14 | 14 |
15 #include <set> | 15 #include <set> |
16 | 16 |
17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
18 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
19 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
| 20 #include "webrtc/config.h" |
20 #include "webrtc/system_wrappers/include/trace.h" | 21 #include "webrtc/system_wrappers/include/trace.h" |
21 | 22 |
22 #ifdef _WIN32 | 23 #ifdef _WIN32 |
23 // Disable warning C4355: 'this' : used in base member initializer list. | 24 // Disable warning C4355: 'this' : used in base member initializer list. |
24 #pragma warning(disable : 4355) | 25 #pragma warning(disable : 4355) |
25 #endif | 26 #endif |
26 | 27 |
27 namespace webrtc { | 28 namespace webrtc { |
| 29 namespace { |
| 30 RTPExtensionType StringToRtpExtensionType(const std::string& extension) { |
| 31 if (extension == RtpExtension::kTOffset) |
| 32 return kRtpExtensionTransmissionTimeOffset; |
| 33 if (extension == RtpExtension::kAudioLevel) |
| 34 return kRtpExtensionAudioLevel; |
| 35 if (extension == RtpExtension::kAbsSendTime) |
| 36 return kRtpExtensionAbsoluteSendTime; |
| 37 if (extension == RtpExtension::kVideoRotation) |
| 38 return kRtpExtensionVideoRotation; |
| 39 if (extension == RtpExtension::kTransportSequenceNumber) |
| 40 return kRtpExtensionTransportSequenceNumber; |
| 41 RTC_NOTREACHED() << "Looking up unsupported RTP extension."; |
| 42 return kRtpExtensionNone; |
| 43 } |
| 44 } // namespace |
28 | 45 |
29 RtpRtcp::Configuration::Configuration() | 46 RtpRtcp::Configuration::Configuration() |
30 : audio(false), | 47 : audio(false), |
31 receiver_only(false), | 48 receiver_only(false), |
32 clock(nullptr), | 49 clock(nullptr), |
33 receive_statistics(NullObjectReceiveStatistics()), | 50 receive_statistics(NullObjectReceiveStatistics()), |
34 outgoing_transport(nullptr), | 51 outgoing_transport(nullptr), |
35 intra_frame_callback(nullptr), | 52 intra_frame_callback(nullptr), |
36 bandwidth_callback(nullptr), | 53 bandwidth_callback(nullptr), |
37 transport_feedback_callback(nullptr), | 54 transport_feedback_callback(nullptr), |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 const std::vector<uint32_t>& ssrcs) { | 669 const std::vector<uint32_t>& ssrcs) { |
653 rtcp_sender_.SetREMBData(bitrate, ssrcs); | 670 rtcp_sender_.SetREMBData(bitrate, ssrcs); |
654 } | 671 } |
655 | 672 |
656 int32_t ModuleRtpRtcpImpl::RegisterSendRtpHeaderExtension( | 673 int32_t ModuleRtpRtcpImpl::RegisterSendRtpHeaderExtension( |
657 const RTPExtensionType type, | 674 const RTPExtensionType type, |
658 const uint8_t id) { | 675 const uint8_t id) { |
659 return rtp_sender_.RegisterRtpHeaderExtension(type, id); | 676 return rtp_sender_.RegisterRtpHeaderExtension(type, id); |
660 } | 677 } |
661 | 678 |
| 679 bool ModuleRtpRtcpImpl::RegisterRtpHeaderExtension(const std::string& type, |
| 680 const uint8_t id) { |
| 681 return rtp_sender_.RegisterRtpHeaderExtension(StringToRtpExtensionType(type), |
| 682 id) == 0; |
| 683 } |
| 684 |
662 int32_t ModuleRtpRtcpImpl::DeregisterSendRtpHeaderExtension( | 685 int32_t ModuleRtpRtcpImpl::DeregisterSendRtpHeaderExtension( |
663 const RTPExtensionType type) { | 686 const RTPExtensionType type) { |
664 return rtp_sender_.DeregisterRtpHeaderExtension(type); | 687 return rtp_sender_.DeregisterRtpHeaderExtension(type); |
665 } | 688 } |
666 | 689 |
667 // (TMMBR) Temporary Max Media Bit Rate. | 690 // (TMMBR) Temporary Max Media Bit Rate. |
668 bool ModuleRtpRtcpImpl::TMMBR() const { | 691 bool ModuleRtpRtcpImpl::TMMBR() const { |
669 return rtcp_sender_.TMMBR(); | 692 return rtcp_sender_.TMMBR(); |
670 } | 693 } |
671 | 694 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 1000 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
978 StreamDataCountersCallback* callback) { | 1001 StreamDataCountersCallback* callback) { |
979 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 1002 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
980 } | 1003 } |
981 | 1004 |
982 StreamDataCountersCallback* | 1005 StreamDataCountersCallback* |
983 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 1006 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
984 return rtp_sender_.GetRtpStatisticsCallback(); | 1007 return rtp_sender_.GetRtpStatisticsCallback(); |
985 } | 1008 } |
986 } // namespace webrtc | 1009 } // namespace webrtc |
OLD | NEW |