Internally RtpHeaderExtensionMap held uri of the extension as
`const char*`. Each extension and its uri was known at compile time.
Later at runtime during then for each packet in `Call::DeliverRtp`
method these `uri` was compared against extension uri carried in RTP
packet. Such comparison lead to repeated computation of string length
for strings known at compile time.
This patch changes `const char*` type to `absl::string_view` type to
cache length of string at compile time.
Bug: https://cam.sprc.samsung.pl/browse/VDGAME-249
Change-Id: I68dc4a41fab8ab07c2719b19f0e760d9940a620f
}
private:
- bool Register(int id, RTPExtensionType type, const char* uri);
+ bool Register(int id, RTPExtensionType type, absl::string_view uri);
uint8_t ids_[kRtpExtensionNumberOfExtensions];
bool extmap_allow_mixed_;
struct ExtensionInfo {
RTPExtensionType type;
- const char* uri;
+ absl::string_view uri;
};
template <typename Extension>
bool RtpHeaderExtensionMap::Register(int id,
RTPExtensionType type,
- const char* uri) {
+ absl::string_view uri) {
RTC_DCHECK_GT(type, kRtpExtensionNone);
RTC_DCHECK_LT(type, kRtpExtensionNumberOfExtensions);