| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 // std::vector<bool> doesn't allow to get pointer to individual values, so | 160 // std::vector<bool> doesn't allow to get pointer to individual values, so |
| 161 // int needs to be used instead. | 161 // int needs to be used instead. |
| 162 std::vector<int> callback_called(kFrameCount); | 162 std::vector<int> callback_called(kFrameCount); |
| 163 | 163 |
| 164 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { | 164 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { |
| 165 test_frames.push_back(CreateTestFrame(frame_index)); | 165 test_frames.push_back(CreateTestFrame(frame_index)); |
| 166 callback_called[frame_index] = 0; | 166 callback_called[frame_index] = 0; |
| 167 | 167 |
| 168 renderer_->ProcessVideoPacket( | 168 renderer_->ProcessVideoPacket( |
| 169 encoder_.Encode(*test_frames[frame_index]), | 169 encoder_.Encode(*test_frames[frame_index], 0), |
| 170 base::Bind(&SetTrue, &(callback_called[frame_index]))); | 170 base::Bind(&SetTrue, &(callback_called[frame_index]))); |
| 171 } | 171 } |
| 172 | 172 |
| 173 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { | 173 for (int frame_index = 0; frame_index < kFrameCount; frame_index++) { |
| 174 base::Closure done_callback; | 174 base::Closure done_callback; |
| 175 std::unique_ptr<DesktopFrame> decoded_frame = | 175 std::unique_ptr<DesktopFrame> decoded_frame = |
| 176 frame_consumer_.WaitForNextFrame(&done_callback); | 176 frame_consumer_.WaitForNextFrame(&done_callback); |
| 177 | 177 |
| 178 EXPECT_FALSE(callback_called[frame_index]); | 178 EXPECT_FALSE(callback_called[frame_index]); |
| 179 done_callback.Run(); | 179 done_callback.Run(); |
| 180 EXPECT_TRUE(callback_called[frame_index]); | 180 EXPECT_TRUE(callback_called[frame_index]); |
| 181 | 181 |
| 182 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame)); | 182 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame)); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace remoting | 186 } // namespace remoting |
| OLD | NEW |