| 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 "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/debug/debugger.h" | 8 #include "base/debug/debugger.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 const int center_offset_uv = | 400 const int center_offset_uv = |
| 401 (frame->stride(VideoFrame::kUPlane) * (center.y() / 2)) + | 401 (frame->stride(VideoFrame::kUPlane) * (center.y() / 2)) + |
| 402 (center.x() / 2); | 402 (center.x() / 2); |
| 403 report_callback_.Run( | 403 report_callback_.Run( |
| 404 SkColorSetRGB(frame->data(VideoFrame::kYPlane)[center_offset_y], | 404 SkColorSetRGB(frame->data(VideoFrame::kYPlane)[center_offset_y], |
| 405 frame->data(VideoFrame::kUPlane)[center_offset_uv], | 405 frame->data(VideoFrame::kUPlane)[center_offset_uv], |
| 406 frame->data(VideoFrame::kVPlane)[center_offset_uv]), | 406 frame->data(VideoFrame::kVPlane)[center_offset_uv]), |
| 407 frame->visible_rect().size()); | 407 frame->visible_rect().size()); |
| 408 } | 408 } |
| 409 | 409 |
| 410 void OnError(const std::string& reason) override { error_callback_.Run(); } | 410 void OnError(const tracked_objects::Location& from_here, |
| 411 const std::string& reason) override { |
| 412 error_callback_.Run(); |
| 413 } |
| 411 | 414 |
| 412 double GetBufferPoolUtilization() const override { return 0.0; } | 415 double GetBufferPoolUtilization() const override { return 0.0; } |
| 413 | 416 |
| 414 private: | 417 private: |
| 415 class AutoReleaseBuffer : public media::VideoCaptureDevice::Client::Buffer { | 418 class AutoReleaseBuffer : public media::VideoCaptureDevice::Client::Buffer { |
| 416 public: | 419 public: |
| 417 AutoReleaseBuffer( | 420 AutoReleaseBuffer( |
| 418 const scoped_refptr<VideoCaptureBufferPool>& pool, | 421 const scoped_refptr<VideoCaptureBufferPool>& pool, |
| 419 scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle, | 422 scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle, |
| 420 int buffer_id) | 423 int buffer_id) |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 policies[i], gfx::Size(1000, 1000), gfx::Size(1000, 1000)); | 1137 policies[i], gfx::Size(1000, 1000), gfx::Size(1000, 1000)); |
| 1135 RunTestForPreferredSize( | 1138 RunTestForPreferredSize( |
| 1136 policies[i], gfx::Size(1600, 1000), gfx::Size(1600, 1000)); | 1139 policies[i], gfx::Size(1600, 1000), gfx::Size(1600, 1000)); |
| 1137 RunTestForPreferredSize( | 1140 RunTestForPreferredSize( |
| 1138 policies[i], gfx::Size(837, 999), gfx::Size(837, 999)); | 1141 policies[i], gfx::Size(837, 999), gfx::Size(837, 999)); |
| 1139 } | 1142 } |
| 1140 } | 1143 } |
| 1141 | 1144 |
| 1142 } // namespace | 1145 } // namespace |
| 1143 } // namespace content | 1146 } // namespace content |
| OLD | NEW |