| 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 DCHECK(pool_); | 435 DCHECK(pool_); |
| 436 } | 436 } |
| 437 int id() const override { return id_; } | 437 int id() const override { return id_; } |
| 438 gfx::Size dimensions() const override { | 438 gfx::Size dimensions() const override { |
| 439 return buffer_handle_->dimensions(); | 439 return buffer_handle_->dimensions(); |
| 440 } | 440 } |
| 441 size_t mapped_size() const override { | 441 size_t mapped_size() const override { |
| 442 return buffer_handle_->mapped_size(); | 442 return buffer_handle_->mapped_size(); |
| 443 } | 443 } |
| 444 void* data(int plane) override { return buffer_handle_->data(plane); } | 444 void* data(int plane) override { return buffer_handle_->data(plane); } |
| 445 ClientBuffer AsClientBuffer(int plane) override { return nullptr; } | |
| 446 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 445 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 447 base::FileDescriptor AsPlatformFile() override { | 446 base::FileDescriptor AsPlatformFile() override { |
| 448 return base::FileDescriptor(); | 447 return base::FileDescriptor(); |
| 449 } | 448 } |
| 450 #endif | 449 #endif |
| 450 bool IsBackedByVideoFrame() const override { |
| 451 return buffer_handle_->IsBackedByVideoFrame(); |
| 452 } |
| 453 scoped_refptr<media::VideoFrame> GetVideoFrame() override { |
| 454 return buffer_handle_->GetVideoFrame(); |
| 455 } |
| 451 | 456 |
| 452 private: | 457 private: |
| 453 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } | 458 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } |
| 454 | 459 |
| 455 const int id_; | 460 const int id_; |
| 456 const scoped_refptr<media::VideoCaptureBufferPool> pool_; | 461 const scoped_refptr<media::VideoCaptureBufferPool> pool_; |
| 457 const std::unique_ptr<media::VideoCaptureBufferHandle> buffer_handle_; | 462 const std::unique_ptr<media::VideoCaptureBufferHandle> buffer_handle_; |
| 458 }; | 463 }; |
| 459 | 464 |
| 460 scoped_refptr<media::VideoCaptureBufferPool> buffer_pool_; | 465 scoped_refptr<media::VideoCaptureBufferPool> buffer_pool_; |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 for (int i = 0; i < 3; ++i) { | 1260 for (int i = 0; i < 3; ++i) { |
| 1256 SimulateRefreshFrameRequest(); | 1261 SimulateRefreshFrameRequest(); |
| 1257 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 1262 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
| 1258 } | 1263 } |
| 1259 | 1264 |
| 1260 device()->StopAndDeAllocate(); | 1265 device()->StopAndDeAllocate(); |
| 1261 } | 1266 } |
| 1262 | 1267 |
| 1263 } // namespace | 1268 } // namespace |
| 1264 } // namespace content | 1269 } // namespace content |
| OLD | NEW |