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: media/audio/audio_input_device.h

Issue 2941773002: Added initial muted state to stream creation callback, to avoid races. (Closed)
Patch Set: Added mute information to DoCompleteCreation log message. Created 3 years, 6 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
« no previous file with comments | « media/audio/audio_input_controller_unittest.cc ('k') | media/audio/audio_input_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Low-latency audio capturing class utilizing audio input stream provided 5 // Low-latency audio capturing class utilizing audio input stream provided
6 // by a server (browser) process by use of an IPC interface. 6 // by a server (browser) process by use of an IPC interface.
7 // 7 //
8 // Relationship of classes: 8 // Relationship of classes:
9 // 9 //
10 // AudioInputController AudioInputDevice 10 // AudioInputController AudioInputDevice
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 protected: 98 protected:
99 friend class base::RefCountedThreadSafe<AudioInputDevice>; 99 friend class base::RefCountedThreadSafe<AudioInputDevice>;
100 ~AudioInputDevice() override; 100 ~AudioInputDevice() override;
101 101
102 // Methods called on IO thread ---------------------------------------------- 102 // Methods called on IO thread ----------------------------------------------
103 // AudioInputIPCDelegate implementation. 103 // AudioInputIPCDelegate implementation.
104 void OnStreamCreated(base::SharedMemoryHandle handle, 104 void OnStreamCreated(base::SharedMemoryHandle handle,
105 base::SyncSocket::Handle socket_handle, 105 base::SyncSocket::Handle socket_handle,
106 int length, 106 int length,
107 int total_segments) override; 107 int total_segments,
108 bool initially_muted) override;
108 void OnError() override; 109 void OnError() override;
109 void OnMuted(bool is_muted) override; 110 void OnMuted(bool is_muted) override;
110 void OnIPCClosed() override; 111 void OnIPCClosed() override;
111 112
112 private: 113 private:
113 // Note: The ordering of members in this enum is critical to correct behavior! 114 // Note: The ordering of members in this enum is critical to correct behavior!
114 enum State { 115 enum State {
115 IPC_CLOSED, // No more IPCs can take place. 116 IPC_CLOSED, // No more IPCs can take place.
116 IDLE, // Not started. 117 IDLE, // Not started.
117 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back. 118 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // Flags that missing callbacks has been detected. Used for statistics, 198 // Flags that missing callbacks has been detected. Used for statistics,
198 // reported when stopping. Must only be accessed on the IO thread. 199 // reported when stopping. Must only be accessed on the IO thread.
199 bool missing_callbacks_detected_; 200 bool missing_callbacks_detected_;
200 201
201 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); 202 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice);
202 }; 203 };
203 204
204 } // namespace media 205 } // namespace media
205 206
206 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ 207 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_
OLDNEW
« no previous file with comments | « media/audio/audio_input_controller_unittest.cc ('k') | media/audio/audio_input_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698