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

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

Issue 1102573006: Update {virtual,override} to follow C++11 style in media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « media/audio/openbsd/audio_manager_openbsd.h ('k') | media/base/fake_audio_render_callback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 num_received_audio_frames_(0) {} 55 num_received_audio_frames_(0) {}
56 56
57 bool error() const { return error_; } 57 bool error() const { return error_; }
58 int num_received_audio_frames() const { return num_received_audio_frames_; } 58 int num_received_audio_frames() const { return num_received_audio_frames_; }
59 59
60 // Waits until OnData() is called on another thread. 60 // Waits until OnData() is called on another thread.
61 void WaitForData() { 61 void WaitForData() {
62 data_event_.Wait(); 62 data_event_.Wait();
63 } 63 }
64 64
65 virtual void OnData(AudioInputStream* stream, 65 void OnData(AudioInputStream* stream,
66 const AudioBus* src, 66 const AudioBus* src,
67 uint32 hardware_delay_bytes, 67 uint32 hardware_delay_bytes,
68 double volume) override { 68 double volume) override {
69 EXPECT_NE(hardware_delay_bytes, 0u); 69 EXPECT_NE(hardware_delay_bytes, 0u);
70 num_received_audio_frames_ += src->frames(); 70 num_received_audio_frames_ += src->frames();
71 data_event_.Signal(); 71 data_event_.Signal();
72 } 72 }
73 73
74 virtual void OnError(AudioInputStream* stream) override { 74 void OnError(AudioInputStream* stream) override {
75 error_ = true; 75 error_ = true;
76 } 76 }
77 77
78 private: 78 private:
79 int num_received_audio_frames_; 79 int num_received_audio_frames_;
80 base::WaitableEvent data_event_; 80 base::WaitableEvent data_event_;
81 bool error_; 81 bool error_;
82 82
83 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputCallback); 83 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputCallback);
84 }; 84 };
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); 470 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample());
471 VLOG(0) << ">> Speak into the default microphone while recording."; 471 VLOG(0) << ">> Speak into the default microphone while recording.";
472 ais->Start(&file_sink); 472 ais->Start(&file_sink);
473 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); 473 base::PlatformThread::Sleep(TestTimeouts::action_timeout());
474 ais->Stop(); 474 ais->Stop();
475 VLOG(0) << ">> Recording has stopped."; 475 VLOG(0) << ">> Recording has stopped.";
476 ais.Close(); 476 ais.Close();
477 } 477 }
478 478
479 } // namespace media 479 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/openbsd/audio_manager_openbsd.h ('k') | media/base/fake_audio_render_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698