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

Side by Side Diff: media/audio/linux/alsa_output_unittest.cc

Issue 10830268: Allow audio system to handle synchronized low-latency audio I/O (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « media/audio/audio_output_resampler.cc ('k') | media/audio/linux/cras_output_unittest.cc » ('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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "media/audio/linux/alsa_output.h" 7 #include "media/audio/linux/alsa_output.h"
8 #include "media/audio/linux/alsa_wrapper.h" 8 #include "media/audio/linux/alsa_wrapper.h"
9 #include "media/audio/linux/audio_manager_linux.h" 9 #include "media/audio/linux/audio_manager_linux.h"
10 #include "media/base/data_buffer.h" 10 #include "media/base/data_buffer.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 MOCK_METHOD1(PcmState, snd_pcm_state_t(snd_pcm_t* handle)); 63 MOCK_METHOD1(PcmState, snd_pcm_state_t(snd_pcm_t* handle));
64 MOCK_METHOD1(PcmStart, int(snd_pcm_t* handle)); 64 MOCK_METHOD1(PcmStart, int(snd_pcm_t* handle));
65 65
66 MOCK_METHOD1(StrError, const char*(int errnum)); 66 MOCK_METHOD1(StrError, const char*(int errnum));
67 }; 67 };
68 68
69 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { 69 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback {
70 public: 70 public:
71 MOCK_METHOD2(OnMoreData, int(AudioBus* audio_bus, 71 MOCK_METHOD2(OnMoreData, int(AudioBus* audio_bus,
72 AudioBuffersState buffers_state)); 72 AudioBuffersState buffers_state));
73 MOCK_METHOD3(OnMoreIOData, int(AudioBus* source,
74 AudioBus* dest,
75 AudioBuffersState buffers_state));
73 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); 76 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code));
74 }; 77 };
75 78
76 class MockAudioManagerLinux : public AudioManagerLinux { 79 class MockAudioManagerLinux : public AudioManagerLinux {
77 public: 80 public:
78 MOCK_METHOD0(Init, void()); 81 MOCK_METHOD0(Init, void());
79 MOCK_METHOD0(HasAudioOutputDevices, bool()); 82 MOCK_METHOD0(HasAudioOutputDevices, bool());
80 MOCK_METHOD0(HasAudioInputDevices, bool()); 83 MOCK_METHOD0(HasAudioInputDevices, bool());
81 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( 84 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*(
82 const AudioParameters& params)); 85 const AudioParameters& params));
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 855
853 // TODO(ajwong): Find a way to test whether or not another task has been 856 // TODO(ajwong): Find a way to test whether or not another task has been
854 // posted so we can verify that the Alsa code will indeed break the task 857 // posted so we can verify that the Alsa code will indeed break the task
855 // posting loop. 858 // posting loop.
856 859
857 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); 860 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed);
858 test_stream->Close(); 861 test_stream->Close();
859 } 862 }
860 863
861 } // namespace media 864 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_resampler.cc ('k') | media/audio/linux/cras_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698