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

Unified Diff: services/video_capture/service_impl.cc

Issue 2818513003: [Mojo Video Capture] Adapt video_capture service to refactored video capture stack (Closed)
Patch Set: Fix compile errors Created 3 years, 8 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: services/video_capture/service_impl.cc
diff --git a/services/video_capture/service_impl.cc b/services/video_capture/service_impl.cc
index bd3d05017daf7284a88fa24e79f4bd23b9ae6352..cb1b98d9578e46bc5bbf4a423bca9f6b24b71a80 100644
--- a/services/video_capture/service_impl.cc
+++ b/services/video_capture/service_impl.cc
@@ -10,6 +10,7 @@
#include "media/capture/video/video_capture_buffer_pool.h"
#include "media/capture/video/video_capture_buffer_tracker.h"
#include "media/capture/video/video_capture_jpeg_decoder.h"
+#include "media/capture/video/video_capture_system_impl.h"
#include "services/service_manager/public/cpp/service_info.h"
#include "services/video_capture/device_factory_media_to_mojo_adapter.h"
@@ -65,18 +66,23 @@ void ServiceImpl::LazyInitializeDeviceFactory() {
std::unique_ptr<media::VideoCaptureDeviceFactory> media_device_factory =
media::VideoCaptureDeviceFactory::CreateFactory(
base::MessageLoop::current()->task_runner());
+ auto video_capture_system = base::MakeUnique<media::VideoCaptureSystemImpl>(
+ std::move(media_device_factory));
device_factory_ = base::MakeUnique<DeviceFactoryMediaToMojoAdapter>(
- std::move(media_device_factory), base::Bind(CreateJpegDecoder));
+ std::move(video_capture_system), base::Bind(CreateJpegDecoder));
}
void ServiceImpl::LazyInitializeFakeDeviceFactory() {
if (fake_device_factory_)
return;
+ auto factory = base::MakeUnique<media::FakeVideoCaptureDeviceFactory>();
+ auto video_capture_system =
+ base::MakeUnique<media::VideoCaptureSystemImpl>(std::move(factory));
+
fake_device_factory_ = base::MakeUnique<DeviceFactoryMediaToMojoAdapter>(
- base::MakeUnique<media::FakeVideoCaptureDeviceFactory>(),
- base::Bind(&CreateJpegDecoder));
+ std::move(video_capture_system), base::Bind(&CreateJpegDecoder));
}
} // namespace video_capture

Powered by Google App Engine
This is Rietveld 408576698