summaryrefslogtreecommitdiff
path: root/chromium/content/common/media/renderer_audio_input_stream_factory.mojom
blob: 01a060ff5267716c4fb2050a1a0a8f363a31bdaa (plain)
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
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module content.mojom;

import "media/mojo/interfaces/audio_data_pipe.mojom";
import "media/mojo/interfaces/audio_input_stream.mojom";
import "media/mojo/interfaces/audio_parameters.mojom";
import "media/mojo/interfaces/media_types.mojom";

// This interface is used by the renderer to ask the browser to create input
// streams. The renderer supplies the desired audio parameters, and a client
// to send the stream to when it's ready. The lifetime of the stream is limited
// by the lifetime of the client.
interface RendererAudioInputStreamFactory {
  CreateStream(
      RendererAudioInputStreamFactoryClient client,
      int32 session_id,
      media.mojom.AudioParameters params,
      bool automatic_gain_control,
      uint32 shared_memory_count);
};

interface RendererAudioInputStreamFactoryClient {
  // Called when a stream has been created. Will only be called once for every
  // CreateStream call.
  // TODO(crbug.com/787806): There are plans to allow this function to be called
  // serveral times in the future. If the stream is terminated e.g. due to the
  // process hosting it crashing, this function should be called again with a
  // fresh stream.
  StreamCreated(
      media.mojom.AudioInputStream stream,
      media.mojom.AudioInputStreamClient& client_request,
      media.mojom.AudioDataPipe data_pipe,
      bool initially_muted);
};