Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2759)

Side by Side Diff: webrtc/video/video_send_stream_tests.cc

Issue 1416783006: Register header extensions in RtpRtcpObserver to avoid log spam. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/video_quality_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #include <algorithm> // max 10 #include <algorithm> // max
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 void PerformTest() override { 156 void PerformTest() override {
157 EXPECT_EQ(kEventSignaled, Wait()) 157 EXPECT_EQ(kEventSignaled, Wait())
158 << "Timed out while waiting for single RTP packet."; 158 << "Timed out while waiting for single RTP packet.";
159 } 159 }
160 } test; 160 } test;
161 161
162 RunBaseTest(&test, FakeNetworkPipe::Config()); 162 RunBaseTest(&test, FakeNetworkPipe::Config());
163 } 163 }
164 164
165 TEST_F(VideoSendStreamTest, SupportsTransmissionTimeOffset) { 165 TEST_F(VideoSendStreamTest, SupportsTransmissionTimeOffset) {
166 static const uint8_t kTOffsetExtensionId = 13;
167 static const int kEncodeDelayMs = 5; 166 static const int kEncodeDelayMs = 5;
168 class TransmissionTimeOffsetObserver : public test::SendTest { 167 class TransmissionTimeOffsetObserver : public test::SendTest {
169 public: 168 public:
170 TransmissionTimeOffsetObserver() 169 TransmissionTimeOffsetObserver()
171 : SendTest(kDefaultTimeoutMs), 170 : SendTest(kDefaultTimeoutMs),
172 encoder_(Clock::GetRealTimeClock(), kEncodeDelayMs) { 171 encoder_(Clock::GetRealTimeClock(), kEncodeDelayMs) {
173 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( 172 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension(
174 kRtpExtensionTransmissionTimeOffset, kTOffsetExtensionId)); 173 kRtpExtensionTransmissionTimeOffset, test::kTOffsetExtensionId));
175 } 174 }
176 175
177 private: 176 private:
178 Action OnSendRtp(const uint8_t* packet, size_t length) override { 177 Action OnSendRtp(const uint8_t* packet, size_t length) override {
179 RTPHeader header; 178 RTPHeader header;
180 EXPECT_TRUE(parser_->Parse(packet, length, &header)); 179 EXPECT_TRUE(parser_->Parse(packet, length, &header));
181 180
182 EXPECT_TRUE(header.extension.hasTransmissionTimeOffset); 181 EXPECT_TRUE(header.extension.hasTransmissionTimeOffset);
183 EXPECT_FALSE(header.extension.hasAbsoluteSendTime); 182 EXPECT_FALSE(header.extension.hasAbsoluteSendTime);
184 EXPECT_GT(header.extension.transmissionTimeOffset, 0); 183 EXPECT_GT(header.extension.transmissionTimeOffset, 0);
185 EXPECT_EQ(header.extension.absoluteSendTime, 0u); 184 EXPECT_EQ(header.extension.absoluteSendTime, 0u);
186 observation_complete_->Set(); 185 observation_complete_->Set();
187 186
188 return SEND_PACKET; 187 return SEND_PACKET;
189 } 188 }
190 189
191 void ModifyConfigs(VideoSendStream::Config* send_config, 190 void ModifyConfigs(VideoSendStream::Config* send_config,
192 std::vector<VideoReceiveStream::Config>* receive_configs, 191 std::vector<VideoReceiveStream::Config>* receive_configs,
193 VideoEncoderConfig* encoder_config) override { 192 VideoEncoderConfig* encoder_config) override {
194 send_config->encoder_settings.encoder = &encoder_; 193 send_config->encoder_settings.encoder = &encoder_;
194 send_config->rtp.extensions.clear();
195 send_config->rtp.extensions.push_back( 195 send_config->rtp.extensions.push_back(
196 RtpExtension(RtpExtension::kTOffset, kTOffsetExtensionId)); 196 RtpExtension(RtpExtension::kTOffset, test::kTOffsetExtensionId));
197 } 197 }
198 198
199 void PerformTest() override { 199 void PerformTest() override {
200 EXPECT_EQ(kEventSignaled, Wait()) 200 EXPECT_EQ(kEventSignaled, Wait())
201 << "Timed out while waiting for a single RTP packet."; 201 << "Timed out while waiting for a single RTP packet.";
202 } 202 }
203 203
204 test::DelayedEncoder encoder_; 204 test::DelayedEncoder encoder_;
205 } test; 205 } test;
206 206
(...skipping 21 matching lines...) Expand all
228 228
229 observation_complete_->Set(); 229 observation_complete_->Set();
230 230
231 return SEND_PACKET; 231 return SEND_PACKET;
232 } 232 }
233 233
234 void ModifyConfigs(VideoSendStream::Config* send_config, 234 void ModifyConfigs(VideoSendStream::Config* send_config,
235 std::vector<VideoReceiveStream::Config>* receive_configs, 235 std::vector<VideoReceiveStream::Config>* receive_configs,
236 VideoEncoderConfig* encoder_config) override { 236 VideoEncoderConfig* encoder_config) override {
237 send_config->encoder_settings.encoder = &encoder_; 237 send_config->encoder_settings.encoder = &encoder_;
238 send_config->rtp.extensions.clear();
238 send_config->rtp.extensions.push_back( 239 send_config->rtp.extensions.push_back(
239 RtpExtension(RtpExtension::kTransportSequenceNumber, kExtensionId)); 240 RtpExtension(RtpExtension::kTransportSequenceNumber, kExtensionId));
240 } 241 }
241 242
242 void PerformTest() override { 243 void PerformTest() override {
243 EXPECT_EQ(kEventSignaled, Wait()) 244 EXPECT_EQ(kEventSignaled, Wait())
244 << "Timed out while waiting for a single RTP packet."; 245 << "Timed out while waiting for a single RTP packet.";
245 } 246 }
246 247
247 test::FakeEncoder encoder_; 248 test::FakeEncoder encoder_;
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 EXPECT_TRUE(vp9videoHeader->flexible_mode); 1881 EXPECT_TRUE(vp9videoHeader->flexible_mode);
1881 observation_complete_->Set(); 1882 observation_complete_->Set();
1882 } 1883 }
1883 1884
1884 } test; 1885 } test;
1885 1886
1886 RunBaseTest(&test, FakeNetworkPipe::Config()); 1887 RunBaseTest(&test, FakeNetworkPipe::Config());
1887 } 1888 }
1888 1889
1889 } // namespace webrtc 1890 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_quality_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698