[M120 Migration][MM] Framerate calculation
[platform/framework/web/chromium-efl.git] / media / mojo / mojom / frame_interface_factory.mojom
1 // Copyright 2020 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.
4
5 module media.mojom;
6
7 import "media/mojo/mojom/cdm_storage.mojom";
8 import "media/mojo/mojom/provision_fetcher.mojom";
9 import "mojo/public/mojom/base/generic_pending_receiver.mojom";
10 import "url/mojom/origin.mojom";
11 [EnableIf=is_win]
12 import "media/mojo/mojom/dcomp_surface_registry.mojom";
13
14 // Implemented by things like audio playback in the utility process to respond
15 // to mute state changes (e.g. the user checks "Mute Site" or "Unmute Site" on a
16 // tab).
17 [EnableIf=is_win]
18 interface MuteStateObserver {
19   // Notifies mute state change.
20   OnMuteStateChange(bool muted);
21 };
22
23 // A factory providing extra services for media mojo services running remotely.
24 // The implementation of this interface lives in the browser process and
25 // is bound to a RenderFrameHost (see MediaInterfaceProxy). Interfaces created
26 // via this interface also live in the browser process and are mostly bound to
27 // a document's lifetime.
28 interface FrameInterfaceFactory {
29   // Binds the ProvisionFetcher for the frame.
30   CreateProvisionFetcher(pending_receiver<ProvisionFetcher> provision_fetcher);
31
32   // Binds the CdmStorage for the frame. This requires that the frame have
33   // CDM storage available.
34   CreateCdmStorage(pending_receiver<CdmStorage> cdm_storage);
35
36   // Registers `site_mute_observer` to get notified of site mute state changes.
37   [EnableIf=is_win]
38   RegisterMuteStateObserver(
39       pending_remote<MuteStateObserver> site_mute_observer);
40
41   // Binds a DCOMPSurfaceRegistry to register a surface handle in GPU process.
42   [EnableIf=is_win]
43   CreateDCOMPSurfaceRegistry(pending_receiver<DCOMPSurfaceRegistry> registry);
44
45   // Gets the origin of the frame associated with the CDM.
46   [Sync]
47   GetCdmOrigin() => (url.mojom.Origin cdm_origin);
48
49   // Binds a generic media frame-bound interface. This is to allow //content
50   // embedders to provide additional interfaces.
51   BindEmbedderReceiver(mojo_base.mojom.GenericPendingReceiver receiver);
52 };