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 "content/browser/renderer_host/media/video_capture_device_client.h" | 5 #include "content/browser/renderer_host/media/video_capture_device_client.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 buffer_handle_(pool_->GetBufferHandle(buffer_id)) { | 40 buffer_handle_(pool_->GetBufferHandle(buffer_id)) { |
41 DCHECK(pool_.get()); | 41 DCHECK(pool_.get()); |
42 } | 42 } |
43 int id() const override { return id_; } | 43 int id() const override { return id_; } |
44 gfx::Size dimensions() const override { return buffer_handle_->dimensions(); } | 44 gfx::Size dimensions() const override { return buffer_handle_->dimensions(); } |
45 size_t mapped_size() const override { return buffer_handle_->mapped_size(); } | 45 size_t mapped_size() const override { return buffer_handle_->mapped_size(); } |
46 void* data(int plane) override { return buffer_handle_->data(plane); } | 46 void* data(int plane) override { return buffer_handle_->data(plane); } |
47 ClientBuffer AsClientBuffer(int plane) override { | 47 ClientBuffer AsClientBuffer(int plane) override { |
48 return buffer_handle_->AsClientBuffer(plane); | 48 return buffer_handle_->AsClientBuffer(plane); |
49 } | 49 } |
50 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS)) | 50 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
51 base::FileDescriptor AsPlatformFile() override { | 51 base::FileDescriptor AsPlatformFile() override { |
52 return buffer_handle_->AsPlatformFile(); | 52 return buffer_handle_->AsPlatformFile(); |
53 } | 53 } |
54 #endif | 54 #endif |
55 | 55 |
56 private: | 56 private: |
57 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } | 57 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } |
58 | 58 |
59 const int id_; | 59 const int id_; |
60 const scoped_refptr<VideoCaptureBufferPool> pool_; | 60 const scoped_refptr<VideoCaptureBufferPool> pool_; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 reinterpret_cast<uint8_t*>(buffer->data(VideoFrame::kUPlane)); | 406 reinterpret_cast<uint8_t*>(buffer->data(VideoFrame::kUPlane)); |
407 *v_plane_data = | 407 *v_plane_data = |
408 reinterpret_cast<uint8_t*>(buffer->data(VideoFrame::kVPlane)); | 408 reinterpret_cast<uint8_t*>(buffer->data(VideoFrame::kVPlane)); |
409 return buffer; | 409 return buffer; |
410 } | 410 } |
411 NOTREACHED(); | 411 NOTREACHED(); |
412 return scoped_ptr<Buffer>(); | 412 return scoped_ptr<Buffer>(); |
413 } | 413 } |
414 | 414 |
415 } // namespace content | 415 } // namespace content |
OLD | NEW |