1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 import "media/mojo/mojom/content_decryption_module.mojom";
8 import "media/mojo/mojom/media_types.mojom";
10 struct VideoCodecInfo {
11 // Array of VideoCodecProfiles supported. If no profiles for a
12 // particular codec are specified, then it is assumed that all
13 // profiles are supported by the CDM.
14 array<VideoCodecProfile> supported_profiles;
16 // A boolean that contains info about whether the video codec
17 // supports clear lead. This defaults to true except for specific
18 // cases involving Windows codecs.
19 bool supports_clear_lead = true;
22 // TODO(xhwang): Use "set" instead of "array" if supported by mojom.
23 struct CdmCapability {
24 // List of audio codecs supported by the CDM (e.g. opus). This does not
25 // include codec profiles, as in general Chromium doesn't handle audio
26 // codec profiles separately. The list of supported codecs should be unique.
27 array<AudioCodec> audio_codecs;
29 // Map of video codecs and a struct containing the associated profiles
30 // supported by the CDM (e.g. vp8) and whether clear lead is supported.
31 map<VideoCodec, VideoCodecInfo> video_codecs;
33 array<EncryptionScheme> encryption_schemes;
34 array<CdmSessionType> session_types;
37 struct KeySystemCapability {
38 CdmCapability? sw_secure_capability;
39 CdmCapability? hw_secure_capability;
42 // Process-wide observer used by the renderer to observe key system support
43 // changes. `key_systems` is a map from the key system string to the
44 // KeySystemCapability for that key system.
45 interface KeySystemSupportObserver {
46 // Called when there's a key system support update.
47 OnKeySystemSupportUpdated(map<string, KeySystemCapability> key_systems);
50 // Browser process singleton that a renderer process can use to subscribe to
51 // key system updates.
52 interface KeySystemSupport {
53 // Adds an observer to observe key system support updates. KeySystemSupport
54 // implementation is in the browser process, as it maintains the list of
55 // registered CDMs, and hardware secure support check also needs to run in the
56 // browser process because the render process is sandboxed. KeySystemSupport
57 // clients run in the renderer process.
58 AddObserver(pending_remote<KeySystemSupportObserver> observer);