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

Side by Side Diff: media/audio/mac/audio_input_mac.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
« no previous file with comments | « media/audio/fake_audio_input_stream.cc ('k') | media/audio/mac/audio_input_mac.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 #ifndef MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ 5 #ifndef MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_
6 #define MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ 6 #define MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_
7 7
8 #include <AudioToolbox/AudioFormat.h> 8 #include <AudioToolbox/AudioFormat.h>
9 #include <AudioToolbox/AudioQueue.h> 9 #include <AudioToolbox/AudioQueue.h>
10 10
11 #include "base/cancelable_callback.h" 11 #include "base/cancelable_callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "media/audio/audio_io.h" 14 #include "media/audio/audio_io.h"
15 #include "media/audio/audio_parameters.h" 15 #include "media/audio/audio_parameters.h"
16 16
17 namespace media { 17 namespace media {
18 18
19 class AudioBus;
19 class AudioManagerMac; 20 class AudioManagerMac;
20 21
21 // Implementation of AudioInputStream for Mac OS X using the audio queue service 22 // Implementation of AudioInputStream for Mac OS X using the audio queue service
22 // present in OS 10.5 and later. Design reflects PCMQueueOutAudioOutputStream. 23 // present in OS 10.5 and later. Design reflects PCMQueueOutAudioOutputStream.
23 class PCMQueueInAudioInputStream : public AudioInputStream { 24 class PCMQueueInAudioInputStream : public AudioInputStream {
24 public: 25 public:
25 // Parameters as per AudioManager::MakeAudioInputStream. 26 // Parameters as per AudioManager::MakeAudioInputStream.
26 PCMQueueInAudioInputStream(AudioManagerMac* manager, 27 PCMQueueInAudioInputStream(AudioManagerMac* manager,
27 const AudioParameters& params); 28 const AudioParameters& params);
28 virtual ~PCMQueueInAudioInputStream(); 29 virtual ~PCMQueueInAudioInputStream();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 AudioQueueRef audio_queue_; 77 AudioQueueRef audio_queue_;
77 // Size of each of the buffers in |audio_buffers_| 78 // Size of each of the buffers in |audio_buffers_|
78 uint32 buffer_size_bytes_; 79 uint32 buffer_size_bytes_;
79 // True iff Start() has been called successfully. 80 // True iff Start() has been called successfully.
80 bool started_; 81 bool started_;
81 // Used to determine if we need to slow down |callback_| calls. 82 // Used to determine if we need to slow down |callback_| calls.
82 base::TimeTicks last_fill_; 83 base::TimeTicks last_fill_;
83 // Used to defer Start() to workaround http://crbug.com/160920. 84 // Used to defer Start() to workaround http://crbug.com/160920.
84 base::CancelableClosure deferred_start_cb_; 85 base::CancelableClosure deferred_start_cb_;
85 86
87 scoped_ptr<media::AudioBus> audio_bus_;
88
86 DISALLOW_COPY_AND_ASSIGN(PCMQueueInAudioInputStream); 89 DISALLOW_COPY_AND_ASSIGN(PCMQueueInAudioInputStream);
87 }; 90 };
88 91
89 } // namespace media 92 } // namespace media
90 93
91 #endif // MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ 94 #endif // MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_
OLDNEW
« no previous file with comments | « media/audio/fake_audio_input_stream.cc ('k') | media/audio/mac/audio_input_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698