File: browser_cdm_factory.mojom

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (86 lines) | stat: -rw-r--r-- 4,594 bytes parent folder | download | duplicates (7)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This defines the mojo interface used between the Chrome browser and Chrome
// GPU process, as well as between the ash-chrome browser and lacros-chrome
// browser process for creating a CDM factory that will utilizes native HW
// backed DRM protection for ChromeOS.

// Next MinVersion: 4

module chromeos.cdm.mojom;

import "chromeos/components/cdm_factory_daemon/mojom/cdm_factory_daemon.mojom";
import "chromeos/components/cdm_factory_daemon/mojom/content_decryption_module.mojom";
import "chromeos/components/cdm_factory_daemon/mojom/output_protection.mojom";
import "sandbox/policy/mojom/sandbox.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";

// Next Method ID: 7
// Used for the connection between browser (receiver) and GPU (remote) process;
// or between the ash (receiver) and lacros (remote) browser processes; or
// between the GPU (receiver) and OOP video decoder (remote) processes as a
// proxy back to the browser.
// TODO(jkardatzke): Replace all of the calls that proxy to the CdmFactoryDaemon
// interface with another Mojo interface that we acquire directly from the
// CdmFactoryDaemon to avoid having all these proxied calls.
[Stable, Uuid="7b6bba3b-5ff8-42c7-a802-40a848945b16",
 ServiceSandbox=sandbox.mojom.Sandbox.kGpu]
interface BrowserCdmFactory {
  // Used to create CdmFactory interfaces which are then used to create a CDM
  // interface. |key_system| should specify what key system we are using,
  // currently only com.widevine.alpha is supported. Returns null if we can't
  // get the interface from the daemon.
  // NOTE: This will proxy to the CdmFactoryDaemon interface which is
  // implemented by the cdm-oemcrypto daemon in ChromeOS.
  CreateFactory@0(string key_system) => (pending_remote<CdmFactory>? factory);

  // Creates a new OutputProtection interface to be used for passing into the
  // CreateCdm call in CdmFactory.
  GetOutputProtection@1(pending_receiver<OutputProtection> output_protection);

  // Returns binary configuration data used for setting up HW decrypt+decode. If
  // successful, |success| will be true and |config_data| will be valid.
  // Otherwise |success| will be false and |config_data| should not be used.
  // NOTE: This will proxy to the CdmFactoryDaemon interface which is
  // implemented by the cdm-oemcrypto daemon in ChromeOS.
  GetHwConfigData@2() => (bool success, array<uint8> config_data);

  // Returns an array of the screen resolutions of all the connected displays.
  GetScreenResolutions@3() => (array<gfx.mojom.Size> resolutions);

  // Returns the wrapped key for injecting into the video decoder when doing ARC
  // playback. This mirrors the ContentDecryptionModule::GetHwKeyData call as
  // they serve the same purpose (Chrome will invoke this one for Android
  // playback and ContentDecryptionModule::GetHwKeyData for Chrome playback).
  // NOTE: This will proxy to the CdmFactoryDaemon interface which is
  // implemented by the cdm-oemcrypto daemon in ChromeOS.
  [MinVersion=1]
  GetAndroidHwKeyData@4(array<uint8> key_id, array<uint8> hw_identifier) =>
      (DecryptStatus status, array<uint8> key_data);

  // Allocates a secure buffer in TrustZone on ARM platforms. The lifetime of
  // this buffer is managed by the returned fd. This should be resolved to a
  // secure handle through V4L2; the resulting secure handle can then be used
  // for the target of decryption. If the allocation fails, a null handle is
  // returned.
  // NOTE: This will proxy to the CdmFactoryDaemon interface which is
  // implemented by the cdm-oemcrypto daemon in ChromeOS.
  [MinVersion=2]
  AllocateSecureBuffer@5(uint32 size) => (handle<platform>? fd);

  // Parses the data in the secure buffer referenced by |secure_handle| at
  // |offset| bytes into it as an H264 slice header. |stream_data| should
  // contain the required SPS/PPS structure defined in Chrome and the Trusted
  // Application. Returns a bool for success/fail and on success the array will
  // be populated with the slice header structure.
  // NOTE: This will proxy to the CdmFactoryDaemon interface which is
  // implemented by the cdm-oemcrypto daemon in ChromeOS. We do not establish
  // the structures in Mojo because we are not using Mojo in the end-to-end
  // communication.
  [MinVersion=3]
  ParseEncryptedSliceHeader@6(uint64 secure_handle, uint32 offset,
                              array<uint8> stream_data) =>
      (bool success, array<uint8> slice_header);
};