| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/media/capture/web_contents_video_capture_device.h" | 5 #include "content/browser/media/capture/web_contents_video_capture_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 << "attached."; | 68 << "attached."; |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 void RunCurrentLoopWithDeadline() { | 72 void RunCurrentLoopWithDeadline() { |
| 73 base::Timer deadline(false, false); | 73 base::Timer deadline(false, false); |
| 74 deadline.Start( | 74 deadline.Start( |
| 75 FROM_HERE, TestTimeouts::action_max_timeout(), | 75 FROM_HERE, TestTimeouts::action_max_timeout(), |
| 76 base::Bind(&DeadlineExceeded, | 76 base::Bind(&DeadlineExceeded, |
| 77 base::MessageLoop::current()->QuitWhenIdleClosure())); | 77 base::MessageLoop::current()->QuitWhenIdleClosure())); |
| 78 base::MessageLoop::current()->Run(); | 78 base::RunLoop().Run(); |
| 79 deadline.Stop(); | 79 deadline.Stop(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 SkColor ConvertRgbToYuv(SkColor rgb) { | 82 SkColor ConvertRgbToYuv(SkColor rgb) { |
| 83 uint8_t yuv[3]; | 83 uint8_t yuv[3]; |
| 84 media::ConvertRGB32ToYUV(reinterpret_cast<uint8_t*>(&rgb), yuv, yuv + 1, | 84 media::ConvertRGB32ToYUV(reinterpret_cast<uint8_t*>(&rgb), yuv, yuv + 1, |
| 85 yuv + 2, 1, 1, 1, 1, 1); | 85 yuv + 2, 1, 1, 1, 1, 1); |
| 86 return SkColorSetRGB(yuv[0], yuv[1], yuv[2]); | 86 return SkColorSetRGB(yuv[0], yuv[1], yuv[2]); |
| 87 } | 87 } |
| 88 | 88 |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 for (int i = 0; i < 3; ++i) { | 1209 for (int i = 0; i < 3; ++i) { |
| 1210 SimulateRefreshFrameRequest(); | 1210 SimulateRefreshFrameRequest(); |
| 1211 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 1211 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 device()->StopAndDeAllocate(); | 1214 device()->StopAndDeAllocate(); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 } // namespace | 1217 } // namespace |
| 1218 } // namespace content | 1218 } // namespace content |
| OLD | NEW |