Register header extensions in RtpRtcpObserver to avoid log spam.
BUG=webrtc:5118
R=pbos@webrtc.org
Review URL: https://codereview.webrtc.org/1416783006 .
Cr-Commit-Position: refs/heads/master@{#10450}
diff --git a/webrtc/test/call_test.cc b/webrtc/test/call_test.cc
index 7d73f15..0a8b686 100644
--- a/webrtc/test/call_test.cc
+++ b/webrtc/test/call_test.cc
@@ -186,7 +186,6 @@
const uint32_t CallTest::kSendSsrcs[kNumSsrcs] = {0xC0FFED, 0xC0FFEE, 0xC0FFEF};
const uint32_t CallTest::kReceiverLocalSsrc = 0x123456;
const int CallTest::kNackRtpHistoryMs = 1000;
-const int CallTest::kAbsSendTimeExtensionId = 7;
BaseTest::BaseTest(unsigned int timeout_ms) : RtpRtcpObserver(timeout_ms) {
}
diff --git a/webrtc/test/call_test.h b/webrtc/test/call_test.h
index 1074324..cf024d9 100644
--- a/webrtc/test/call_test.h
+++ b/webrtc/test/call_test.h
@@ -43,7 +43,6 @@
static const uint32_t kSendSsrcs[kNumSsrcs];
static const uint32_t kReceiverLocalSsrc;
static const int kNackRtpHistoryMs;
- static const int kAbsSendTimeExtensionId;
protected:
void RunBaseTest(BaseTest* test, const FakeNetworkPipe::Config& config);
diff --git a/webrtc/test/constants.cc b/webrtc/test/constants.cc
new file mode 100644
index 0000000..7e94fe5
--- /dev/null
+++ b/webrtc/test/constants.cc
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/test/constants.h"
+
+namespace webrtc {
+namespace test {
+
+const int kTOffsetExtensionId = 6;
+const int kAbsSendTimeExtensionId = 7;
+const int kTransportSequenceNumberExtensionId = 8;
+} // namespace test
+} // namespace webrtc
diff --git a/webrtc/test/constants.h b/webrtc/test/constants.h
new file mode 100644
index 0000000..14b2ba6
--- /dev/null
+++ b/webrtc/test/constants.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+namespace webrtc {
+namespace test {
+
+extern const int kTOffsetExtensionId;
+extern const int kAbsSendTimeExtensionId;
+extern const int kTransportSequenceNumberExtensionId;
+} // namespace test
+} // namespace webrtc
diff --git a/webrtc/test/rtp_rtcp_observer.h b/webrtc/test/rtp_rtcp_observer.h
index 50fd864..89b6dd0 100644
--- a/webrtc/test/rtp_rtcp_observer.h
+++ b/webrtc/test/rtp_rtcp_observer.h
@@ -17,6 +17,7 @@
#include "webrtc/base/criticalsection.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h"
+#include "webrtc/test/constants.h"
#include "webrtc/test/direct_transport.h"
#include "webrtc/typedefs.h"
#include "webrtc/video_send_stream.h"
@@ -60,7 +61,14 @@
explicit RtpRtcpObserver(unsigned int event_timeout_ms)
: observation_complete_(EventWrapper::Create()),
parser_(RtpHeaderParser::Create()),
- timeout_ms_(event_timeout_ms) {}
+ timeout_ms_(event_timeout_ms) {
+ parser_->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset,
+ kTOffsetExtensionId);
+ parser_->RegisterRtpHeaderExtension(kRtpExtensionAbsoluteSendTime,
+ kAbsSendTimeExtensionId);
+ parser_->RegisterRtpHeaderExtension(kRtpExtensionTransportSequenceNumber,
+ kTransportSequenceNumberExtensionId);
+ }
const rtc::scoped_ptr<EventWrapper> observation_complete_;
const rtc::scoped_ptr<RtpHeaderParser> parser_;
diff --git a/webrtc/test/webrtc_test_common.gyp b/webrtc/test/webrtc_test_common.gyp
index 42fa1e7..d075cb4 100644
--- a/webrtc/test/webrtc_test_common.gyp
+++ b/webrtc/test/webrtc_test_common.gyp
@@ -18,6 +18,8 @@
'call_test.h',
'configurable_frame_size_encoder.cc',
'configurable_frame_size_encoder.h',
+ 'constants.cc',
+ 'constants.h',
'direct_transport.cc',
'direct_transport.h',
'encoder_settings.cc',
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index 3e4bbdb..0f45fa6 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -32,8 +32,6 @@
namespace webrtc {
-static const int kTransportSeqExtensionId =
- VideoQualityTest::kAbsSendTimeExtensionId + 1;
static const int kSendStatsPollingIntervalMs = 1000;
static const int kPayloadTypeVP8 = 123;
static const int kPayloadTypeVP9 = 124;
@@ -628,11 +626,12 @@
send_config_.rtp.extensions.clear();
if (params.common.send_side_bwe) {
- send_config_.rtp.extensions.push_back(RtpExtension(
- RtpExtension::kTransportSequenceNumber, kTransportSeqExtensionId));
- } else {
send_config_.rtp.extensions.push_back(
- RtpExtension(RtpExtension::kAbsSendTime, kAbsSendTimeExtensionId));
+ RtpExtension(RtpExtension::kTransportSequenceNumber,
+ test::kTransportSequenceNumberExtensionId));
+ } else {
+ send_config_.rtp.extensions.push_back(RtpExtension(
+ RtpExtension::kAbsSendTime, test::kAbsSendTimeExtensionId));
}
// Automatically fill out streams[0] with params.
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index d2e4d65..59011a6 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -163,7 +163,6 @@
}
TEST_F(VideoSendStreamTest, SupportsTransmissionTimeOffset) {
- static const uint8_t kTOffsetExtensionId = 13;
static const int kEncodeDelayMs = 5;
class TransmissionTimeOffsetObserver : public test::SendTest {
public:
@@ -171,7 +170,7 @@
: SendTest(kDefaultTimeoutMs),
encoder_(Clock::GetRealTimeClock(), kEncodeDelayMs) {
EXPECT_TRUE(parser_->RegisterRtpHeaderExtension(
- kRtpExtensionTransmissionTimeOffset, kTOffsetExtensionId));
+ kRtpExtensionTransmissionTimeOffset, test::kTOffsetExtensionId));
}
private:
@@ -192,8 +191,9 @@
std::vector<VideoReceiveStream::Config>* receive_configs,
VideoEncoderConfig* encoder_config) override {
send_config->encoder_settings.encoder = &encoder_;
+ send_config->rtp.extensions.clear();
send_config->rtp.extensions.push_back(
- RtpExtension(RtpExtension::kTOffset, kTOffsetExtensionId));
+ RtpExtension(RtpExtension::kTOffset, test::kTOffsetExtensionId));
}
void PerformTest() override {
@@ -235,6 +235,7 @@
std::vector<VideoReceiveStream::Config>* receive_configs,
VideoEncoderConfig* encoder_config) override {
send_config->encoder_settings.encoder = &encoder_;
+ send_config->rtp.extensions.clear();
send_config->rtp.extensions.push_back(
RtpExtension(RtpExtension::kTransportSequenceNumber, kExtensionId));
}