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

Unified Diff: media/video/capture/video_capture_device_factory.cc

Issue 265263004: Mac Video Capture Device: split VCD into VCD and Factory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: perkj@ suggestion: Factory method in VCDFactory. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: media/video/capture/video_capture_device_factory.cc
diff --git a/media/video/capture/video_capture_device_factory.cc b/media/video/capture/video_capture_device_factory.cc
index e63225dc178c9ea375bd62f965ccea9440b73f4f..c2417bcc413f07702e47d7843fc5f76b1910241f 100644
--- a/media/video/capture/video_capture_device_factory.cc
+++ b/media/video/capture/video_capture_device_factory.cc
@@ -4,30 +4,57 @@
#include "media/video/capture/video_capture_device_factory.h"
perkj_chrome 2014/05/06 06:44:46 #if defined(OS_MACOSX) #include ....
mcasas 2014/05/06 07:26:30 Done.
+#include "media/video/capture/mac/video_capture_device_factory_mac.h"
+
namespace media {
+// static
+scoped_ptr<VideoCaptureDeviceFactory> VideoCaptureDeviceFactory::Create() {
+#if defined(OS_MACOSX)
+ return scoped_ptr<VideoCaptureDeviceFactory>(new
+ VideoCaptureDeviceFactoryMac());
+#else
+ return scoped_ptr<VideoCaptureDeviceFactory>(new VideoCaptureDeviceFactory());
+#endif
perkj_chrome 2014/05/06 06:44:46 Why not create the fake ones here too?
mcasas 2014/05/06 07:26:30 Done.
+}
+
VideoCaptureDeviceFactory::VideoCaptureDeviceFactory() {
thread_checker_.DetachFromThread();
-};
+}
+
+VideoCaptureDeviceFactory::~VideoCaptureDeviceFactory() {}
scoped_ptr<VideoCaptureDevice> VideoCaptureDeviceFactory::Create(
const VideoCaptureDevice::Name& device_name) {
DCHECK(thread_checker_.CalledOnValidThread());
+// TODO(mcasas): Remove the #if parts when all platforms have splitted the
+// VideoCaptureDevice into VideoCaptureDevice and VideoCaptureDeviceFactory.
+// Remove as well the call to the VideoCaptureDevice static method.
perkj_chrome 2014/05/06 06:44:46 no need for this since you override VideoCaptureDe
mcasas 2014/05/06 07:26:30 I completely agree but the linker gives a missing
+#if !defined(OS_MACOSX)
return scoped_ptr<VideoCaptureDevice>(
VideoCaptureDevice::Create(device_name));
+#else
+ return scoped_ptr<VideoCaptureDevice>();
+#endif
}
void VideoCaptureDeviceFactory::GetDeviceNames(
VideoCaptureDevice::Names* device_names) {
DCHECK(thread_checker_.CalledOnValidThread());
+// See TODO in Create().
+#if !defined(OS_MACOSX)
perkj_chrome 2014/05/06 06:44:46 dito
mcasas 2014/05/06 07:26:30 See before.
VideoCaptureDevice::GetDeviceNames(device_names);
+#endif
}
void VideoCaptureDeviceFactory::GetDeviceSupportedFormats(
const VideoCaptureDevice::Name& device,
VideoCaptureFormats* supported_formats) {
DCHECK(thread_checker_.CalledOnValidThread());
+// See TODO in Create().
+#if !defined(OS_MACOSX)
perkj_chrome 2014/05/06 06:44:46 dito
mcasas 2014/05/06 07:26:30 See before.
VideoCaptureDevice::GetDeviceSupportedFormats(device, supported_formats);
+#endif
}
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698