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

Side by Side Diff: media/base/audio_hash.h

Issue 377803004: Fixes for re-enabling more MSVC level 4 warnings: media/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_output_controller.cc ('k') | media/base/audio_hash.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef MEDIA_BASE_AUDIO_HASH_H_ 5 #ifndef MEDIA_BASE_AUDIO_HASH_H_
6 #define MEDIA_BASE_AUDIO_HASH_H_ 6 #define MEDIA_BASE_AUDIO_HASH_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 26 matching lines...) Expand all
37 // Update current hash with the contents of the provided AudioBus. 37 // Update current hash with the contents of the provided AudioBus.
38 void Update(const AudioBus* audio_bus, int frames); 38 void Update(const AudioBus* audio_bus, int frames);
39 39
40 // Return a string representation of the current hash. 40 // Return a string representation of the current hash.
41 std::string ToString() const; 41 std::string ToString() const;
42 42
43 private: 43 private:
44 // Storage for the audio hash. The number of buckets controls the importance 44 // Storage for the audio hash. The number of buckets controls the importance
45 // of position in the hash. A higher number reduces the chance of false 45 // of position in the hash. A higher number reduces the chance of false
46 // positives related to incorrect sample position. Value chosen by dice roll. 46 // positives related to incorrect sample position. Value chosen by dice roll.
47 enum { kHashBuckets = 6 }; 47 float audio_hash_[6];
48 float audio_hash_[kHashBuckets];
49 48
50 // The total number of samples processed per channel. Uses a uint32 instead 49 // The total number of samples processed per channel. Uses a uint32 instead
51 // of size_t so overflows on 64-bit and 32-bit machines are equivalent. 50 // of size_t so overflows on 64-bit and 32-bit machines are equivalent.
52 uint32 sample_count_; 51 uint32 sample_count_;
53 52
54 DISALLOW_COPY_AND_ASSIGN(AudioHash); 53 DISALLOW_COPY_AND_ASSIGN(AudioHash);
55 }; 54 };
56 55
57 } // namespace media 56 } // namespace media
58 57
59 #endif // MEDIA_BASE_AUDIO_HASH_H_ 58 #endif // MEDIA_BASE_AUDIO_HASH_H_
OLDNEW
« no previous file with comments | « media/audio/audio_output_controller.cc ('k') | media/base/audio_hash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698