Ensure one does not register same rtp header extension with different id
Added assert to RtpHeaderExtensionMap Altered tests that did. BUG=webrtc:1994 Review-Url: https://codereview.webrtc.org/2462663002 Cr-Commit-Position: refs/heads/master@{#14840}
This commit is contained in:
parent
051f678808
commit
42ca68ab72
@ -10,12 +10,15 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
constexpr uint8_t RtpHeaderExtensionMap::kInvalidId;
|
||||
|
||||
RtpHeaderExtensionMap::RtpHeaderExtensionMap() {
|
||||
}
|
||||
|
||||
@ -48,6 +51,7 @@ int32_t RtpHeaderExtensionMap::Register(RTPExtensionType type, uint8_t id) {
|
||||
// so return success.
|
||||
return 0;
|
||||
}
|
||||
RTC_DCHECK_EQ(kInvalidId, GetId(type));
|
||||
extensionMap_[id] = new HeaderExtension(type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ TEST_F(VideoSendStreamTest, SupportsTransmissionTimeOffset) {
|
||||
}
|
||||
|
||||
TEST_F(VideoSendStreamTest, SupportsTransportWideSequenceNumbers) {
|
||||
static const uint8_t kExtensionId = 13;
|
||||
static const uint8_t kExtensionId = test::kTransportSequenceNumberExtensionId;
|
||||
class TransportWideSequenceNumberObserver : public test::SendTest {
|
||||
public:
|
||||
TransportWideSequenceNumberObserver()
|
||||
@ -1215,7 +1215,7 @@ TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) {
|
||||
TEST_F(VideoSendStreamTest, ChangingNetworkRoute) {
|
||||
static const int kStartBitrateBps = 300000;
|
||||
static const int kNewMaxBitrateBps = 1234567;
|
||||
static const uint8_t kExtensionId = 13;
|
||||
static const uint8_t kExtensionId = test::kTransportSequenceNumberExtensionId;
|
||||
class ChangingNetworkRouteTest : public test::EndToEndTest {
|
||||
public:
|
||||
ChangingNetworkRouteTest()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user