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

Side by Side Diff: media/audio/audio_parameters.h

Issue 1211273005: Use safer IPC serializations in media_param_traits.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up unit tests Created 5 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
« no previous file with comments | « media/audio/android/audio_android_unittest.cc ('k') | media/audio/audio_parameters.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_AUDIO_AUDIO_PARAMETERS_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_
6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ 6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 15 matching lines...) Expand all
26 struct MEDIA_EXPORT AudioInputBuffer { 26 struct MEDIA_EXPORT AudioInputBuffer {
27 AudioInputBufferParameters params; 27 AudioInputBufferParameters params;
28 int8 audio[1]; 28 int8 audio[1];
29 }; 29 };
30 30
31 class MEDIA_EXPORT AudioParameters { 31 class MEDIA_EXPORT AudioParameters {
32 public: 32 public:
33 // TODO(miu): Rename this enum to something that correctly reflects its 33 // TODO(miu): Rename this enum to something that correctly reflects its
34 // semantics, such as "TransportScheme." 34 // semantics, such as "TransportScheme."
35 enum Format { 35 enum Format {
36 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. 36 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples.
37 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. 37 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested.
38 AUDIO_FAKE, // Creates a fake AudioOutputStream object. 38 AUDIO_FAKE, // Creates a fake AudioOutputStream object.
39 AUDIO_LAST_FORMAT // Only used for validation of format. 39 AUDIO_FORMAT_LAST = AUDIO_FAKE, // Only used for validation of format.
40 }; 40 };
41 41
42 enum { 42 enum {
43 // Telephone quality sample rate, mostly for speech-only audio. 43 // Telephone quality sample rate, mostly for speech-only audio.
44 kTelephoneSampleRate = 8000, 44 kTelephoneSampleRate = 8000,
45 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. 45 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7.
46 kAudioCDSampleRate = 44100, 46 kAudioCDSampleRate = 44100,
47 }; 47 };
48 48
49 // Bitmasks to determine whether certain platform (typically hardware) audio 49 // Bitmasks to determine whether certain platform (typically hardware) audio
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if (a.sample_rate() != b.sample_rate()) 126 if (a.sample_rate() != b.sample_rate())
127 return a.sample_rate() < b.sample_rate(); 127 return a.sample_rate() < b.sample_rate();
128 if (a.bits_per_sample() != b.bits_per_sample()) 128 if (a.bits_per_sample() != b.bits_per_sample())
129 return a.bits_per_sample() < b.bits_per_sample(); 129 return a.bits_per_sample() < b.bits_per_sample();
130 return a.frames_per_buffer() < b.frames_per_buffer(); 130 return a.frames_per_buffer() < b.frames_per_buffer();
131 } 131 }
132 132
133 } // namespace media 133 } // namespace media
134 134
135 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ 135 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_
OLDNEW
« no previous file with comments | « media/audio/android/audio_android_unittest.cc ('k') | media/audio/audio_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698