blob: 3484bdea2cb2d8d28538cdf9961effe3cb3d4f01 [file] [log] [blame]
// Copyright 2019 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 cros.mojom;
import "media/capture/mojom/image_capture.mojom";
import "media/capture/video/chromeos/mojom/camera_common.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "ui/gfx/range/mojom/range.mojom";
// Effect that recognized by Chrome OS.
enum Effect {
NO_EFFECT = 0,
PORTRAIT_MODE = 1,
};
// Status code for getting camera app device.
enum GetCameraAppDeviceStatus {
SUCCESS = 0,
ERROR_NON_V3 = 1,
ERROR_INVALID_ID = 2,
};
// Interface to let Chrome Camera App (Remote) get specific CameraAppDevice from
// Chrome (Receiver).
interface CameraAppDeviceProvider {
// Gets the interface to communicate with specific camera device given by
// |source_id|. If the |status| is not success, the |device| would be
// null.
GetCameraAppDevice(string source_id)
=> (GetCameraAppDeviceStatus status,
pending_remote<CameraAppDevice> device);
};
// Interface for communication between Chrome Camera App (Remote) and Chrome
// (Receiver).
interface CameraAppHelper {
// Invoked when the Android intent from ARC++ is fulfilled or is failed.
// For the intent which expects to have result, it is fulfilled when the
// captured is done and is failed if the session ends without finishing the
// capture. For the intent which don't expect any result, it is fulfilled when
// the camera app is successfully launched and is failed when the camera fails
// to launch. |intent_id| should be the same id that was specified in the
// query when launching the camera app. |is_success| indicates the result
// status of the intent. The |captured_data| will be delivered to the handler
// as a byte array.
OnIntentHandled(uint32 intent_id, bool is_success,
array<uint8> captured_data);
};
// Inner interface that used to communicate between browser process (Remote) and
// the Video Capture service (Receiver).
interface CameraAppDeviceBridge {
// Gets the interface to communicate with corresponding camera device given by
// |device_id|. Note that it only succeeds when running on Camera HAL v3
// stack. The |status| contains the result and the |device| interface
// is passed when it succeeds. Otherwise, the |device| would be null.
GetCameraAppDevice(string device_id)
=> (GetCameraAppDeviceStatus status,
pending_remote<CameraAppDevice> device);
};
// Interface for communication between Chrome Camera App (Remote) and camera
// device (Receiver).
interface CameraAppDevice {
// Gets camera information |camera_info| which includes camera facing,
// characteristics, orientation, etc.
GetCameraInfo() => (CameraInfo camera_info);
// Sets reprocess option to bind with the coming take photo request. When this
// method is called, the reprocess option will be queued. All reprocess
// options in the queue will be consumed when ImageCapture::TakePhoto() is
// triggered and all the queued reprocess options will be bound
// to that take photo request.
SetReprocessOption(Effect effect)
=> (int32 status, media.mojom.Blob? blob);
// Sets the fps range for upcoming configured camera stream.
// The caller sets the |fps_range| for target |resolution|.
// If the given fps range is valid and set successfully, |is_success| returns
// true. If the given fps range is invalid, the fps range which is cached
// previously will be cleared and |is_success| will return false.
SetFpsRange(gfx.mojom.Size resolution, gfx.mojom.Range fps_range)
=> (bool is_success);
};