Removes verbose extension warning in Scenario tests.
Bug: webrtc:9510 Change-Id: I017119a899c68d27fe4b4376afb4070ff89b4f43 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125540 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26991}
This commit is contained in:
parent
110c64bcd6
commit
1e42761b39
@ -24,6 +24,7 @@ class RtpHeaderParser {
|
||||
|
||||
// Returns true if the packet is an RTCP packet, false otherwise.
|
||||
static bool IsRtcp(const uint8_t* packet, size_t length);
|
||||
static absl::optional<uint32_t> GetSsrc(const uint8_t* packet, size_t length);
|
||||
|
||||
// Parses the packet and stores the parsed packet in |header|. Returns true on
|
||||
// success, false otherwise.
|
||||
|
||||
@ -50,6 +50,16 @@ bool RtpHeaderParser::IsRtcp(const uint8_t* packet, size_t length) {
|
||||
return rtp_parser.RTCP();
|
||||
}
|
||||
|
||||
absl::optional<uint32_t> RtpHeaderParser::GetSsrc(const uint8_t* packet,
|
||||
size_t length) {
|
||||
RtpUtility::RtpHeaderParser rtp_parser(packet, length);
|
||||
RTPHeader header;
|
||||
if (rtp_parser.Parse(&header, nullptr)) {
|
||||
return header.ssrc;
|
||||
}
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
bool RtpHeaderParserImpl::Parse(const uint8_t* packet,
|
||||
size_t length,
|
||||
RTPHeader* header) const {
|
||||
|
||||
@ -181,14 +181,9 @@ void CallClient::OnPacketReceived(EmulatedIpPacket packet) {
|
||||
|
||||
MediaType media_type = MediaType::ANY;
|
||||
if (!RtpHeaderParser::IsRtcp(packet.cdata(), packet.data.size())) {
|
||||
RTPHeader header;
|
||||
bool success =
|
||||
header_parser_->Parse(packet.cdata(), packet.data.size(), &header);
|
||||
if (!success) {
|
||||
RTC_DLOG(LS_ERROR) << "Failed to parse RTP header of packet";
|
||||
return;
|
||||
}
|
||||
media_type = ssrc_media_types_[header.ssrc];
|
||||
auto ssrc = RtpHeaderParser::GetSsrc(packet.cdata(), packet.data.size());
|
||||
RTC_CHECK(ssrc.has_value());
|
||||
media_type = ssrc_media_types_[*ssrc];
|
||||
}
|
||||
call_->Receiver()->DeliverPacket(media_type, packet.data,
|
||||
packet.arrival_time.us());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user