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

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

Issue 2510093003: Handle audio node stable device ID change (Closed)
Patch Set: fix a typo Created 4 years 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
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 #include "chromeos/audio/cras_audio_handler.h" 5 #include "chromeos/audio/cras_audio_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 static CrasAudioHandler* g_cras_audio_handler = NULL; 44 static CrasAudioHandler* g_cras_audio_handler = NULL;
45 45
46 bool IsSameAudioDevice(const AudioDevice& a, const AudioDevice& b) { 46 bool IsSameAudioDevice(const AudioDevice& a, const AudioDevice& b) {
47 return a.stable_device_id == b.stable_device_id && a.is_input == b.is_input && 47 return a.stable_device_id == b.stable_device_id && a.is_input == b.is_input &&
48 a.type == b.type && a.device_name == b.device_name; 48 a.type == b.type && a.device_name == b.device_name;
49 } 49 }
50 50
51 bool IsDeviceInList(const AudioDevice& device, const AudioNodeList& node_list) { 51 bool IsDeviceInList(const AudioDevice& device, const AudioNodeList& node_list) {
52 for (const AudioNode& node : node_list) { 52 for (const AudioNode& node : node_list) {
53 if (device.stable_device_id == node.stable_device_id) 53 if (device.stable_device_id == node.StableDeviceId())
54 return true; 54 return true;
55 } 55 }
56 return false; 56 return false;
57 } 57 }
58 58
59 } // namespace 59 } // namespace
60 60
61 CrasAudioHandler::AudioObserver::AudioObserver() { 61 CrasAudioHandler::AudioObserver::AudioObserver() {
62 } 62 }
63 63
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 hdmi_rediscover_grace_period_duration_in_ms_), 1386 hdmi_rediscover_grace_period_duration_in_ms_),
1387 this, &CrasAudioHandler::UpdateAudioAfterHDMIRediscoverGracePeriod); 1387 this, &CrasAudioHandler::UpdateAudioAfterHDMIRediscoverGracePeriod);
1388 } 1388 }
1389 1389
1390 void CrasAudioHandler::SetHDMIRediscoverGracePeriodForTesting( 1390 void CrasAudioHandler::SetHDMIRediscoverGracePeriodForTesting(
1391 int duration_in_ms) { 1391 int duration_in_ms) {
1392 hdmi_rediscover_grace_period_duration_in_ms_ = duration_in_ms; 1392 hdmi_rediscover_grace_period_duration_in_ms_ = duration_in_ms;
1393 } 1393 }
1394 1394
1395 } // namespace chromeos 1395 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/audio/audio_devices_pref_handler_impl_unittest.cc ('k') | chromeos/audio/cras_audio_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698