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

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

Issue 8283032: Low-latency AudioInputStream implementation based on WASAPI for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixes in AVRT wrapper based on review by tommi Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_UTIL_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_UTIL_H_
6 #define MEDIA_AUDIO_AUDIO_UTIL_H_ 6 #define MEDIA_AUDIO_AUDIO_UTIL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // InterleaveFloatToInt16 scales, clips, and interleaves the planar 72 // InterleaveFloatToInt16 scales, clips, and interleaves the planar
73 // floating-point audio contained in |source| to the int16 |destination|. 73 // floating-point audio contained in |source| to the int16 |destination|.
74 // The floating-point data is in a canonical range of -1.0 -> +1.0. 74 // The floating-point data is in a canonical range of -1.0 -> +1.0.
75 // The size of the |source| vector determines the number of channels. 75 // The size of the |source| vector determines the number of channels.
76 // The |destination| buffer is assumed to be large enough to hold the 76 // The |destination| buffer is assumed to be large enough to hold the
77 // result. Thus it must be at least size: number_of_frames * source.size() 77 // result. Thus it must be at least size: number_of_frames * source.size()
78 MEDIA_EXPORT void InterleaveFloatToInt16(const std::vector<float*>& source, 78 MEDIA_EXPORT void InterleaveFloatToInt16(const std::vector<float*>& source,
79 int16* destination, 79 int16* destination,
80 size_t number_of_frames); 80 size_t number_of_frames);
81 81
82 // Returns the default audio hardware sample-rate. 82 // Returns the default audio input hardware sample-rate.
Chris Rogers 2011/10/19 00:55:18 comment is backwards: should be "audio output"
henrika (OOO until Aug 14) 2011/10/19 15:42:43 Thanks!
83 MEDIA_EXPORT double GetAudioHardwareSampleRate(); 83 MEDIA_EXPORT double GetAudioHardwareSampleRate();
84 84
85 // Returns the default audio output hardware sample-rate.
Chris Rogers 2011/10/19 00:55:18 should be "audio input"
henrika (OOO until Aug 14) 2011/10/19 15:42:43 Done.
86 MEDIA_EXPORT double GetAudioInputHardwareSampleRate();
87
85 // Returns the optimal low-latency buffer size for the audio hardware. 88 // Returns the optimal low-latency buffer size for the audio hardware.
86 // This is the smallest buffer size the system can comfortably render 89 // This is the smallest buffer size the system can comfortably render
87 // at without glitches. The buffer size is in sample-frames. 90 // at without glitches. The buffer size is in sample-frames.
88 MEDIA_EXPORT size_t GetAudioHardwareBufferSize(); 91 MEDIA_EXPORT size_t GetAudioHardwareBufferSize();
89 92
90 // Functions that handle data buffer passed between processes in the shared 93 // Functions that handle data buffer passed between processes in the shared
91 // memory. Called on both IPC sides. 94 // memory. Called on both IPC sides.
92 95
93 MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size); 96 MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size);
94 MEDIA_EXPORT uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size); 97 MEDIA_EXPORT uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size);
95 MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory, 98 MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory,
96 uint32 shared_memory_size); 99 uint32 shared_memory_size);
97 MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory, 100 MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory,
98 uint32 shared_memory_size, 101 uint32 shared_memory_size,
99 uint32 actual_data_size); 102 uint32 actual_data_size);
100 MEDIA_EXPORT void SetUnknownDataSize(base::SharedMemory* shared_memory, 103 MEDIA_EXPORT void SetUnknownDataSize(base::SharedMemory* shared_memory,
101 uint32 shared_memory_size); 104 uint32 shared_memory_size);
102 MEDIA_EXPORT bool IsUnknownDataSize(base::SharedMemory* shared_memory, 105 MEDIA_EXPORT bool IsUnknownDataSize(base::SharedMemory* shared_memory,
103 uint32 shared_memory_size); 106 uint32 shared_memory_size);
104 107
105 } // namespace media 108 } // namespace media
106 109
107 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ 110 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698