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

Unified Diff: media/audio/audio_parameters.cc

Issue 5158003: Implement AudioOutputProxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memleak in the unittests Created 10 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 | « media/audio/audio_parameters.h ('k') | media/audio/audio_parameters_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_parameters.cc
diff --git a/media/audio/audio_parameters.cc b/media/audio/audio_parameters.cc
index b0a691b6da616c9c5270961f993c3b1c216df72c..d1d44a7b5e65447d94acaad8fb341f778c12f633 100644
--- a/media/audio/audio_parameters.cc
+++ b/media/audio/audio_parameters.cc
@@ -37,3 +37,25 @@ bool AudioParameters::IsValid() const {
int AudioParameters::GetPacketSize() const {
return samples_per_packet * channels * bits_per_sample / 8;
}
+
+bool AudioParameters::Compare::operator()(
+ const AudioParameters& a,
+ const AudioParameters& b) const {
+ if (a.format < b.format)
+ return true;
+ if (a.format > b.format)
+ return false;
+ if (a.channels < b.channels)
+ return true;
+ if (a.channels > b.channels)
+ return false;
+ if (a.sample_rate < b.sample_rate)
+ return true;
+ if (a.sample_rate > b.sample_rate)
+ return false;
+ if (a.bits_per_sample < b.bits_per_sample)
+ return true;
+ if (a.bits_per_sample > b.bits_per_sample)
+ return false;
+ return a.samples_per_packet < b.samples_per_packet;
+}
« no previous file with comments | « media/audio/audio_parameters.h ('k') | media/audio/audio_parameters_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698