Index: webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
index 13f488b09a8a2416968e072854540746df600146..ba512ef349c85ef3191d55af7c25ea0caea53f15 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
@@ -257,6 +257,13 @@ bool RtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, StreamId* rsid) { |
return true; |
} |
+bool RtpStreamId::Write(uint8_t* data, const StreamId& rsid) { |
+ RTC_DCHECK_GE(rsid.size(), 1); |
+ RTC_DCHECK_LE(rsid.size(), StreamId::kMaxSize); |
+ memcpy(data, rsid.data(), rsid.size()); |
+ return true; |
+} |
+ |
bool RtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, std::string* rsid) { |
if (data.empty() || data[0] == 0) // Valid rsid can't be empty. |
return false; |
@@ -268,6 +275,13 @@ bool RtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, std::string* rsid) { |
return true; |
} |
+bool RtpStreamId::Write(uint8_t* data, const std::string& rsid) { |
+ RTC_DCHECK_GE(rsid.size(), 1); |
+ RTC_DCHECK_LE(rsid.size(), StreamId::kMaxSize); |
+ memcpy(data, rsid.data(), rsid.size()); |
+ return true; |
+} |
+ |
// RepairedRtpStreamId. |
constexpr RTPExtensionType RepairedRtpStreamId::kId; |
constexpr uint8_t RepairedRtpStreamId::kValueSizeBytes; |
@@ -279,9 +293,25 @@ bool RepairedRtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, |
return RtpStreamId::Parse(data, rsid); |
} |
+size_t RepairedRtpStreamId::ValueSize(const StreamId& rsid) { |
+ return RtpStreamId::ValueSize(rsid); |
+} |
+ |
+bool RepairedRtpStreamId::Write(uint8_t* data, const StreamId& rsid) { |
+ return RtpStreamId::Write(data, rsid); |
+} |
+ |
bool RepairedRtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, |
std::string* rsid) { |
return RtpStreamId::Parse(data, rsid); |
} |
+size_t RepairedRtpStreamId::ValueSize(const std::string& rsid) { |
+ return RtpStreamId::ValueSize(rsid); |
+} |
+ |
+bool RepairedRtpStreamId::Write(uint8_t* data, const std::string& rsid) { |
+ return RtpStreamId::Write(data, rsid); |
+} |
+ |
} // namespace webrtc |