Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: content/renderer/media/local_media_stream_audio_source.h

Issue 1647773002: MediaStream audio sourcing: Bypass audio processing for non-WebRTC cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NOT FOR REVIEW -- This will be broken-up across multiple CLs. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_LOCAL_MEDIA_STREAM_AUDIO_SOURCE_H_
6 #define CONTENT_RENDERER_MEDIA_LOCAL_MEDIA_STREAM_AUDIO_SOURCE_H_
7
8 #include "content/common/media/media_stream_options.h"
9 #include "content/renderer/media/media_stream_audio_source.h"
10 #include "media/base/audio_capturer_source.h"
11 #include "media/audio/audio_input_device.h"
12
13 namespace content {
14
15 // Represents a local source of audio data generated by an AudioInputDevice.
16 // Uses content::AudioDeviceFactory to auto-create the AudioInputDevice, using
17 // the parameters and session ID found in StreamDeviceInfo, just before the
18 // first track is connected. Audio data is transported directly to the tracks
19 // (i.e., there is no audio processing).
20 class CONTENT_EXPORT LocalMediaStreamAudioSource
21 : NON_EXPORTED_BASE(public MediaStreamAudioSource),
22 NON_EXPORTED_BASE(public media::AudioCapturerSource::CaptureCallback) {
23 public:
24 // |consumer_render_frame_id| references the RenderFrame that will consume the
25 // audio data. Audio parameters and (optionally) a pre-existing audio session
26 // ID are read from |device_info|.
27 LocalMediaStreamAudioSource(int consumer_render_frame_id,
28 const StreamDeviceInfo& device_info);
29
30 ~LocalMediaStreamAudioSource() final;
31
32 private:
33 // MediaStreamAudioSource implementation.
34 void DoStopSource() final;
35 bool EnsureSourceIsStarted() final;
36
37 // media::AudioCapturerSource::CaptureCallback implementation.
38 void Capture(const media::AudioBus* audio_bus,
39 int audio_delay_milliseconds,
40 double volume,
41 bool key_pressed) final;
42 void OnCaptureError(const std::string& message) final;
43
44 // The RenderFrame that will consume the audio data. Used when creating
45 // AudioInputDevices via the AudioDeviceFactory.
46 const int consumer_render_frame_id_;
47
48 // The StreamDeviceInfo session ID. Used when creating AudioInputDevices via
49 // the AudioDeviceFactory.
50 const int session_id_;
51
52 // The device created by the AudioDeviceFactory in EnsureSourceIsStarted().
53 scoped_refptr<media::AudioInputDevice> input_device_;
54
55 DISALLOW_COPY_AND_ASSIGN(LocalMediaStreamAudioSource);
56 };
57
58 } // namespace content
59
60 #endif // CONTENT_RENDERER_MEDIA_LOCAL_MEDIA_STREAM_AUDIO_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698