[M120 Migration][MM] Framerate calculation
[platform/framework/web/chromium-efl.git] / media / mojo / mojom / audio_logging.mojom
1 // Copyright 2018 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/audio_parameters.mojom";
8
9 // This interface is implemented by the browser process to log state information
10 // about an active audio component.
11 interface AudioLog {
12   // Called when an audio component is created.  |params| are the parameters of
13   // the created stream.  |device_id| is the id of the audio device opened by
14   // the created stream.
15   OnCreated(media.mojom.AudioParameters params,
16             string device_id);
17
18   // Called when an audio component is started, generally this is synonymous
19   // with "playing."
20   OnStarted();
21
22   // Called when an audio component is stopped, generally this is synonymous
23   // with "paused."
24   OnStopped();
25
26   // Called when an audio component is closed, generally this is synonymous
27   // with "deleted."
28   OnClosed();
29
30   // Called when an audio component encounters an error.
31   OnError();
32
33   // Called when an audio component changes volume.  |volume| is the new volume.
34   OnSetVolume(double volume);
35
36   // Called with information about audio processing set-up for an audio
37   // component.
38   OnProcessingStateChanged(string message);
39
40   // Called when an audio component wants to forward a log message.
41   OnLogMessage(string message);
42 };
43
44 enum AudioLogComponent {
45   kInputController,
46   kOutputController,
47   kOutputStream,
48 };
49
50 // This interface is implemented by the browser process to allow clients to
51 // create AudioLog instances for tracking the behavior of an audio component.
52 // The only client for this interface is the audio service.
53 interface AudioLogFactory {
54   // Creates an AudioLog object for tracking the behavior for one instance of
55   // the given |component|.  Each instance of an "owning" class must create its
56   // own AudioLog. The created AudioLog object is bound to |audio_log_receiver|.
57   CreateAudioLog(AudioLogComponent component,
58                  int32 component_id,
59                  pending_receiver<AudioLog> audio_log_receiver);
60 };