Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Side by Side Diff: content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc

Issue 1106563002: FakeVideoCaptureDevice: add support for capturing into Dma-Bufs using VGEM in CrOs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ermircan@ comments; removed GpuMemoryBuffer modifications (go in other CL) Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 EXPECT_EQ(mapped_, true); 52 EXPECT_EQ(mapped_, true);
53 mapped_ = false; 53 mapped_ = false;
54 } 54 }
55 bool IsMapped() const override { return mapped_; } 55 bool IsMapped() const override { return mapped_; }
56 Format GetFormat() const override { return BGRA_8888; } 56 Format GetFormat() const override { return BGRA_8888; }
57 void GetStride(int* stride) const override { 57 void GetStride(int* stride) const override {
58 *stride = size_.width() * 4; 58 *stride = size_.width() * 4;
59 return; 59 return;
60 } 60 }
61 gfx::GpuMemoryBufferHandle GetHandle() const override { 61 gfx::GpuMemoryBufferHandle GetHandle() const override {
62 return gfx::GpuMemoryBufferHandle(); 62 gfx::GpuMemoryBufferHandle handle;
63 handle.type = gfx::SHARED_MEMORY_BUFFER;
64 return handle;
63 } 65 }
64 ClientBuffer AsClientBuffer() override { return nullptr; } 66 ClientBuffer AsClientBuffer() override { return nullptr; }
65 67
66 private: 68 private:
67 const gfx::Size size_; 69 const gfx::Size size_;
68 uint8* const data_; 70 uint8* const data_;
69 bool mapped_; 71 bool mapped_;
70 }; 72 };
71 73
72 #if !defined(OS_ANDROID) 74 #if !defined(OS_ANDROID)
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 if (buffer4->data() != nullptr) 306 if (buffer4->data() != nullptr)
305 memset(buffer4->data(), 0x77, buffer4->size()); 307 memset(buffer4->data(), 0x77, buffer4->size());
306 buffer4.reset(); 308 buffer4.reset();
307 } 309 }
308 310
309 INSTANTIATE_TEST_CASE_P(, 311 INSTANTIATE_TEST_CASE_P(,
310 VideoCaptureBufferPoolTest, 312 VideoCaptureBufferPoolTest,
311 testing::ValuesIn(kCaptureFormats)); 313 testing::ValuesIn(kCaptureFormats));
312 314
313 } // namespace content 315 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698