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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_header_extension.h

Issue 2867713003: Remove hardcoded kValueSizeBytes values from variable-length header extensions. (Closed)
Patch Set: Patch 3 Created 3 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_header_extension.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_header_extension.h b/webrtc/modules/rtp_rtcp/source/rtp_header_extension.h
index 1b5a7ab3e628d862738dc640a5969c7b05a15506..f3aef0c2a5922acb7caaea6e864615bd31d93ecc 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_header_extension.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_header_extension.h
@@ -21,6 +21,11 @@
namespace webrtc {
+struct RtpExtensionSize {
+ RTPExtensionType type;
+ uint8_t value_size;
+};
+
class RtpHeaderExtensionMap {
public:
static constexpr RTPExtensionType kInvalidType = kRtpExtensionNone;
@@ -31,8 +36,7 @@ class RtpHeaderExtensionMap {
template <typename Extension>
bool Register(uint8_t id) {
- return Register(id, Extension::kId, Extension::kValueSizeBytes,
- Extension::kUri);
+ return Register(id, Extension::kId, Extension::kUri);
}
bool RegisterByType(uint8_t id, RTPExtensionType type);
bool RegisterByUri(uint8_t id, const std::string& uri);
@@ -53,7 +57,8 @@ class RtpHeaderExtensionMap {
return ids_[type];
}
- size_t GetTotalLengthInBytes() const;
+ size_t GetTotalLengthInBytes(
+ rtc::ArrayView<const RtpExtensionSize> extensions) const;
// TODO(danilchap): Remove use of the functions below.
int32_t Register(RTPExtensionType type, uint8_t id) {
@@ -64,12 +69,8 @@ class RtpHeaderExtensionMap {
private:
static constexpr uint8_t kMinId = 1;
static constexpr uint8_t kMaxId = 14;
- bool Register(uint8_t id,
- RTPExtensionType type,
- size_t value_size,
- const char* uri);
+ bool Register(uint8_t id, RTPExtensionType type, const char* uri);
- size_t total_values_size_bytes_ = 0;
RTPExtensionType types_[kMaxId + 1];
uint8_t ids_[kRtpExtensionNumberOfExtensions];
};
@@ -77,4 +78,3 @@ class RtpHeaderExtensionMap {
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_
-

Powered by Google App Engine
This is Rietveld 408576698