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 | 10 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 vector<FrameData> frame_data_; | 173 vector<FrameData> frame_data_; |
174 }; | 174 }; |
175 | 175 |
176 class TestVideoSender : public ::testing::Test { | 176 class TestVideoSender : public ::testing::Test { |
177 protected: | 177 protected: |
178 // Note: simulated clock starts at 1 seconds, since parts of webrtc use 0 as | 178 // Note: simulated clock starts at 1 seconds, since parts of webrtc use 0 as |
179 // a special case (e.g. frame rate in media optimization). | 179 // a special case (e.g. frame rate in media optimization). |
180 TestVideoSender() : clock_(1000), encoded_frame_callback_(&clock_) {} | 180 TestVideoSender() : clock_(1000), encoded_frame_callback_(&clock_) {} |
181 | 181 |
182 void SetUp() override { | 182 void SetUp() override { |
183 sender_.reset(new VideoSender(&clock_, &encoded_frame_callback_, nullptr, | 183 sender_.reset( |
184 nullptr, nullptr)); | 184 new VideoSender(&clock_, &encoded_frame_callback_, nullptr, nullptr)); |
185 } | 185 } |
186 | 186 |
187 void AddFrame() { | 187 void AddFrame() { |
188 assert(generator_.get()); | 188 assert(generator_.get()); |
189 sender_->AddVideoFrame(*generator_->NextFrame(), NULL, NULL); | 189 sender_->AddVideoFrame(*generator_->NextFrame(), NULL); |
190 } | 190 } |
191 | 191 |
192 SimulatedClock clock_; | 192 SimulatedClock clock_; |
193 EncodedImageCallbackImpl encoded_frame_callback_; | 193 EncodedImageCallbackImpl encoded_frame_callback_; |
194 // Used by subclassing tests, need to outlive sender_. | 194 // Used by subclassing tests, need to outlive sender_. |
195 std::unique_ptr<VideoEncoder> encoder_; | 195 std::unique_ptr<VideoEncoder> encoder_; |
196 std::unique_ptr<VideoSender> sender_; | 196 std::unique_ptr<VideoSender> sender_; |
197 std::unique_ptr<FrameGenerator> generator_; | 197 std::unique_ptr<FrameGenerator> generator_; |
198 }; | 198 }; |
199 | 199 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 } | 495 } |
496 { | 496 { |
497 // TODO(andresp): Find out why this fails with framerate = 7.5 | 497 // TODO(andresp): Find out why this fails with framerate = 7.5 |
498 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; | 498 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; |
499 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); | 499 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); |
500 } | 500 } |
501 } | 501 } |
502 } // namespace | 502 } // namespace |
503 } // namespace vcm | 503 } // namespace vcm |
504 } // namespace webrtc | 504 } // namespace webrtc |
OLD | NEW |