File: mirroring_service.mojom

package info (click to toggle)
chromium 139.0.7258.138-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,120,676 kB
  • sloc: cpp: 35,100,869; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (59 lines) | stat: -rw-r--r-- 2,680 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module mirroring.mojom;

import "components/mirroring/mojom/cast_message_channel.mojom";
import "components/mirroring/mojom/resource_provider.mojom";
import "components/mirroring/mojom/session_observer.mojom";
import "components/mirroring/mojom/session_parameters.mojom";
import "sandbox/policy/mojom/context.mojom";
import "sandbox/policy/mojom/sandbox.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "mojo/public/mojom/base/values.mojom";

// The `kMirroring` sandbox type is only defined on macOS, and enables access to
// the IOSurface system calls.
[EnableIf=is_mac]
const sandbox.mojom.Sandbox kMirroringSandbox =
    sandbox.mojom.Sandbox.kMirroring;

// On ChromeOS, we need a more permissive sandbox for hardware encoding video,
// including calls to ioctl and other system methods.
[EnableIf=is_chromeos_with_video_accelerators]
const sandbox.mojom.Sandbox kMirroringSandbox =
    sandbox.mojom.Sandbox.kHardwareVideoEncoding;

// On all other platforms, the standard, restrictive service sandbox seems to be
// permissive enough for our use case.
//
// NOTE: we don't support hardware encoding on Linux currently. If support is
// added, its sandbox will likely have to be updated to match ChromeOS.
[EnableIfNot=is_mac|is_chromeos_with_video_accelerators]
const sandbox.mojom.Sandbox kMirroringSandbox = sandbox.mojom.Sandbox.kService;

// This interface is used to control a Cast mirroring session.
[ServiceSandbox=kMirroringSandbox]
interface MirroringService {
  // Starts a mirroring session. |max_resolution| is the maximium video
  // capturing resolution. |observer| will get notifications about lifecycle
  // events. |outbound_channel| is to handle the cast messages from this service
  // to the mirroring receiver. |inbound_channel| receives the cast messages
  // from the mirroring receiver to this service.
  // To stop the session, just close the message pipe.
  [AllowedContext=sandbox.mojom.Context.kBrowser]
  Start(SessionParameters params,
        gfx.mojom.Size max_resolution,
        pending_remote<SessionObserver> observer,
        pending_remote<ResourceProvider> resource_provider,
        pending_remote<CastMessageChannel> outbound_channel,
        pending_receiver<CastMessageChannel> inbound_channel);

  // Switch the source tab of the current mirroring session.
  SwitchMirroringSourceTab();

  // Fetches the current RTCP stats of the current mirroring session.
  // The stats are returned as base::Value::Dict.
  GetMirroringStats() => (mojo_base.mojom.Value json_stats);
};