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> | 10 #include <algorithm> |
(...skipping 4260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4271 | 4271 |
4272 return SEND_PACKET; | 4272 return SEND_PACKET; |
4273 } | 4273 } |
4274 | 4274 |
4275 rtc::Optional<uint16_t> last_observed_sequence_number_ GUARDED_BY(crit_); | 4275 rtc::Optional<uint16_t> last_observed_sequence_number_ GUARDED_BY(crit_); |
4276 rtc::Optional<uint32_t> last_observed_timestamp_ GUARDED_BY(crit_); | 4276 rtc::Optional<uint32_t> last_observed_timestamp_ GUARDED_BY(crit_); |
4277 size_t num_flexfec_packets_sent_ GUARDED_BY(crit_); | 4277 size_t num_flexfec_packets_sent_ GUARDED_BY(crit_); |
4278 rtc::CriticalSection crit_; | 4278 rtc::CriticalSection crit_; |
4279 } observer; | 4279 } observer; |
4280 | 4280 |
4281 // These would have been declared as constexpr, but then some compilers | 4281 static constexpr int kFrameMaxWidth = 320; |
4282 // require them to be captured in the lambda, and other compilers complain | 4282 static constexpr int kFrameMaxHeight = 180; |
4283 // about no-ununused-lambda-capture. Keeping them as normal variables was | 4283 static constexpr int kFrameRate = 15; |
4284 // the easiest work-around. | |
4285 int kFrameMaxWidth = 320; | |
4286 int kFrameMaxHeight = 180; | |
4287 int kFrameRate = 15; | |
4288 | 4284 |
4289 Call::Config config(event_log_.get()); | 4285 Call::Config config(event_log_.get()); |
4290 | 4286 |
4291 std::unique_ptr<test::PacketTransport> send_transport; | 4287 std::unique_ptr<test::PacketTransport> send_transport; |
4292 std::unique_ptr<test::PacketTransport> receive_transport; | 4288 std::unique_ptr<test::PacketTransport> receive_transport; |
4293 std::unique_ptr<VideoEncoder> encoder; | 4289 std::unique_ptr<VideoEncoder> encoder; |
4294 | 4290 |
4295 task_queue_.SendTask([&]() { | 4291 task_queue_.SendTask([&]() { |
4296 CreateCalls(config, config); | 4292 CreateCalls(config, config); |
4297 | 4293 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4364 | 4360 |
4365 task_queue_.SendTask([this, &observer]() { | 4361 task_queue_.SendTask([this, &observer]() { |
4366 // Ensure monotonicity when the VideoSendStream is restarted. | 4362 // Ensure monotonicity when the VideoSendStream is restarted. |
4367 Stop(); | 4363 Stop(); |
4368 observer.ResetPacketCount(); | 4364 observer.ResetPacketCount(); |
4369 Start(); | 4365 Start(); |
4370 }); | 4366 }); |
4371 | 4367 |
4372 EXPECT_TRUE(observer.Wait()) << "Timed out waiting for packets."; | 4368 EXPECT_TRUE(observer.Wait()) << "Timed out waiting for packets."; |
4373 | 4369 |
4374 task_queue_.SendTask([this, &observer, | 4370 task_queue_.SendTask([this, &observer]() { |
4375 kFrameRate, kFrameMaxWidth, kFrameMaxHeight]() { | |
4376 // Ensure monotonicity when the VideoSendStream is recreated. | 4371 // Ensure monotonicity when the VideoSendStream is recreated. |
4377 frame_generator_capturer_->Stop(); | 4372 frame_generator_capturer_->Stop(); |
4378 sender_call_->DestroyVideoSendStream(video_send_stream_); | 4373 sender_call_->DestroyVideoSendStream(video_send_stream_); |
4379 observer.ResetPacketCount(); | 4374 observer.ResetPacketCount(); |
4380 video_send_stream_ = sender_call_->CreateVideoSendStream( | 4375 video_send_stream_ = sender_call_->CreateVideoSendStream( |
4381 video_send_config_.Copy(), video_encoder_config_.Copy()); | 4376 video_send_config_.Copy(), video_encoder_config_.Copy()); |
4382 video_send_stream_->Start(); | 4377 video_send_stream_->Start(); |
4383 CreateFrameGeneratorCapturer(kFrameRate, kFrameMaxWidth, kFrameMaxHeight); | 4378 CreateFrameGeneratorCapturer(kFrameRate, kFrameMaxWidth, kFrameMaxHeight); |
4384 frame_generator_capturer_->Start(); | 4379 frame_generator_capturer_->Start(); |
4385 }); | 4380 }); |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5016 std::unique_ptr<VideoEncoder> encoder_; | 5011 std::unique_ptr<VideoEncoder> encoder_; |
5017 std::unique_ptr<VideoDecoder> decoder_; | 5012 std::unique_ptr<VideoDecoder> decoder_; |
5018 rtc::CriticalSection crit_; | 5013 rtc::CriticalSection crit_; |
5019 int recorded_frames_ GUARDED_BY(crit_); | 5014 int recorded_frames_ GUARDED_BY(crit_); |
5020 } test(this); | 5015 } test(this); |
5021 | 5016 |
5022 RunBaseTest(&test); | 5017 RunBaseTest(&test); |
5023 } | 5018 } |
5024 | 5019 |
5025 } // namespace webrtc | 5020 } // namespace webrtc |
OLD | NEW |