Adds setup of RTP Extensions in Scenario tests.

This prevents printing warning messages when the extensions aren't
found. The real parsing is done deeper in the stack and is unaffected.

Bug: webrtc:9510
Change-Id: Idf09f0e69c223bd4217be7044d21d1d0bbbdab92
Reviewed-on: https://webrtc-review.googlesource.com/c/110615
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25612}
This commit is contained in:
Sebastian Jansson
2018-11-12 16:44:16 +01:00
committed by Commit Bot
parent cb7eddb955
commit fd20171d28
6 changed files with 27 additions and 0 deletions

View File

@ -28,8 +28,10 @@ class RtpHeaderParserImpl : public RtpHeaderParser {
RTPHeader* header) const override;
bool RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id) override;
bool RegisterRtpHeaderExtension(RtpExtension extension) override;
bool DeregisterRtpHeaderExtension(RTPExtensionType type) override;
bool DeregisterRtpHeaderExtension(RtpExtension extension) override;
private:
rtc::CriticalSection critical_section_;
@ -66,6 +68,10 @@ bool RtpHeaderParserImpl::Parse(const uint8_t* packet,
}
return true;
}
bool RtpHeaderParserImpl::RegisterRtpHeaderExtension(RtpExtension extension) {
rtc::CritScope cs(&critical_section_);
return rtp_header_extension_map_.RegisterByUri(extension.id, extension.uri);
}
bool RtpHeaderParserImpl::RegisterRtpHeaderExtension(RTPExtensionType type,
uint8_t id) {
@ -73,6 +79,12 @@ bool RtpHeaderParserImpl::RegisterRtpHeaderExtension(RTPExtensionType type,
return rtp_header_extension_map_.RegisterByType(id, type);
}
bool RtpHeaderParserImpl::DeregisterRtpHeaderExtension(RtpExtension extension) {
rtc::CritScope cs(&critical_section_);
return rtp_header_extension_map_.Deregister(
rtp_header_extension_map_.GetType(extension.id));
}
bool RtpHeaderParserImpl::DeregisterRtpHeaderExtension(RTPExtensionType type) {
rtc::CritScope cs(&critical_section_);
return rtp_header_extension_map_.Deregister(type) == 0;