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

Unified Diff: talk/app/webrtc/objc/RTCVideoCapturer.mm

Issue 1715883002: Remove DeviceManager and DeviceInfo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 9 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 | « talk/app/webrtc/legacy_objc_api.gyp ('k') | webrtc/api/api.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/objc/RTCVideoCapturer.mm
diff --git a/talk/app/webrtc/objc/RTCVideoCapturer.mm b/talk/app/webrtc/objc/RTCVideoCapturer.mm
index 50e1cef4a0044f002fcca7ee1a636451e8d56652..9dbc201a677cd0ebd3ad7112bf47be9d8b9f2078 100644
--- a/talk/app/webrtc/objc/RTCVideoCapturer.mm
+++ b/talk/app/webrtc/objc/RTCVideoCapturer.mm
@@ -34,25 +34,16 @@
#include <memory>
#include "webrtc/media/base/videocapturer.h"
-#include "webrtc/media/devices/devicemanager.h"
+#include "webrtc/media/engine/webrtcvideocapturerfactory.h"
@implementation RTCVideoCapturer {
std::unique_ptr<cricket::VideoCapturer> _capturer;
}
+ (RTCVideoCapturer*)capturerWithDeviceName:(NSString*)deviceName {
- const std::string& device_name = std::string([deviceName UTF8String]);
- std::unique_ptr<cricket::DeviceManagerInterface> device_manager(
- cricket::DeviceManagerFactory::Create());
- bool initialized = device_manager->Init();
- NSAssert(initialized, @"DeviceManager::Init() failed");
- cricket::Device device;
- if (!device_manager->GetVideoCaptureDevice(device_name, &device)) {
- LOG(LS_ERROR) << "GetVideoCaptureDevice failed";
- return 0;
- }
- std::unique_ptr<cricket::VideoCapturer> capturer(
- device_manager->CreateVideoCapturer(device));
+ cricket::WebRtcVideoDeviceCapturerFactory factory;
+ cricket::Device device(std::string(deviceName.UTF8String), 0);
+ rtc::scoped_ptr<cricket::VideoCapturer> capturer(factory.Create(device));
RTCVideoCapturer* rtcCapturer =
[[RTCVideoCapturer alloc] initWithCapturer:capturer.release()];
return rtcCapturer;
« no previous file with comments | « talk/app/webrtc/legacy_objc_api.gyp ('k') | webrtc/api/api.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698