blob: 4ec2285ddb0ca1a4e75f465770a90eb03c9a0a92 [file]
// 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;
[EnableIf=is_chromeos]
import "components/chromeos_camera/common/mjpeg_decode_accelerator.mojom";
import "services/video_capture/public/mojom/device_factory.mojom";
import "services/video_capture/public/mojom/video_source_provider.mojom";
[EnableIf=is_chromeos]
interface AcceleratorFactory {
// Creates a new JpegDecodeAccelerator and binds it to |jda|.
CreateJpegDecodeAccelerator(
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.
// TODO(chfremer): Consider renaming this to VideoCaptureService.
interface DeviceFactoryProvider {
[EnableIf=is_chromeos]
InjectGpuDependencies(AcceleratorFactory accelerator_factory);
// Legacy API. Supports one client per device.
ConnectToDeviceFactory(DeviceFactory& request);
// Current API. Supports multiple clients per source.
ConnectToVideoSourceProvider(VideoSourceProvider& request);
// Lets the service to close all connections and ask the service_manager to be
// shut down.
ShutdownServiceAsap();
// Sets a retry count that is used by the service for logging UMA events in
// the context of investigation for https://crbug.com/643068.
SetRetryCount(int32 count);
};