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

Side by Side Diff: chromeos/audio/cras_audio_handler.h

Issue 23819034: Fix the wrong output device switching caused by an input device being plugged in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chromeos/audio/cras_audio_handler.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ 5 #ifndef CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_
6 #define CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ 6 #define CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // |new_active_device|. 223 // |new_active_device|.
224 bool ChangeActiveDevice(const AudioDevice& new_active_device, 224 bool ChangeActiveDevice(const AudioDevice& new_active_device,
225 uint64* current_active_node_id); 225 uint64* current_active_node_id);
226 226
227 // Returns true if the audio nodes change is caused by some non-active 227 // Returns true if the audio nodes change is caused by some non-active
228 // audio nodes unplugged. 228 // audio nodes unplugged.
229 bool NonActiveDeviceUnplugged(size_t old_devices_size, 229 bool NonActiveDeviceUnplugged(size_t old_devices_size,
230 size_t new_device_size, 230 size_t new_device_size,
231 uint64 current_active_node); 231 uint64 current_active_node);
232 232
233 // Returns true if there is any device change for for input or output,
234 // specified by |is_input|.
235 bool HasDeviceChange(const AudioNodeList& new_nodes, bool is_input);
236
233 // Handles dbus callback for GetNodes. 237 // Handles dbus callback for GetNodes.
234 void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success); 238 void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success);
235 239
236 scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler_; 240 scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler_;
237 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; 241 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_;
238 ObserverList<AudioObserver> observers_; 242 ObserverList<AudioObserver> observers_;
239 243
240 // Audio data and state. 244 // Audio data and state.
241 AudioDeviceMap audio_devices_; 245 AudioDeviceMap audio_devices_;
242 246
(...skipping 11 matching lines...) Expand all
254 258
255 bool output_mute_locked_; 259 bool output_mute_locked_;
256 bool input_mute_locked_; 260 bool input_mute_locked_;
257 261
258 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); 262 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler);
259 }; 263 };
260 264
261 } // namespace chromeos 265 } // namespace chromeos
262 266
263 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ 267 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698