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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 size_t y_stride, | 340 size_t y_stride, |
341 size_t u_stride, | 341 size_t u_stride, |
342 size_t v_stride, | 342 size_t v_stride, |
343 const media::VideoCaptureFormat& frame_format, | 343 const media::VideoCaptureFormat& frame_format, |
344 int clockwise_rotation, | 344 int clockwise_rotation, |
345 const base::TimeTicks& timestamp)); | 345 const base::TimeTicks& timestamp)); |
346 | 346 |
347 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); | 347 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); |
348 | 348 |
349 scoped_ptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer( | 349 scoped_ptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer( |
| 350 const gfx::Size& dimensions, |
350 media::VideoPixelFormat format, | 351 media::VideoPixelFormat format, |
351 const gfx::Size& dimensions) override { | 352 media::VideoPixelStorage storage) override { |
352 CHECK_EQ(format, media::PIXEL_FORMAT_I420); | 353 CHECK_EQ(format, media::PIXEL_FORMAT_I420); |
353 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. | 354 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. |
354 int buffer_id = buffer_pool_->ReserveForProducer(format, dimensions, | 355 const int buffer_id = buffer_pool_->ReserveForProducer( |
355 &buffer_id_to_drop); | 356 format, storage, dimensions, &buffer_id_to_drop); |
356 if (buffer_id == VideoCaptureBufferPool::kInvalidId) | 357 if (buffer_id == VideoCaptureBufferPool::kInvalidId) |
357 return NULL; | 358 return NULL; |
358 | 359 |
359 return scoped_ptr<media::VideoCaptureDevice::Client::Buffer>( | 360 return scoped_ptr<media::VideoCaptureDevice::Client::Buffer>( |
360 new AutoReleaseBuffer( | 361 new AutoReleaseBuffer( |
361 buffer_pool_, buffer_pool_->GetBufferHandle(buffer_id), buffer_id)); | 362 buffer_pool_, buffer_pool_->GetBufferHandle(buffer_id), buffer_id)); |
362 } | 363 } |
363 // Trampoline method to workaround GMOCK problems with scoped_ptr<>. | 364 // Trampoline method to workaround GMOCK problems with scoped_ptr<>. |
364 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, | 365 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, |
365 const media::VideoCaptureFormat& frame_format, | 366 const media::VideoCaptureFormat& frame_format, |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 SK_ColorBLACK, gfx::Size(kTestWidth, | 1088 SK_ColorBLACK, gfx::Size(kTestWidth, |
1088 kTestWidth * arbitrary_source_size.height() / | 1089 kTestWidth * arbitrary_source_size.height() / |
1089 arbitrary_source_size.width()))); | 1090 arbitrary_source_size.width()))); |
1090 } | 1091 } |
1091 | 1092 |
1092 device()->StopAndDeAllocate(); | 1093 device()->StopAndDeAllocate(); |
1093 } | 1094 } |
1094 | 1095 |
1095 } // namespace | 1096 } // namespace |
1096 } // namespace content | 1097 } // namespace content |
OLD | NEW |