OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/capture/video/fake_video_capture_device.h" | 5 #include "media/capture/video/fake_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 <memory> | 10 #include <memory> |
(...skipping 22 matching lines...) Expand all Loading... |
33 namespace media { | 33 namespace media { |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 class StubBufferHandle : public VideoCaptureBufferHandle { | 37 class StubBufferHandle : public VideoCaptureBufferHandle { |
38 public: | 38 public: |
39 StubBufferHandle(size_t mapped_size, uint8_t* data) | 39 StubBufferHandle(size_t mapped_size, uint8_t* data) |
40 : mapped_size_(mapped_size), data_(data) {} | 40 : mapped_size_(mapped_size), data_(data) {} |
41 | 41 |
42 size_t mapped_size() const override { return mapped_size_; } | 42 size_t mapped_size() const override { return mapped_size_; } |
43 uint8_t* data() override { return data_; } | 43 uint8_t* data() const override { return data_; } |
44 const uint8_t* data() const override { return data_; } | 44 const uint8_t* const_data() const override { return data_; } |
45 | 45 |
46 private: | 46 private: |
47 const size_t mapped_size_; | 47 const size_t mapped_size_; |
48 uint8_t* const data_; | 48 uint8_t* const data_; |
49 }; | 49 }; |
50 | 50 |
51 class StubBufferHandleProvider | 51 class StubBufferHandleProvider |
52 : public VideoCaptureDevice::Client::Buffer::HandleProvider { | 52 : public VideoCaptureDevice::Client::Buffer::HandleProvider { |
53 public: | 53 public: |
54 StubBufferHandleProvider(size_t mapped_size, uint8_t* data) | 54 StubBufferHandleProvider(size_t mapped_size, uint8_t* data) |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 4u, | 610 4u, |
611 {PIXEL_FORMAT_I420, PIXEL_FORMAT_Y16, | 611 {PIXEL_FORMAT_I420, PIXEL_FORMAT_Y16, |
612 PIXEL_FORMAT_MJPEG, PIXEL_FORMAT_I420}}, | 612 PIXEL_FORMAT_MJPEG, PIXEL_FORMAT_I420}}, |
613 CommandLineTestData{"device-count=4,ownership=client", | 613 CommandLineTestData{"device-count=4,ownership=client", |
614 20, | 614 20, |
615 4u, | 615 4u, |
616 {PIXEL_FORMAT_I420, PIXEL_FORMAT_Y16, | 616 {PIXEL_FORMAT_I420, PIXEL_FORMAT_Y16, |
617 PIXEL_FORMAT_MJPEG, PIXEL_FORMAT_I420}}, | 617 PIXEL_FORMAT_MJPEG, PIXEL_FORMAT_I420}}, |
618 CommandLineTestData{"device-count=0", 20, 0u, {PIXEL_FORMAT_I420}})); | 618 CommandLineTestData{"device-count=0", 20, 0u, {PIXEL_FORMAT_I420}})); |
619 }; // namespace media | 619 }; // namespace media |
OLD | NEW |