| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // Unit test for VideoCaptureBufferPool. | 5 // Unit test for VideoCaptureBufferPool. |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" | 7 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 EXPECT_EQ(mapped_, true); | 51 EXPECT_EQ(mapped_, true); |
| 52 mapped_ = false; | 52 mapped_ = false; |
| 53 } | 53 } |
| 54 bool IsMapped() const override { return mapped_; } | 54 bool IsMapped() const override { return mapped_; } |
| 55 Format GetFormat() const override { return BGRA_8888; } | 55 Format GetFormat() const override { return BGRA_8888; } |
| 56 void GetStride(int* stride) const override { | 56 void GetStride(int* stride) const override { |
| 57 *stride = size_.width() * 4; | 57 *stride = size_.width() * 4; |
| 58 return; | 58 return; |
| 59 } | 59 } |
| 60 gfx::GpuMemoryBufferHandle GetHandle() const override { | 60 gfx::GpuMemoryBufferHandle GetHandle() const override { |
| 61 return gfx::GpuMemoryBufferHandle(); | 61 gfx::GpuMemoryBufferHandle handle; |
| 62 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 63 return handle; |
| 62 } | 64 } |
| 63 ClientBuffer AsClientBuffer() override { return nullptr; } | 65 ClientBuffer AsClientBuffer() override { return nullptr; } |
| 64 | 66 |
| 65 private: | 67 private: |
| 66 const gfx::Size size_; | 68 const gfx::Size size_; |
| 67 uint8* const data_; | 69 uint8* const data_; |
| 68 bool mapped_; | 70 bool mapped_; |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 #if !defined(OS_ANDROID) | 73 #if !defined(OS_ANDROID) |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (buffer4->data() != nullptr) | 304 if (buffer4->data() != nullptr) |
| 303 memset(buffer4->data(), 0x77, buffer4->size()); | 305 memset(buffer4->data(), 0x77, buffer4->size()); |
| 304 buffer4.reset(); | 306 buffer4.reset(); |
| 305 } | 307 } |
| 306 | 308 |
| 307 INSTANTIATE_TEST_CASE_P(, | 309 INSTANTIATE_TEST_CASE_P(, |
| 308 VideoCaptureBufferPoolTest, | 310 VideoCaptureBufferPoolTest, |
| 309 testing::ValuesIn(kCaptureFormats)); | 311 testing::ValuesIn(kCaptureFormats)); |
| 310 | 312 |
| 311 } // namespace content | 313 } // namespace content |
| OLD | NEW |