OLD | NEW |
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 |
11 #include <memory> | 11 #include <memory> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "webrtc/base/bind.h" | 14 #include "webrtc/base/bind.h" |
15 #include "webrtc/base/checks.h" | 15 #include "webrtc/base/checks.h" |
16 #include "webrtc/base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
17 #include "webrtc/base/event.h" | 17 #include "webrtc/base/event.h" |
18 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
19 #include "webrtc/base/platform_thread.h" | 19 #include "webrtc/base/platform_thread.h" |
20 #include "webrtc/base/rate_limiter.h" | 20 #include "webrtc/base/rate_limiter.h" |
21 #include "webrtc/call.h" | 21 #include "webrtc/call.h" |
22 #include "webrtc/common_video/include/frame_callback.h" | 22 #include "webrtc/common_video/include/frame_callback.h" |
23 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 23 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
24 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 24 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
25 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" |
26 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" |
| 27 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" |
27 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" | 28 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" |
28 #include "webrtc/system_wrappers/include/sleep.h" | 29 #include "webrtc/system_wrappers/include/sleep.h" |
29 #include "webrtc/test/call_test.h" | 30 #include "webrtc/test/call_test.h" |
30 #include "webrtc/test/configurable_frame_size_encoder.h" | 31 #include "webrtc/test/configurable_frame_size_encoder.h" |
31 #include "webrtc/test/fake_texture_frame.h" | 32 #include "webrtc/test/fake_texture_frame.h" |
32 #include "webrtc/test/frame_generator.h" | 33 #include "webrtc/test/frame_generator.h" |
33 #include "webrtc/test/frame_utils.h" | 34 #include "webrtc/test/frame_utils.h" |
34 #include "webrtc/test/gtest.h" | 35 #include "webrtc/test/gtest.h" |
35 #include "webrtc/test/null_transport.h" | 36 #include "webrtc/test/null_transport.h" |
36 #include "webrtc/test/rtcp_packet_parser.h" | 37 #include "webrtc/test/rtcp_packet_parser.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 use_nack_(use_nack), | 361 use_nack_(use_nack), |
361 expect_red_(expect_red), | 362 expect_red_(expect_red), |
362 expect_ulpfec_(expect_ulpfec), | 363 expect_ulpfec_(expect_ulpfec), |
363 send_count_(0), | 364 send_count_(0), |
364 received_media_(false), | 365 received_media_(false), |
365 received_fec_(false), | 366 received_fec_(false), |
366 header_extensions_enabled_(header_extensions_enabled) { | 367 header_extensions_enabled_(header_extensions_enabled) { |
367 if (codec == "H264") { | 368 if (codec == "H264") { |
368 encoder_.reset(new test::FakeH264Encoder(Clock::GetRealTimeClock())); | 369 encoder_.reset(new test::FakeH264Encoder(Clock::GetRealTimeClock())); |
369 } else if (codec == "VP8") { | 370 } else if (codec == "VP8") { |
370 encoder_.reset(VideoEncoder::Create(VideoEncoder::EncoderType::kVp8)); | 371 encoder_.reset(VP8Encoder::Create()); |
371 } else if (codec == "VP9") { | 372 } else if (codec == "VP9") { |
372 encoder_.reset(VideoEncoder::Create(VideoEncoder::EncoderType::kVp9)); | 373 encoder_.reset(VP9Encoder::Create()); |
373 } else { | 374 } else { |
374 RTC_NOTREACHED(); | 375 RTC_NOTREACHED(); |
375 } | 376 } |
376 } | 377 } |
377 | 378 |
378 private: | 379 private: |
379 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 380 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
380 RTPHeader header; | 381 RTPHeader header; |
381 EXPECT_TRUE(parser_->Parse(packet, length, &header)); | 382 EXPECT_TRUE(parser_->Parse(packet, length, &header)); |
382 | 383 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 : EndToEndTest(VideoSendStreamTest::kDefaultTimeoutMs), | 546 : EndToEndTest(VideoSendStreamTest::kDefaultTimeoutMs), |
546 payload_name_(codec), | 547 payload_name_(codec), |
547 use_nack_(use_nack), | 548 use_nack_(use_nack), |
548 send_count_(0), | 549 send_count_(0), |
549 sent_media_(false), | 550 sent_media_(false), |
550 sent_flexfec_(false), | 551 sent_flexfec_(false), |
551 header_extensions_enabled_(header_extensions_enabled) { | 552 header_extensions_enabled_(header_extensions_enabled) { |
552 if (codec == "H264") { | 553 if (codec == "H264") { |
553 encoder_.reset(new test::FakeH264Encoder(Clock::GetRealTimeClock())); | 554 encoder_.reset(new test::FakeH264Encoder(Clock::GetRealTimeClock())); |
554 } else if (codec == "VP8") { | 555 } else if (codec == "VP8") { |
555 encoder_.reset(VideoEncoder::Create(VideoEncoder::EncoderType::kVp8)); | 556 encoder_.reset(VP8Encoder::Create()); |
556 } else if (codec == "VP9") { | 557 } else if (codec == "VP9") { |
557 encoder_.reset(VideoEncoder::Create(VideoEncoder::EncoderType::kVp9)); | 558 encoder_.reset(VP9Encoder::Create()); |
558 } else { | 559 } else { |
559 RTC_NOTREACHED(); | 560 RTC_NOTREACHED(); |
560 } | 561 } |
561 } | 562 } |
562 | 563 |
563 size_t GetNumFlexfecStreams() const override { return 1; } | 564 size_t GetNumFlexfecStreams() const override { return 1; } |
564 | 565 |
565 private: | 566 private: |
566 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 567 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
567 RTPHeader header; | 568 RTPHeader header; |
(...skipping 2599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3167 RequestSourceRotateIfVideoOrientationExtensionNotSupported) { | 3168 RequestSourceRotateIfVideoOrientationExtensionNotSupported) { |
3168 TestRequestSourceRotateVideo(false); | 3169 TestRequestSourceRotateVideo(false); |
3169 } | 3170 } |
3170 | 3171 |
3171 TEST_F(VideoSendStreamTest, | 3172 TEST_F(VideoSendStreamTest, |
3172 DoNotRequestsRotationIfVideoOrientationExtensionSupported) { | 3173 DoNotRequestsRotationIfVideoOrientationExtensionSupported) { |
3173 TestRequestSourceRotateVideo(true); | 3174 TestRequestSourceRotateVideo(true); |
3174 } | 3175 } |
3175 | 3176 |
3176 } // namespace webrtc | 3177 } // namespace webrtc |
OLD | NEW |