[M120 Migration][MM] Framerate calculation
[platform/framework/web/chromium-efl.git] / media / mojo / mojom / audio_input_stream.mojom
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.
4
5 module media.mojom;
6
7 import "media/mojo/mojom/audio_parameters.mojom";
8 import "media/mojo/mojom/media_types.mojom";
9
10 // An interface for controlling an audio input stream.
11 // On error, the message pipe is closed.
12 // To close the stream, just close the message pipe.
13 interface AudioInputStream {
14   // Starts recording audio, can be called only once.
15   Record();
16
17   // Sets volume. Volume must be in the range [0, 1].
18   SetVolume(double volume);
19 };
20
21 // An interface for receiving notifications of state changes of an
22 // AudioInputStream.
23 interface AudioInputStreamClient {
24   OnError(InputStreamErrorCode code);
25   OnMutedStateChanged(bool is_muted);
26
27   [EnableIf=is_tizen_tv]
28   OnMediaStateChanged(uint32 previous, uint32 current);
29 };
30
31 // An AudioInputStreamObserver gets notifications about events related to an
32 // AudioInputStream. DidStartRecording() is invoked when the stream starts
33 // recording. Stream destruction is notified through binding connection error.
34 interface AudioInputStreamObserver {
35   // These values are persisted to logs. Entries should not be renumbered and
36   // numeric values should never be reused.
37   enum DisconnectReason {
38     // The Disconnect reason wasn't given explicitly. This probably means that
39     // the audio service crashed.
40     kDefault = 0,
41     // This code is used as disconnect reason when stream ended or failed to
42     // start due to an unrecoverable platform error, e.g. the hardware device is
43     // busy or disconnected.
44     kPlatformError = 1,
45     kTerminatedByClient = 2,
46     kStreamCreationFailed = 3,
47     kDocumentDestroyed = 4,
48     kSystemPermissions = 5,
49     kDeviceInUse = 6,
50   };
51
52   // It will be called only once when input stream starts recording.
53   DidStartRecording();
54 };