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

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: mcasas comments 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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; } 50 ClientBuffer AsClientBuffer(int plane) override { return nullptr; }
51 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS)) 51 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS))
52 base::FileDescriptor AsPlatformFile() override { 52 base::FileDescriptor AsPlatformFile() override {
53 return base::FileDescriptor(); 53 return base::FileDescriptor();
54 } 54 }
55 #endif 55 #endif
56 bool IsBackedByVideoFrame() const override { return false; };
57 scoped_refptr<VideoFrame> GetVideoFrame() override { return nullptr; }
56 58
57 private: 59 private:
58 const int id_; 60 const int id_;
59 const size_t mapped_size_; 61 const size_t mapped_size_;
60 uint8_t* const data_; 62 uint8_t* const data_;
61 }; 63 };
62 64
63 class MockClient : public VideoCaptureDevice::Client { 65 class MockClient : public VideoCaptureDevice::Client {
64 public: 66 public:
65 MOCK_METHOD2(OnError, 67 MOCK_METHOD2(OnError,
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 } 432 }
431 } 433 }
432 434
433 INSTANTIATE_TEST_CASE_P(, 435 INSTANTIATE_TEST_CASE_P(,
434 FakeVideoCaptureDeviceCommandLineTest, 436 FakeVideoCaptureDeviceCommandLineTest,
435 Values(CommandLineTestData{"fps=-1", 5}, 437 Values(CommandLineTestData{"fps=-1", 5},
436 CommandLineTestData{"fps=29.97", 29.97f}, 438 CommandLineTestData{"fps=29.97", 29.97f},
437 CommandLineTestData{"fps=60", 60}, 439 CommandLineTestData{"fps=60", 60},
438 CommandLineTestData{"fps=1000", 60})); 440 CommandLineTestData{"fps=1000", 60}));
439 }; // namespace media 441 }; // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698