Delete class StringRtpHeaderExtension, replaced with std::string
Bug: webrtc:10440 Change-Id: I52f865496f9838ac0981a6cd13f24b5b681b6616 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128609 Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27265}
This commit is contained in:
@ -24,47 +24,24 @@ namespace {
|
||||
constexpr size_t kMidRsidMaxSize = 16;
|
||||
|
||||
// Check if passed character is a "token-char" from RFC 4566.
|
||||
static bool IsTokenChar(char ch) {
|
||||
bool IsTokenChar(char ch) {
|
||||
return ch == 0x21 || (ch >= 0x23 && ch <= 0x27) || ch == 0x2a || ch == 0x2b ||
|
||||
ch == 0x2d || ch == 0x2e || (ch >= 0x30 && ch <= 0x39) ||
|
||||
(ch >= 0x41 && ch <= 0x5a) || (ch >= 0x5e && ch <= 0x7e);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
StreamDataCounters::StreamDataCounters() : first_packet_time_ms(-1) {}
|
||||
|
||||
constexpr size_t StreamId::kMaxSize;
|
||||
|
||||
bool IsLegalMidName(absl::string_view name) {
|
||||
return (name.size() <= kMidRsidMaxSize && name.size() > 0 &&
|
||||
std::all_of(name.data(), name.data() + name.size(), IsTokenChar));
|
||||
}
|
||||
|
||||
bool StreamId::IsLegalMidName(rtc::ArrayView<const char> name) {
|
||||
return ::webrtc::IsLegalMidName(absl::string_view(name.data(), name.size()));
|
||||
}
|
||||
|
||||
bool IsLegalRsidName(absl::string_view name) {
|
||||
return (name.size() <= kMidRsidMaxSize && name.size() > 0 &&
|
||||
std::all_of(name.data(), name.data() + name.size(), isalnum));
|
||||
}
|
||||
|
||||
bool StreamId::IsLegalRsidName(rtc::ArrayView<const char> name) {
|
||||
return ::webrtc::IsLegalRsidName(absl::string_view(name.data(), name.size()));
|
||||
}
|
||||
|
||||
void StreamId::Set(const char* data, size_t size) {
|
||||
// If |data| contains \0, the stream id size might become less than |size|.
|
||||
RTC_CHECK_LE(size, kMaxSize);
|
||||
memcpy(value_, data, size);
|
||||
if (size < kMaxSize)
|
||||
value_[size] = 0;
|
||||
}
|
||||
|
||||
// StreamId is used as member of RTPHeader that is sometimes copied with memcpy
|
||||
// and thus assume trivial destructibility.
|
||||
static_assert(std::is_trivially_destructible<StreamId>::value, "");
|
||||
StreamDataCounters::StreamDataCounters() : first_packet_time_ms(-1) {}
|
||||
|
||||
PacketFeedback::PacketFeedback(int64_t arrival_time_ms,
|
||||
uint16_t sequence_number)
|
||||
|
||||
Reference in New Issue
Block a user