Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ |
| 12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <memory> | 15 #include <memory> |
| 16 | 16 |
| 17 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.h" |
| 18 #include "webrtc/base/deprecation.h" | |
| 18 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" | 19 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" |
| 19 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 20 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| 20 | 21 |
| 21 namespace webrtc { | 22 namespace webrtc { |
| 22 | 23 |
| 23 // This strategy deals with the audio/video-specific aspects | 24 // This strategy deals with the audio/video-specific aspects |
| 24 // of payload handling. | 25 // of payload handling. |
| 25 class RTPPayloadStrategy { | 26 class RTPPayloadStrategy { |
| 26 public: | 27 public: |
| 27 virtual ~RTPPayloadStrategy() {} | 28 virtual ~RTPPayloadStrategy() {} |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 void set_last_received_payload_type(int8_t last_received_payload_type) { | 131 void set_last_received_payload_type(int8_t last_received_payload_type) { |
| 131 rtc::CritScope cs(&crit_sect_); | 132 rtc::CritScope cs(&crit_sect_); |
| 132 last_received_payload_type_ = last_received_payload_type; | 133 last_received_payload_type_ = last_received_payload_type; |
| 133 } | 134 } |
| 134 | 135 |
| 135 int8_t last_received_media_payload_type() const { | 136 int8_t last_received_media_payload_type() const { |
| 136 rtc::CritScope cs(&crit_sect_); | 137 rtc::CritScope cs(&crit_sect_); |
| 137 return last_received_media_payload_type_; | 138 return last_received_media_payload_type_; |
| 138 } | 139 } |
| 139 | 140 |
| 140 bool use_rtx_payload_mapping_on_restore() const { | 141 RTC_DEPRECATED void set_use_rtx_payload_mapping_on_restore(bool val) {} |
| 141 rtc::CritScope cs(&crit_sect_); | |
| 142 return use_rtx_payload_mapping_on_restore_; | |
| 143 } | |
| 144 | |
| 145 void set_use_rtx_payload_mapping_on_restore(bool val) { | |
| 146 rtc::CritScope cs(&crit_sect_); | |
| 147 use_rtx_payload_mapping_on_restore_ = val; | |
| 148 } | |
| 149 | 142 |
| 150 private: | 143 private: |
| 151 // Prunes the payload type map of the specific payload type, if it exists. | 144 // Prunes the payload type map of the specific payload type, if it exists. |
| 152 void DeregisterAudioCodecOrRedTypeRegardlessOfPayloadType( | 145 void DeregisterAudioCodecOrRedTypeRegardlessOfPayloadType( |
| 153 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 146 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
| 154 size_t payload_name_length, | 147 size_t payload_name_length, |
| 155 uint32_t frequency, | 148 uint32_t frequency, |
| 156 size_t channels, | 149 size_t channels, |
| 157 uint32_t rate); | 150 uint32_t rate); |
| 158 | 151 |
| 159 bool IsRtxInternal(const RTPHeader& header) const; | 152 bool IsRtxInternal(const RTPHeader& header) const; |
| 160 | 153 |
| 161 rtc::CriticalSection crit_sect_; | 154 rtc::CriticalSection crit_sect_; |
| 162 RtpUtility::PayloadTypeMap payload_type_map_; | 155 RtpUtility::PayloadTypeMap payload_type_map_; |
| 163 std::unique_ptr<RTPPayloadStrategy> rtp_payload_strategy_; | 156 std::unique_ptr<RTPPayloadStrategy> rtp_payload_strategy_; |
| 164 int8_t red_payload_type_; | 157 int8_t red_payload_type_; |
| 165 int8_t ulpfec_payload_type_; | 158 int8_t ulpfec_payload_type_; |
| 166 int8_t incoming_payload_type_; | 159 int8_t incoming_payload_type_; |
| 167 int8_t last_received_payload_type_; | 160 int8_t last_received_payload_type_; |
| 168 int8_t last_received_media_payload_type_; | 161 int8_t last_received_media_payload_type_; |
| 169 bool rtx_; | 162 bool rtx_; |
| 170 // TODO(changbin): Remove rtx_payload_type_ once interop with old clients that | |
| 171 // only understand one RTX PT is no longer needed. | |
| 172 int rtx_payload_type_; | |
| 173 // Mapping rtx_payload_type_map_[rtx] = associated. | 163 // Mapping rtx_payload_type_map_[rtx] = associated. |
| 174 std::map<int, int> rtx_payload_type_map_; | 164 std::map<int, int> rtx_payload_type_map_; |
| 175 // When true, use rtx_payload_type_map_ when restoring RTX packets to get the | |
|
danilchap
2016/11/02 13:56:52
When false, still use rtx_payload_type_map_.
Nice
| |
| 176 // correct payload type. | |
| 177 bool use_rtx_payload_mapping_on_restore_; | |
| 178 uint32_t ssrc_rtx_; | 165 uint32_t ssrc_rtx_; |
| 179 }; | 166 }; |
| 180 | 167 |
| 181 } // namespace webrtc | 168 } // namespace webrtc |
| 182 | 169 |
| 183 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ | 170 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ |
| OLD | NEW |