summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwjia@google.com <wjia@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-19 21:33:21 +0000
committerwjia@google.com <wjia@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-19 21:33:21 +0000
commitc71b022f792a3b8b6cf4ef58667870f32fd208de (patch)
treea1feadd60d8f271322fd95b3b95868206985e540
parentf4ffb7a7159a9cc23ca8c634d764865ed208a5f2 (diff)
downloadchromium_src-c71b022f792a3b8b6cf4ef58667870f32fd208de.zip
chromium_src-c71b022f792a3b8b6cf4ef58667870f32fd208de.tar.gz
chromium_src-c71b022f792a3b8b6cf4ef58667870f32fd208de.tar.bz2
Adding VideoCaptureDevice dummy implementation for platforms without real implementations.
The dummy implementation of VideoCaptureDevice will be used on platforms without real VideoCaptureDevice implementations, i.e. Win and Mac, to be able to link. This will make it possible for us to continue working on the platform independent code for video capturing in parallel to adding video capture support for Windows and Mac. The dummy implementation of VideoCaptureDevice will be removed when real implementations exist for all platforms. patch by mflodman@google.com BUG=none TEST=trybots Review URL: http://codereview.chromium.org/7031010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85975 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--media/media.gyp8
-rw-r--r--media/video/capture/video_capture_device_dummy.cc29
-rw-r--r--media/video/capture/video_capture_device_dummy.h36
3 files changed, 73 insertions, 0 deletions
diff --git a/media/media.gyp b/media/media.gyp
index 101ce96..c61e8c2 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -181,6 +181,8 @@
'video/capture/linux/video_capture_device_linux.h',
'video/capture/video_capture.h',
'video/capture/video_capture_device.h',
+ 'video/capture/video_capture_device_dummy.cc',
+ 'video/capture/video_capture_device_dummy.h',
'video/capture/video_capture_types.h',
'video/ffmpeg_video_allocator.cc',
'video/ffmpeg_video_allocator.h',
@@ -235,6 +237,12 @@
'omx_wrapper',
]
}],
+ ['OS=="linux"', {
+ 'sources!': [
+ 'video/capture/video_capture_device_dummy.cc',
+ 'video/capture/video_capture_device_dummy.h',
+ ],
+ }],
['OS=="mac"', {
'link_settings': {
'libraries': [
diff --git a/media/video/capture/video_capture_device_dummy.cc b/media/video/capture/video_capture_device_dummy.cc
new file mode 100644
index 0000000..8d0355d
--- /dev/null
+++ b/media/video/capture/video_capture_device_dummy.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/video/capture/video_capture_device_dummy.h"
+
+namespace media {
+
+VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) {
+ return NULL;
+}
+
+void VideoCaptureDevice::GetDeviceNames(Names* device_names) {}
+
+VideoCaptureDeviceDummy::VideoCaptureDeviceDummy() {}
+
+VideoCaptureDeviceDummy::~VideoCaptureDeviceDummy() {}
+
+void VideoCaptureDeviceDummy::Allocate(
+ int width, int height, int frame_rate,
+ VideoCaptureDevice::EventHandler* observer) {}
+
+void VideoCaptureDeviceDummy::Start() {}
+
+void VideoCaptureDeviceDummy::Stop() {}
+
+void VideoCaptureDeviceDummy::DeAllocate() {}
+
+} // namespace media
diff --git a/media/video/capture/video_capture_device_dummy.h b/media/video/capture/video_capture_device_dummy.h
new file mode 100644
index 0000000..b009fc9
--- /dev/null
+++ b/media/video/capture/video_capture_device_dummy.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// A dummy implementation of VideoCaptureDevice to use for platforms without
+// real video capture support. The class will be removed once the other
+// platforms have real video capture device support.
+//
+// TODO(mflodman) Remove when video_capture_device_mac and
+// video_capture_device_win are available.
+
+#ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_DUMMY_H_
+#define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_DUMMY_H_
+
+#include "media/video/capture/video_capture_device.h"
+
+namespace media {
+
+class VideoCaptureDeviceDummy : public VideoCaptureDevice {
+ public:
+ virtual void Allocate(int width, int height, int frame_rate,
+ VideoCaptureDevice::EventHandler* observer);
+ virtual void Start();
+ virtual void Stop();
+ virtual void DeAllocate();
+
+ private:
+ VideoCaptureDeviceDummy();
+ virtual ~VideoCaptureDeviceDummy();
+
+ DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceDummy);
+};
+
+} // namespace media
+
+#endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_DUMMY_H_