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

Unified Diff: content/renderer/media/audio_device.h

Issue 8588030: Refactor the Get*Hardware* routines a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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/renderer/media/audio_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_device.h
===================================================================
--- content/renderer/media/audio_device.h (revision 110480)
+++ content/renderer/media/audio_device.h (working copy)
@@ -101,9 +101,6 @@
double sample_rate() const { return sample_rate_; }
size_t buffer_size() const { return buffer_size_; }
- static double GetAudioHardwareSampleRate();
- static size_t GetAudioHardwareBufferSize();
-
// Methods called on IO thread ----------------------------------------------
// AudioMessageFilter::Delegate methods, called by AudioMessageFilter.
virtual void OnRequestPacket(AudioBuffersState buffers_state);
@@ -175,4 +172,26 @@
DISALLOW_IMPLICIT_CONSTRUCTORS(AudioDevice);
};
+// Contains static methods to query hardware properties from the browser
henrika (OOO until Aug 14) 2011/11/17 12:27:44 Namespace perhaps?
+// process. Values are cached to avoid unnecessary round trips, but the cache
+// can be cleared if needed (currently only used by tests).
+class CONTENT_EXPORT AudioHardware {
+ public:
+ static double GetOutputSampleRate();
+ static double GetInputSampleRate();
+ static size_t GetOutputBufferSize();
+
+ // Forces the next call to any of the Get functions to query the hardware
+ // and repopulate the cache.
+ static void ResetCache();
+
+ private:
+ static double output_sample_rate_;
+ static double input_sample_rate_;
+ static size_t output_buffer_size_;
+
+ // This class doesn't support construction.
+ DISALLOW_COPY_AND_ASSIGN(AudioHardware);
+};
+
#endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_
« no previous file with comments | « no previous file | content/renderer/media/audio_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698