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

Unified Diff: content/browser/renderer_host/media/audio_output_device_enumerator.h

Issue 1607923002: Correctly handle enumerations for AudioManagers that report only the default audio output device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_output_device_enumerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_output_device_enumerator.h
diff --git a/content/browser/renderer_host/media/audio_output_device_enumerator.h b/content/browser/renderer_host/media/audio_output_device_enumerator.h
index 740e9c64f1e068a2e88c3996346a179f8ea40434..bf223a9bccdff0b5d99b385e42d880b0d301870b 100644
--- a/content/browser/renderer_host/media/audio_output_device_enumerator.h
+++ b/content/browser/renderer_host/media/audio_output_device_enumerator.h
@@ -43,7 +43,19 @@ struct AudioOutputDeviceInfo {
media::AudioParameters output_params;
};
-typedef std::vector<AudioOutputDeviceInfo> AudioOutputDeviceEnumeration;
+// The result of an enumeration. It is used only in the browser side.
+struct AudioOutputDeviceEnumeration {
+ public:
+ AudioOutputDeviceEnumeration(
+ const std::vector<AudioOutputDeviceInfo>& devices,
+ bool has_actual_devices);
+ AudioOutputDeviceEnumeration();
+ ~AudioOutputDeviceEnumeration();
+
+ std::vector<AudioOutputDeviceInfo> devices;
+ bool has_actual_devices;
+};
+
typedef base::Callback<void(const AudioOutputDeviceEnumeration&)>
AudioOutputDeviceEnumerationCB;
@@ -59,11 +71,15 @@ class CONTENT_EXPORT AudioOutputDeviceEnumerator {
// Does an enumeration and provides the results to the callback.
// If there are no physical devices, the result contains a single entry with
- // the default parameters provided by the underlying audio manager.
+ // the default parameters provided by the underlying audio manager and with
+ // the |has_actual_devices| field set to false.
// The behavior with no physical devices is there to ease the transition
// from the use of RenderThreadImpl::GetAudioHardwareConfig(), which always
// provides default parameters, even if there are no devices.
// See https://crbug.com/549125.
+ // Some audio managers always report a single device, regardless of the
+ // physical devices in the system. In this case the |has_actual_devices| field
+ // is set to true to differentiate from the case of no physical devices.
void Enumerate(const AudioOutputDeviceEnumerationCB& callback);
// Invalidates the current cache.
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_output_device_enumerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698