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

Unified Diff: media/audio/audio_parameters.h

Issue 11233023: Handle audio device changes on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments! Created 8 years, 2 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
Index: media/audio/audio_parameters.h
diff --git a/media/audio/audio_parameters.h b/media/audio/audio_parameters.h
index be904f49068e1f15fb95328c37a96b403dfc901b..b9fb99840c625971680abb8c4fe40ee8e1d541f3 100644
--- a/media/audio/audio_parameters.h
+++ b/media/audio/audio_parameters.h
@@ -26,12 +26,6 @@ struct MEDIA_EXPORT AudioInputBuffer {
class MEDIA_EXPORT AudioParameters {
public:
- // Compare is useful when AudioParameters is used as a key in std::map.
- class MEDIA_EXPORT Compare {
- public:
- bool operator()(const AudioParameters& a, const AudioParameters& b) const;
- };
-
enum Format {
AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples.
AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested.
@@ -85,6 +79,20 @@ class MEDIA_EXPORT AudioParameters {
// |channel_layout|.
};
+// Comparison is useful when AudioParameters is used with std structures.
+inline bool operator<(const AudioParameters& a,
+ const AudioParameters& b) {
+ if (a.format() != b.format())
+ return a.format() < b.format();
+ if (a.channels() != b.channels())
+ return a.channels() < b.channels();
+ if (a.sample_rate() != b.sample_rate())
+ return a.sample_rate() < b.sample_rate();
+ if (a.bits_per_sample() != b.bits_per_sample())
+ return a.bits_per_sample() < b.bits_per_sample();
+ return a.frames_per_buffer() < b.frames_per_buffer();
+}
+
} // namespace media
#endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_

Powered by Google App Engine
This is Rietveld 408576698