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

Side by Side Diff: media/audio/win/wavein_input_win.h

Issue 344583002: Modifies AudioInputCallback::OnData and use media::AudioBus instead of plain byte vector (Relanding) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added extra non-pure OnData API Created 6 years, 6 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_WIN_WAVEIN_INPUT_WIN_H_ 5 #ifndef MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_
6 #define MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ 6 #define MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include <windows.h> 10 #include <windows.h>
11 #include <mmsystem.h> 11 #include <mmsystem.h>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
16 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
17 #include "base/win/scoped_handle.h" 17 #include "base/win/scoped_handle.h"
18 #include "media/audio/audio_io.h" 18 #include "media/audio/audio_io.h"
19 #include "media/audio/audio_parameters.h" 19 #include "media/audio/audio_parameters.h"
20 20
21 namespace media { 21 namespace media {
22 22
23 class AudioBus;
23 class AudioManagerWin; 24 class AudioManagerWin;
24 25
25 class PCMWaveInAudioInputStream : public AudioInputStream { 26 class PCMWaveInAudioInputStream : public AudioInputStream {
26 public: 27 public:
27 // The ctor takes all the usual parameters, plus |manager| which is the 28 // The ctor takes all the usual parameters, plus |manager| which is the
28 // the audio manager who is creating this object and |device_id| which 29 // the audio manager who is creating this object and |device_id| which
29 // is provided by the operating system. 30 // is provided by the operating system.
30 PCMWaveInAudioInputStream(AudioManagerWin* manager, 31 PCMWaveInAudioInputStream(AudioManagerWin* manager,
31 const AudioParameters& params, 32 const AudioParameters& params,
32 int num_buffers, 33 int num_buffers,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 117
117 // Pointer to the first allocated audio buffer. This object owns it. 118 // Pointer to the first allocated audio buffer. This object owns it.
118 WAVEHDR* buffer_; 119 WAVEHDR* buffer_;
119 120
120 // An event that is signaled when the callback thread is ready to stop. 121 // An event that is signaled when the callback thread is ready to stop.
121 base::win::ScopedHandle stopped_event_; 122 base::win::ScopedHandle stopped_event_;
122 123
123 // Lock used to avoid conflicts when Stop() is called during a callback. 124 // Lock used to avoid conflicts when Stop() is called during a callback.
124 base::Lock lock_; 125 base::Lock lock_;
125 126
127 // Extra audio bus used for storage of deinterleaved data for the OnData
128 // callback.
129 scoped_ptr<media::AudioBus> audio_bus_;
130
126 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); 131 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream);
127 }; 132 };
128 133
129 } // namespace media 134 } // namespace media
130 135
131 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ 136 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_
OLDNEW
« no previous file with comments | « media/audio/win/audio_low_latency_input_win_unittest.cc ('k') | media/audio/win/wavein_input_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698