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

Unified Diff: media/audio/mac/audio_low_latency_output_mac.cc

Issue 9655018: Make AudioParameters a class instead of a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/mac/audio_low_latency_output_mac.h ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_low_latency_output_mac.cc
diff --git a/media/audio/mac/audio_low_latency_output_mac.cc b/media/audio/mac/audio_low_latency_output_mac.cc
index f6fabde293cc3cf9030b4298e52a0bee8c316c60..af23e6708f9bd2edaa0aae287b798d1b5b31e2a5 100644
--- a/media/audio/mac/audio_low_latency_output_mac.cc
+++ b/media/audio/mac/audio_low_latency_output_mac.cc
@@ -56,19 +56,19 @@ AUAudioOutputStream::AUAudioOutputStream(
// A frame is one sample across all channels. In interleaved audio the per
// frame fields identify the set of n |channels|. In uncompressed audio, a
// packet is always one frame.
- format_.mSampleRate = params.sample_rate;
+ format_.mSampleRate = params.sample_rate();
format_.mFormatID = kAudioFormatLinearPCM;
format_.mFormatFlags = kLinearPCMFormatFlagIsPacked |
kLinearPCMFormatFlagIsSignedInteger;
- format_.mBitsPerChannel = params.bits_per_sample;
- format_.mChannelsPerFrame = params.channels;
+ format_.mBitsPerChannel = params.bits_per_sample();
+ format_.mChannelsPerFrame = params.channels();
format_.mFramesPerPacket = 1;
- format_.mBytesPerPacket = (format_.mBitsPerChannel * params.channels) / 8;
+ format_.mBytesPerPacket = (format_.mBitsPerChannel * params.channels()) / 8;
format_.mBytesPerFrame = format_.mBytesPerPacket;
format_.mReserved = 0;
// Calculate the number of sample frames per callback.
- number_of_frames_ = params.GetPacketSize() / format_.mBytesPerPacket;
+ number_of_frames_ = params.GetBytesPerBuffer() / format_.mBytesPerPacket;
}
AUAudioOutputStream::~AUAudioOutputStream() {
@@ -252,7 +252,7 @@ OSStatus AUAudioOutputStream::InputProc(void* user_data,
return audio_output->Render(number_of_frames, io_data, output_time_stamp);
}
-double AUAudioOutputStream::HardwareSampleRate() {
+int AUAudioOutputStream::HardwareSampleRate() {
// Determine the default output device's sample-rate.
AudioDeviceID device_id = kAudioObjectUnknown;
UInt32 info_size = sizeof(device_id);
@@ -290,7 +290,7 @@ double AUAudioOutputStream::HardwareSampleRate() {
if (result)
return 0.0; // error
- return nominal_sample_rate;
+ return static_cast<int>(nominal_sample_rate);
}
double AUAudioOutputStream::GetHardwareLatency() {
« no previous file with comments | « media/audio/mac/audio_low_latency_output_mac.h ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698