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

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

Issue 22886005: Switch audio synchronization from sleep() based to select() based. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/time/time.h"
9 #include "media/base/channel_layout.h" 10 #include "media/base/channel_layout.h"
10 #include "media/base/media_export.h" 11 #include "media/base/media_export.h"
11 12
12 namespace media { 13 namespace media {
13 14
14 struct MEDIA_EXPORT AudioInputBufferParameters { 15 struct MEDIA_EXPORT AudioInputBufferParameters {
15 double volume; 16 double volume;
16 uint32 size; 17 uint32 size;
17 }; 18 };
18 19
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 62
62 // Returns size of audio buffer in bytes. 63 // Returns size of audio buffer in bytes.
63 int GetBytesPerBuffer() const; 64 int GetBytesPerBuffer() const;
64 65
65 // Returns the number of bytes representing one second of audio. 66 // Returns the number of bytes representing one second of audio.
66 int GetBytesPerSecond() const; 67 int GetBytesPerSecond() const;
67 68
68 // Returns the number of bytes representing a frame of audio. 69 // Returns the number of bytes representing a frame of audio.
69 int GetBytesPerFrame() const; 70 int GetBytesPerFrame() const;
70 71
72 base::TimeDelta GetBufferDuration() const;
henrika (OOO until Aug 14) 2013/08/20 07:50:30 OK, I see that you have added this method. Please
DaleCurtis 2013/09/11 01:16:03 The resolution being limited to microseconds is a
73
71 Format format() const { return format_; } 74 Format format() const { return format_; }
72 ChannelLayout channel_layout() const { return channel_layout_; } 75 ChannelLayout channel_layout() const { return channel_layout_; }
73 int sample_rate() const { return sample_rate_; } 76 int sample_rate() const { return sample_rate_; }
74 int bits_per_sample() const { return bits_per_sample_; } 77 int bits_per_sample() const { return bits_per_sample_; }
75 int frames_per_buffer() const { return frames_per_buffer_; } 78 int frames_per_buffer() const { return frames_per_buffer_; }
76 int channels() const { return channels_; } 79 int channels() const { return channels_; }
77 int input_channels() const { return input_channels_; } 80 int input_channels() const { return input_channels_; }
78 81
79 // Set to CHANNEL_LAYOUT_DISCRETE with given number of channels. 82 // Set to CHANNEL_LAYOUT_DISCRETE with given number of channels.
80 void SetDiscreteChannels(int channels); 83 void SetDiscreteChannels(int channels);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (a.sample_rate() != b.sample_rate()) 118 if (a.sample_rate() != b.sample_rate())
116 return a.sample_rate() < b.sample_rate(); 119 return a.sample_rate() < b.sample_rate();
117 if (a.bits_per_sample() != b.bits_per_sample()) 120 if (a.bits_per_sample() != b.bits_per_sample())
118 return a.bits_per_sample() < b.bits_per_sample(); 121 return a.bits_per_sample() < b.bits_per_sample();
119 return a.frames_per_buffer() < b.frames_per_buffer(); 122 return a.frames_per_buffer() < b.frames_per_buffer();
120 } 123 }
121 124
122 } // namespace media 125 } // namespace media
123 126
124 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ 127 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698