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

Side by Side Diff: media/audio/win/audio_low_latency_output_win_unittest.cc

Issue 9691001: Audio software mixer. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: 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 #include <windows.h> 5 #include <windows.h>
6 #include <mmsystem.h> 6 #include <mmsystem.h>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 AudioParameters::Format format() const { return format_; } 191 AudioParameters::Format format() const { return format_; }
192 int channels() const { return ChannelLayoutToChannelCount(channel_layout_); } 192 int channels() const { return ChannelLayoutToChannelCount(channel_layout_); }
193 int bits_per_sample() const { return bits_per_sample_; } 193 int bits_per_sample() const { return bits_per_sample_; }
194 int sample_rate() const { return sample_rate_; } 194 int sample_rate() const { return sample_rate_; }
195 int samples_per_packet() const { return samples_per_packet_; } 195 int samples_per_packet() const { return samples_per_packet_; }
196 196
197 private: 197 private:
198 AudioOutputStream* CreateOutputStream() { 198 AudioOutputStream* CreateOutputStream() {
199 AudioOutputStream* aos = audio_man_->MakeAudioOutputStream( 199 AudioOutputStream* aos = audio_man_->MakeAudioOutputStream(
200 AudioParameters(format_, channel_layout_, sample_rate_, 200 AudioParameters(format_, false, channel_layout_, sample_rate_,
201 bits_per_sample_, samples_per_packet_)); 201 bits_per_sample_, samples_per_packet_));
202 EXPECT_TRUE(aos); 202 EXPECT_TRUE(aos);
203 return aos; 203 return aos;
204 } 204 }
205 205
206 ScopedCOMInitializer com_init_; 206 ScopedCOMInitializer com_init_;
207 AudioManager* audio_man_; 207 AudioManager* audio_man_;
208 AudioParameters::Format format_; 208 AudioParameters::Format format_;
209 ChannelLayout channel_layout_; 209 ChannelLayout channel_layout_;
210 int bits_per_sample_; 210 int bits_per_sample_;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 aos->Start(&file_source); 535 aos->Start(&file_source);
536 base::PlatformThread::Sleep( 536 base::PlatformThread::Sleep(
537 base::TimeDelta::FromMilliseconds(kFileDurationMs)); 537 base::TimeDelta::FromMilliseconds(kFileDurationMs));
538 aos->Stop(); 538 aos->Stop();
539 539
540 LOG(INFO) << ">> File playout has stopped."; 540 LOG(INFO) << ">> File playout has stopped.";
541 aos->Close(); 541 aos->Close();
542 } 542 }
543 543
544 } // namespace media 544 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698