blob: 5b4cc56f012cf5a068dcd0c20d4df5c8e5d2d243 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module video_capture.mojom;
import "components/chromeos_camera/common/mjpeg_decode_accelerator.mojom";
import "services/video_capture/public/mojom/device_factory.mojom";
import "services/video_capture/public/mojom/testing_controls.mojom";
import "services/video_capture/public/mojom/video_source_provider.mojom";
import "media/capture/video/chromeos/mojom/cros_image_capture.mojom";
interface AcceleratorFactory {
// Creates a new JpegDecodeAccelerator and binds it to |jda|.
chromeos_camera.mojom.MjpegDecodeAccelerator& jda);
// Entry point to the Video Capture Service API.
// The factory provides access to the capture devices connected to the system.
// By using command-line switches, it is possible to replace this with a "fake"
// factory, which provides access to fake devices that generates test frames.
// The video capture supports gpu accelerated decoding of MJPEG frames
// delivered by camera devices, but to do it requires InjectGpuDependencies()
// to be called once before any call to ConnectToDeviceFactory() is made.
// Calling InjectGpuDependencies() is optional. If it is not called, MJPEG
// decoding will be performed without gpu acceleration.
interface VideoCaptureService {
InjectGpuDependencies(AcceleratorFactory accelerator_factory);
// Binds a Chrome OS camera capture interface.
BindCrosImageCapture(pending_receiver<cros.mojom.CrosImageCapture> receiver);
// Legacy API. Supports one client per device.
ConnectToDeviceFactory(DeviceFactory& request);
// Current API. Supports multiple clients per source.
ConnectToVideoSourceProvider(VideoSourceProvider& request);
// Sets a retry count that is used by the service for logging UMA events in
// the context of investigation for
SetRetryCount(int32 count);
// Binds a test-only interface for use by unit tests.
BindControlsForTesting(pending_receiver<TestingControls> receiver);