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

Side by Side Diff: media/capture/video/fake_video_capture_device_unittest.cc

Issue 2378943002: Let clients interact with VideoCaptureDeviceClient instead of VideoCaptureDevice (Closed)
Patch Set: Remove method AsClientBuffer() Created 4 years, 2 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 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 29 matching lines...) Expand all
40 MockBuffer(int buffer_id, size_t mapped_size) 40 MockBuffer(int buffer_id, size_t mapped_size)
41 : id_(buffer_id), 41 : id_(buffer_id),
42 mapped_size_(mapped_size), 42 mapped_size_(mapped_size),
43 data_(new uint8_t[mapped_size]) {} 43 data_(new uint8_t[mapped_size]) {}
44 ~MockBuffer() override { delete[] data_; } 44 ~MockBuffer() override { delete[] data_; }
45 45
46 int id() const override { return id_; } 46 int id() const override { return id_; }
47 gfx::Size dimensions() const override { return gfx::Size(); } 47 gfx::Size dimensions() const override { return gfx::Size(); }
48 size_t mapped_size() const override { return mapped_size_; } 48 size_t mapped_size() const override { return mapped_size_; }
49 void* data(int plane) override { return data_; } 49 void* data(int plane) override { return data_; }
50 ClientBuffer AsClientBuffer(int plane) override { return nullptr; }
51 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS)) 50 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS))
52 base::FileDescriptor AsPlatformFile() override { 51 base::FileDescriptor AsPlatformFile() override {
53 return base::FileDescriptor(); 52 return base::FileDescriptor();
54 } 53 }
55 #endif 54 #endif
55 bool IsBackedByVideoFrame() const override { return false; };
56 scoped_refptr<VideoFrame> GetVideoFrame() override { return nullptr; }
56 57
57 private: 58 private:
58 const int id_; 59 const int id_;
59 const size_t mapped_size_; 60 const size_t mapped_size_;
60 uint8_t* const data_; 61 uint8_t* const data_;
61 }; 62 };
62 63
63 class MockClient : public VideoCaptureDevice::Client { 64 class MockClient : public VideoCaptureDevice::Client {
64 public: 65 public:
65 MOCK_METHOD2(OnError, 66 MOCK_METHOD2(OnError,
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 } 441 }
441 } 442 }
442 443
443 INSTANTIATE_TEST_CASE_P(, 444 INSTANTIATE_TEST_CASE_P(,
444 FakeVideoCaptureDeviceCommandLineTest, 445 FakeVideoCaptureDeviceCommandLineTest,
445 Values(CommandLineTestData{"fps=-1", 5}, 446 Values(CommandLineTestData{"fps=-1", 5},
446 CommandLineTestData{"fps=29.97", 29.97f}, 447 CommandLineTestData{"fps=29.97", 29.97f},
447 CommandLineTestData{"fps=60", 60}, 448 CommandLineTestData{"fps=60", 60},
448 CommandLineTestData{"fps=1000", 60})); 449 CommandLineTestData{"fps=1000", 60}));
449 }; // namespace media 450 }; // namespace media
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/shared_memory_buffer_handle.cc ('k') | media/capture/video/video_capture_buffer_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698