OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/client/software_video_renderer.h" | 5 #include "remoting/client/software_video_renderer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 // std::vector<bool> doesn't allow to get pointer to individual values, so | 161 // std::vector<bool> doesn't allow to get pointer to individual values, so |
162 // int needs to be used instead. | 162 // int needs to be used instead. |
163 std::vector<int> callback_called(kFrameCount); | 163 std::vector<int> callback_called(kFrameCount); |
164 | 164 |
165 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { | 165 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { |
166 test_frames.push_back(CreateTestFrame(frame_index)); | 166 test_frames.push_back(CreateTestFrame(frame_index)); |
167 callback_called[frame_index] = 0; | 167 callback_called[frame_index] = 0; |
168 | 168 |
169 renderer_->ProcessVideoPacket( | 169 renderer_->ProcessVideoPacket( |
170 encoder_.Encode(*test_frames[frame_index], 0), | 170 encoder_.Encode(*test_frames[frame_index]), |
171 base::Bind(&SetTrue, &(callback_called[frame_index]))); | 171 base::Bind(&SetTrue, &(callback_called[frame_index]))); |
172 } | 172 } |
173 | 173 |
174 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { | 174 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { |
175 base::Closure done_callback; | 175 base::Closure done_callback; |
176 std::unique_ptr<DesktopFrame> decoded_frame = | 176 std::unique_ptr<DesktopFrame> decoded_frame = |
177 frame_consumer_.WaitForNextFrame(&done_callback); | 177 frame_consumer_.WaitForNextFrame(&done_callback); |
178 | 178 |
179 EXPECT_FALSE(callback_called[frame_index]); | 179 EXPECT_FALSE(callback_called[frame_index]); |
180 done_callback.Run(); | 180 done_callback.Run(); |
181 EXPECT_TRUE(callback_called[frame_index]); | 181 EXPECT_TRUE(callback_called[frame_index]); |
182 | 182 |
183 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame)); | 183 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame)); |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 } // namespace remoting | 187 } // namespace remoting |
OLD | NEW |