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}
This commit is contained in:
Stefan Holmer 2015-10-29 15:13:24 +01:00
parent ee1879ca40
commit 1295297153
8 changed files with 58 additions and 12 deletions

View File

@ -186,7 +186,6 @@ const uint32_t CallTest::kSendRtxSsrcs[kNumSsrcs] = {0xBADCAFD, 0xBADCAFE,
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) {
}

View File

@ -43,7 +43,6 @@ class CallTest : public ::testing::Test {
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);

20
webrtc/test/constants.cc Normal file
View File

@ -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

18
webrtc/test/constants.h Normal file
View File

@ -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

View File

@ -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 @@ class RtpRtcpObserver {
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_;

View File

@ -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',

View File

@ -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 @@ void VideoQualityTest::SetupFullStack(const Params& params,
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.

View File

@ -163,7 +163,6 @@ TEST_F(VideoSendStreamTest, SupportsAbsoluteSendTime) {
}
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 @@ TEST_F(VideoSendStreamTest, SupportsTransmissionTimeOffset) {
: SendTest(kDefaultTimeoutMs),
encoder_(Clock::GetRealTimeClock(), kEncodeDelayMs) {
EXPECT_TRUE(parser_->RegisterRtpHeaderExtension(
kRtpExtensionTransmissionTimeOffset, kTOffsetExtensionId));
kRtpExtensionTransmissionTimeOffset, test::kTOffsetExtensionId));
}
private:
@ -192,8 +191,9 @@ TEST_F(VideoSendStreamTest, SupportsTransmissionTimeOffset) {
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 @@ TEST_F(VideoSendStreamTest, SupportsTransportWideSequenceNumbers) {
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));
}