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

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

Issue 9655018: Make AudioParameters a class instead of a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 9 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_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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "media/base/channel_layout.h"
12 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
13 14
14 struct AudioParameters; 15 struct AudioParameters;
15 16
16 namespace base { 17 namespace base {
17 class SharedMemory; 18 class SharedMemory;
18 } 19 }
19 20
20 namespace media { 21 namespace media {
21 22
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 88
88 // Returns the audio input hardware sample-rate for the specified device. 89 // Returns the audio input hardware sample-rate for the specified device.
89 MEDIA_EXPORT double GetAudioInputHardwareSampleRate( 90 MEDIA_EXPORT double GetAudioInputHardwareSampleRate(
90 const std::string& device_id); 91 const std::string& device_id);
91 92
92 // Returns the optimal low-latency buffer size for the audio hardware. 93 // Returns the optimal low-latency buffer size for the audio hardware.
93 // This is the smallest buffer size the system can comfortably render 94 // This is the smallest buffer size the system can comfortably render
94 // at without glitches. The buffer size is in sample-frames. 95 // at without glitches. The buffer size is in sample-frames.
95 MEDIA_EXPORT size_t GetAudioHardwareBufferSize(); 96 MEDIA_EXPORT size_t GetAudioHardwareBufferSize();
96 97
97 // Returns the number of channels for the specified audio input device. 98 // Returns the channel layout for the specified audio input device.
98 MEDIA_EXPORT uint32 GetAudioInputHardwareChannelCount( 99 MEDIA_EXPORT ChannelLayout GetAudioInputHardwareChannelLayout(
99 const std::string& device_id); 100 const std::string& device_id);
100 101
101 // Functions that handle data buffer passed between processes in the shared 102 // Functions that handle data buffer passed between processes in the shared
102 // memory. Called on both IPC sides. 103 // memory. Called on both IPC sides.
103 104
104 MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size); 105 MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size);
105 MEDIA_EXPORT uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size); 106 MEDIA_EXPORT uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size);
106 MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory, 107 MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory,
107 uint32 shared_memory_size); 108 uint32 shared_memory_size);
108 MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory, 109 MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory,
109 uint32 shared_memory_size, 110 uint32 shared_memory_size,
110 uint32 actual_data_size); 111 uint32 actual_data_size);
111 MEDIA_EXPORT void SetUnknownDataSize(base::SharedMemory* shared_memory, 112 MEDIA_EXPORT void SetUnknownDataSize(base::SharedMemory* shared_memory,
112 uint32 shared_memory_size); 113 uint32 shared_memory_size);
113 MEDIA_EXPORT bool IsUnknownDataSize(base::SharedMemory* shared_memory, 114 MEDIA_EXPORT bool IsUnknownDataSize(base::SharedMemory* shared_memory,
114 uint32 shared_memory_size); 115 uint32 shared_memory_size);
115 116
116 #if defined(OS_WIN) 117 #if defined(OS_WIN)
117 118
118 // Does Windows support WASAPI? We are checking in lot of places, and 119 // Does Windows support WASAPI? We are checking in lot of places, and
119 // sometimes check was written incorrectly, so move into separate function. 120 // sometimes check was written incorrectly, so move into separate function.
120 MEDIA_EXPORT bool IsWASAPISupported(); 121 MEDIA_EXPORT bool IsWASAPISupported();
121 122
122 #endif // defined(OS_WIN) 123 #endif // defined(OS_WIN)
123 124
124 } // namespace media 125 } // namespace media
125 126
126 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ 127 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698