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

Unified Diff: webrtc/media/devices/devicemanager.cc

Issue 1676503002: Remove fake cricket::VideoCapturer devices. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « webrtc/media/devices/devicemanager.h ('k') | webrtc/media/devices/devicemanager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/devices/devicemanager.cc
diff --git a/webrtc/media/devices/devicemanager.cc b/webrtc/media/devices/devicemanager.cc
index a3f34fd02fae68bf71902b2b86ae6e85a162cd02..cbae2b2e643facbf53ad1f5c489963c4c27d1cd9 100644
--- a/webrtc/media/devices/devicemanager.cc
+++ b/webrtc/media/devices/devicemanager.cc
@@ -35,10 +35,9 @@
#include "webrtc/base/windowpicker.h"
#include "webrtc/base/windowpickerfactory.h"
#include "webrtc/media/base/mediacommon.h"
+#include "webrtc/media/base/videocapturer.h"
#include "webrtc/media/base/videocapturerfactory.h"
#include "webrtc/media/devices/deviceinfo.h"
-#include "webrtc/media/devices/filevideocapturer.h"
-#include "webrtc/media/devices/yuvframescapturer.h"
#ifdef HAVE_WEBRTC_VIDEO
#include "webrtc/media/webrtc/webrtcvideocapturerfactory.h"
@@ -154,27 +153,6 @@ bool DeviceManager::GetVideoCaptureDevice(const std::string& name,
}
}
- // If |name| is a valid name for a file or yuvframedevice,
- // return a fake video capturer device.
- if (GetFakeVideoCaptureDevice(name, out)) {
- return true;
- }
-
- return false;
-}
-
-bool DeviceManager::GetFakeVideoCaptureDevice(const std::string& name,
- Device* out) const {
- if (rtc::Filesystem::IsFile(name)) {
- *out = FileVideoCapturer::CreateFileVideoCapturerDevice(name);
- return true;
- }
-
- if (name == YuvFramesCapturer::kYuvFrameDeviceName) {
- *out = YuvFramesCapturer::CreateYuvFramesCapturerDevice();
- return true;
- }
-
return false;
}
@@ -190,16 +168,12 @@ void DeviceManager::ClearVideoCaptureDeviceMaxFormat(
}
VideoCapturer* DeviceManager::CreateVideoCapturer(const Device& device) const {
- VideoCapturer* capturer = MaybeConstructFakeVideoCapturer(device);
- if (capturer) {
- return capturer;
- }
-
if (!video_device_capturer_factory_) {
LOG(LS_ERROR) << "No video capturer factory for devices.";
return NULL;
}
- capturer = video_device_capturer_factory_->Create(device);
+ cricket::VideoCapturer* capturer =
+ video_device_capturer_factory_->Create(device);
if (!capturer) {
return NULL;
}
@@ -213,29 +187,6 @@ VideoCapturer* DeviceManager::CreateVideoCapturer(const Device& device) const {
return capturer;
}
-VideoCapturer* DeviceManager::MaybeConstructFakeVideoCapturer(
- const Device& device) const {
- // TODO(hellner): Throw out the creation of a file video capturer once the
- // refactoring is completed.
- if (FileVideoCapturer::IsFileVideoCapturerDevice(device)) {
- FileVideoCapturer* capturer = new FileVideoCapturer;
- if (!capturer->Init(device)) {
- delete capturer;
- return NULL;
- }
- LOG(LS_INFO) << "Created file video capturer " << device.name;
- capturer->set_repeat(FileVideoCapturer::kForever);
- return capturer;
- }
-
- if (YuvFramesCapturer::IsYuvFramesCapturerDevice(device)) {
- YuvFramesCapturer* capturer = new YuvFramesCapturer();
- capturer->Init();
- return capturer;
- }
- return NULL;
-}
-
bool DeviceManager::GetWindows(
std::vector<rtc::WindowDescription>* descriptions) {
if (!window_picker_) {
« no previous file with comments | « webrtc/media/devices/devicemanager.h ('k') | webrtc/media/devices/devicemanager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698