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

Unified Diff: services/video_capture/video_capture_service.cc

Issue 2378943002: Let clients interact with VideoCaptureDeviceClient instead of VideoCaptureDevice (Closed)
Patch Set: Remove method AsClientBuffer() Created 4 years, 2 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 | « services/video_capture/video_capture_device_proxy_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/video_capture/video_capture_service.cc
diff --git a/services/video_capture/video_capture_service.cc b/services/video_capture/video_capture_service.cc
index 0633a01be4c7bfd3dd44659ac68aa47eb4116cc0..b38914daea6d03b4d3d9b61c80eaf0eb3b1494f8 100644
--- a/services/video_capture/video_capture_service.cc
+++ b/services/video_capture/video_capture_service.cc
@@ -5,6 +5,7 @@
#include "services/video_capture/video_capture_service.h"
#include "media/capture/video/fake_video_capture_device.h"
+#include "media/capture/video/video_capture_jpeg_decoder.h"
#include "services/video_capture/video_capture_device_factory_impl.h"
namespace {
@@ -12,8 +13,15 @@ static const char kFakeDeviceDisplayName[] = "Fake Video Capture Device";
static const char kFakeDeviceId[] = "FakeDeviceId";
static const char kFakeModelId[] = "FakeModelId";
static const float kFakeCaptureDefaultFrameRate = 20.0f;
+
+// TODO(chfremer): Replace with an actual decoder factory.
+// https://crbug.com/584797
+std::unique_ptr<media::VideoCaptureJpegDecoder> CreateJpegDecoder() {
+ return nullptr;
}
+} // anonymous namespace
+
namespace video_capture {
VideoCaptureService::VideoCaptureService() = default;
@@ -55,6 +63,7 @@ void VideoCaptureService::AddDeviceToMockFactory(
mojom::MockVideoCaptureDevicePtr device,
mojom::VideoCaptureDeviceDescriptorPtr descriptor,
const AddDeviceToMockFactoryCallback& callback) {
+ LazyInitializeMockDeviceFactory();
mock_device_factory_->AddMockDevice(std::move(device), std::move(descriptor));
callback.Run();
}
@@ -62,13 +71,15 @@ void VideoCaptureService::AddDeviceToMockFactory(
void VideoCaptureService::LazyInitializeDeviceFactory() {
if (device_factory_)
return;
- device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>();
+ device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(
+ base::Bind(CreateJpegDecoder));
}
void VideoCaptureService::LazyInitializeFakeDeviceFactory() {
if (fake_device_factory_)
return;
- fake_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>();
+ fake_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(
+ base::Bind(CreateJpegDecoder));
auto fake_device_descriptor = mojom::VideoCaptureDeviceDescriptor::New();
fake_device_descriptor->display_name = kFakeDeviceDisplayName;
fake_device_descriptor->device_id = kFakeDeviceId;
@@ -86,7 +97,8 @@ void VideoCaptureService::LazyInitializeFakeDeviceFactory() {
void VideoCaptureService::LazyInitializeMockDeviceFactory() {
if (mock_device_factory_)
return;
- mock_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>();
+ mock_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(
+ base::Bind(CreateJpegDecoder));
}
} // namespace video_capture
« no previous file with comments | « services/video_capture/video_capture_device_proxy_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698