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

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

Issue 2812913002: Reland of Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: Fix indent Created 3 years, 8 months 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') | webrtc/video/video_stream_decoder.h » ('j') | 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 285
286 void PerformTest() override { 286 void PerformTest() override {
287 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet."; 287 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet.";
288 } 288 }
289 } test; 289 } test;
290 290
291 RunBaseTest(&test); 291 RunBaseTest(&test);
292 } 292 }
293 293
294 TEST_F(VideoSendStreamTest, SupportsVideoContentType) {
295 class VideoRotationObserver : public test::SendTest {
296 public:
297 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) {
298 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension(
299 kRtpExtensionVideoContentType, test::kVideoContentTypeExtensionId));
300 }
301
302 Action OnSendRtp(const uint8_t* packet, size_t length) override {
303 RTPHeader header;
304 EXPECT_TRUE(parser_->Parse(packet, length, &header));
305 EXPECT_TRUE(header.extension.hasVideoContentType);
306 EXPECT_EQ(VideoContentType::SCREENSHARE,
307 header.extension.videoContentType);
308 observation_complete_.Set();
309 return SEND_PACKET;
310 }
311
312 void ModifyVideoConfigs(
313 VideoSendStream::Config* send_config,
314 std::vector<VideoReceiveStream::Config>* receive_configs,
315 VideoEncoderConfig* encoder_config) override {
316 send_config->rtp.extensions.clear();
317 send_config->rtp.extensions.push_back(
318 RtpExtension(RtpExtension::kVideoContentTypeUri,
319 test::kVideoContentTypeExtensionId));
320 encoder_config->content_type = VideoEncoderConfig::ContentType::kScreen;
321 }
322
323 void PerformTest() override {
324 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet.";
325 }
326 } test;
327
328 RunBaseTest(&test);
329 }
330
294 class FakeReceiveStatistics : public NullReceiveStatistics { 331 class FakeReceiveStatistics : public NullReceiveStatistics {
295 public: 332 public:
296 FakeReceiveStatistics(uint32_t send_ssrc, 333 FakeReceiveStatistics(uint32_t send_ssrc,
297 uint32_t last_sequence_number, 334 uint32_t last_sequence_number,
298 uint32_t cumulative_lost, 335 uint32_t cumulative_lost,
299 uint8_t fraction_lost) 336 uint8_t fraction_lost)
300 : lossy_stats_(new LossyStatistician(last_sequence_number, 337 : lossy_stats_(new LossyStatistician(last_sequence_number,
301 cumulative_lost, 338 cumulative_lost,
302 fraction_lost)) { 339 fraction_lost)) {
303 stats_map_[send_ssrc] = lossy_stats_.get(); 340 stats_map_[send_ssrc] = lossy_stats_.get();
(...skipping 2989 matching lines...) Expand 10 before | Expand all | Expand 10 after
3293 rtc::CriticalSection crit_; 3330 rtc::CriticalSection crit_;
3294 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); 3331 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_);
3295 bool first_packet_sent_ GUARDED_BY(&crit_); 3332 bool first_packet_sent_ GUARDED_BY(&crit_);
3296 rtc::Event bitrate_changed_event_; 3333 rtc::Event bitrate_changed_event_;
3297 } test; 3334 } test;
3298 3335
3299 RunBaseTest(&test); 3336 RunBaseTest(&test);
3300 } 3337 }
3301 3338
3302 } // namespace webrtc 3339 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_quality_test.cc ('k') | webrtc/video/video_stream_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698