Allow suppression of padding check in RtpHeaderParser.
Bug: None Change-Id: I39574cade2c8c9df539f778fd97cb7a62827e169 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125521 Reviewed-by: Björn Terelius <terelius@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27039}
This commit is contained in:

committed by
Commit Bot

parent
44dd9f29c7
commit
62c7b39c71
@ -1310,7 +1310,7 @@ void ParsedRtcEventLog::StoreParsedLegacyEvent(const rtclog::Event& event) {
|
||||
RTPHeader parsed_header;
|
||||
|
||||
if (extension_map != nullptr) {
|
||||
rtp_parser.Parse(&parsed_header, extension_map);
|
||||
rtp_parser.Parse(&parsed_header, extension_map, true);
|
||||
} else {
|
||||
// Use the default extension map.
|
||||
// TODO(terelius): This should be removed. GetRtpHeader will return the
|
||||
@ -1318,7 +1318,7 @@ void ParsedRtcEventLog::StoreParsedLegacyEvent(const rtclog::Event& event) {
|
||||
// TODO(ivoc): Once configuration of audio streams is stored in the
|
||||
// event log, this can be removed.
|
||||
// Tracking bug: webrtc:6399
|
||||
rtp_parser.Parse(&parsed_header, &default_extension_map_);
|
||||
rtp_parser.Parse(&parsed_header, &default_extension_map_, true);
|
||||
}
|
||||
|
||||
// Since we give the parser only a header, there is no way for it to know
|
||||
|
@ -156,9 +156,9 @@ bool RtpHeaderParser::ParseRtcp(RTPHeader* header) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RtpHeaderParser::Parse(
|
||||
RTPHeader* header,
|
||||
const RtpHeaderExtensionMap* ptrExtensionMap) const {
|
||||
bool RtpHeaderParser::Parse(RTPHeader* header,
|
||||
const RtpHeaderExtensionMap* ptrExtensionMap,
|
||||
bool header_only) const {
|
||||
const ptrdiff_t length = _ptrRTPDataEnd - _ptrRTPDataBegin;
|
||||
if (length < kRtpMinParseLength) {
|
||||
return false;
|
||||
@ -202,7 +202,7 @@ bool RtpHeaderParser::Parse(
|
||||
header->timestamp = RTPTimestamp;
|
||||
header->ssrc = SSRC;
|
||||
header->numCSRCs = CC;
|
||||
if (!P) {
|
||||
if (!P || header_only) {
|
||||
header->paddingLength = 0;
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ bool RtpHeaderParser::Parse(
|
||||
if (header->headerLength > static_cast<size_t>(length))
|
||||
return false;
|
||||
|
||||
if (P) {
|
||||
if (P && !header_only) {
|
||||
// Packet has padding.
|
||||
if (header->headerLength != static_cast<size_t>(length)) {
|
||||
// Packet is not header only. We can parse padding length now.
|
||||
|
@ -37,7 +37,8 @@ class RtpHeaderParser {
|
||||
bool RTCP() const;
|
||||
bool ParseRtcp(RTPHeader* header) const;
|
||||
bool Parse(RTPHeader* parsedPacket,
|
||||
const RtpHeaderExtensionMap* ptrExtensionMap = nullptr) const;
|
||||
const RtpHeaderExtensionMap* ptrExtensionMap = nullptr,
|
||||
bool header_only = false) const;
|
||||
|
||||
private:
|
||||
void ParseOneByteExtensionHeader(RTPHeader* parsedPacket,
|
||||
|
Reference in New Issue
Block a user