| 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 |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 class FrameObserver : public I420FrameCallback { | 1115 class FrameObserver : public I420FrameCallback { |
| 1116 public: | 1116 public: |
| 1117 FrameObserver() : output_frame_event_(EventWrapper::Create()) {} | 1117 FrameObserver() : output_frame_event_(EventWrapper::Create()) {} |
| 1118 | 1118 |
| 1119 void FrameCallback(VideoFrame* video_frame) override { | 1119 void FrameCallback(VideoFrame* video_frame) override { |
| 1120 output_frames_.push_back(*video_frame); | 1120 output_frames_.push_back(*video_frame); |
| 1121 output_frame_event_->Set(); | 1121 output_frame_event_->Set(); |
| 1122 } | 1122 } |
| 1123 | 1123 |
| 1124 void WaitOutputFrame() { | 1124 void WaitOutputFrame() { |
| 1125 const unsigned long kWaitFrameTimeoutMs = 3000; | 1125 const uint32_t kWaitFrameTimeoutMs = 3000; |
| 1126 EXPECT_EQ(kEventSignaled, output_frame_event_->Wait(kWaitFrameTimeoutMs)) | 1126 EXPECT_EQ(kEventSignaled, output_frame_event_->Wait(kWaitFrameTimeoutMs)) |
| 1127 << "Timeout while waiting for output frames."; | 1127 << "Timeout while waiting for output frames."; |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 const std::vector<VideoFrame>& output_frames() const { | 1130 const std::vector<VideoFrame>& output_frames() const { |
| 1131 return output_frames_; | 1131 return output_frames_; |
| 1132 } | 1132 } |
| 1133 | 1133 |
| 1134 private: | 1134 private: |
| 1135 // Delivered output frames. | 1135 // Delivered output frames. |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 VideoEncoderConfig encoder_config_; | 1416 VideoEncoderConfig encoder_config_; |
| 1417 } test; | 1417 } test; |
| 1418 | 1418 |
| 1419 RunBaseTest(&test, FakeNetworkPipe::Config()); | 1419 RunBaseTest(&test, FakeNetworkPipe::Config()); |
| 1420 } | 1420 } |
| 1421 | 1421 |
| 1422 static const size_t kVideoCodecConfigObserverNumberOfTemporalLayers = 4; | 1422 static const size_t kVideoCodecConfigObserverNumberOfTemporalLayers = 4; |
| 1423 template <typename T> | 1423 template <typename T> |
| 1424 class VideoCodecConfigObserver : public test::SendTest, | 1424 class VideoCodecConfigObserver : public test::SendTest, |
| 1425 public test::FakeEncoder { | 1425 public test::FakeEncoder { |
| 1426 | |
| 1427 public: | 1426 public: |
| 1428 VideoCodecConfigObserver(VideoCodecType video_codec_type, | 1427 VideoCodecConfigObserver(VideoCodecType video_codec_type, |
| 1429 const char* codec_name) | 1428 const char* codec_name) |
| 1430 : SendTest(VideoSendStreamTest::kDefaultTimeoutMs), | 1429 : SendTest(VideoSendStreamTest::kDefaultTimeoutMs), |
| 1431 FakeEncoder(Clock::GetRealTimeClock()), | 1430 FakeEncoder(Clock::GetRealTimeClock()), |
| 1432 video_codec_type_(video_codec_type), | 1431 video_codec_type_(video_codec_type), |
| 1433 codec_name_(codec_name), | 1432 codec_name_(codec_name), |
| 1434 num_initializations_(0) { | 1433 num_initializations_(0) { |
| 1435 memset(&encoder_settings_, 0, sizeof(encoder_settings_)); | 1434 memset(&encoder_settings_, 0, sizeof(encoder_settings_)); |
| 1436 } | 1435 } |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2210 EXPECT_GT(vp9_header.num_ref_pics, 0u); | 2209 EXPECT_GT(vp9_header.num_ref_pics, 0u); |
| 2211 observation_complete_->Set(); | 2210 observation_complete_->Set(); |
| 2212 } | 2211 } |
| 2213 } | 2212 } |
| 2214 } test; | 2213 } test; |
| 2215 | 2214 |
| 2216 RunBaseTest(&test, FakeNetworkPipe::Config()); | 2215 RunBaseTest(&test, FakeNetworkPipe::Config()); |
| 2217 } | 2216 } |
| 2218 | 2217 |
| 2219 } // namespace webrtc | 2218 } // namespace webrtc |
| OLD | NEW |