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

Side by Side Diff: media/video/capture/fake_video_capture_device.h

Issue 24079003: Add VideoCaptureDevice::GetDeviceSupportedFormats to interface + implementation for Linux and Fake (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: perkj@'s nits Created 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Implementation of a fake VideoCaptureDevice class. Used for testing other 5 // Implementation of a fake VideoCaptureDevice class. Used for testing other
6 // video capture classes when no real hardware is available. 6 // video capture classes when no real hardware is available.
7 7
8 #ifndef MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ 8 #ifndef MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
9 #define MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ 9 #define MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "media/video/capture/video_capture_device.h" 15 #include "media/video/capture/video_capture_device.h"
16 16
17 namespace media { 17 namespace media {
18 18
19 class MEDIA_EXPORT FakeVideoCaptureDevice : public VideoCaptureDevice { 19 class MEDIA_EXPORT FakeVideoCaptureDevice : public VideoCaptureDevice {
20 public: 20 public:
21 static VideoCaptureDevice* Create(const Name& device_name); 21 static VideoCaptureDevice* Create(const Name& device_name);
22 virtual ~FakeVideoCaptureDevice(); 22 virtual ~FakeVideoCaptureDevice();
23 // Used for testing. This will make sure the next call to Create will 23 // Used for testing. This will make sure the next call to Create will
24 // return NULL; 24 // return NULL;
25 static void SetFailNextCreate(); 25 static void SetFailNextCreate();
26 26
27 static void GetDeviceNames(Names* device_names); 27 static void GetDeviceNames(Names* device_names);
28 static void GetDeviceSupportedFormats(const Name& device,
29 VideoCaptureCapabilities* formats);
28 30
29 // VideoCaptureDevice implementation. 31 // VideoCaptureDevice implementation.
30 virtual void AllocateAndStart( 32 virtual void AllocateAndStart(
31 const VideoCaptureCapability& capture_format, 33 const VideoCaptureCapability& capture_format,
32 scoped_ptr<VideoCaptureDevice::Client> client) OVERRIDE; 34 scoped_ptr<VideoCaptureDevice::Client> client) OVERRIDE;
33 virtual void StopAndDeAllocate() OVERRIDE; 35 virtual void StopAndDeAllocate() OVERRIDE;
34 36
35 private: 37 private:
36 // Flag indicating the internal state. 38 // Flag indicating the internal state.
37 enum InternalState { 39 enum InternalState {
(...skipping 24 matching lines...) Expand all
62 int capabilities_roster_index_; 64 int capabilities_roster_index_;
63 65
64 static bool fail_next_create_; 66 static bool fail_next_create_;
65 67
66 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice); 68 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice);
67 }; 69 };
68 70
69 } // namespace media 71 } // namespace media
70 72
71 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ 73 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW
« no previous file with comments | « media/video/capture/android/video_capture_device_android.cc ('k') | media/video/capture/fake_video_capture_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698