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

Side by Side Diff: media/audio/audio_output_resampler.h

Issue 23466008: Wire up the output device id and provide an implementation on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update comments Created 7 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
« no previous file with comments | « media/audio/audio_output_proxy_unittest.cc ('k') | media/audio/audio_output_resampler.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_AUDIO_OUTPUT_RESAMPLER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_ 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 22 matching lines...) Expand all
33 // 33 //
34 // TODO(dalecurtis): Ideally the low latency path will be as reliable as the 34 // TODO(dalecurtis): Ideally the low latency path will be as reliable as the
35 // high latency path once we have channel mixing and support querying for the 35 // high latency path once we have channel mixing and support querying for the
36 // hardware's configured bit depth. Monitor the UMA stats for fallback and 36 // hardware's configured bit depth. Monitor the UMA stats for fallback and
37 // remove fallback support once it's stable. http://crbug.com/148418 37 // remove fallback support once it's stable. http://crbug.com/148418
38 class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher { 38 class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher {
39 public: 39 public:
40 AudioOutputResampler(AudioManager* audio_manager, 40 AudioOutputResampler(AudioManager* audio_manager,
41 const AudioParameters& input_params, 41 const AudioParameters& input_params,
42 const AudioParameters& output_params, 42 const AudioParameters& output_params,
43 const std::string& output_device_id,
43 const std::string& input_device_id, 44 const std::string& input_device_id,
44 const base::TimeDelta& close_delay); 45 const base::TimeDelta& close_delay);
45 46
46 // AudioOutputDispatcher interface. 47 // AudioOutputDispatcher interface.
47 virtual bool OpenStream() OVERRIDE; 48 virtual bool OpenStream() OVERRIDE;
48 virtual bool StartStream(AudioOutputStream::AudioSourceCallback* callback, 49 virtual bool StartStream(AudioOutputStream::AudioSourceCallback* callback,
49 AudioOutputProxy* stream_proxy) OVERRIDE; 50 AudioOutputProxy* stream_proxy) OVERRIDE;
50 virtual void StopStream(AudioOutputProxy* stream_proxy) OVERRIDE; 51 virtual void StopStream(AudioOutputProxy* stream_proxy) OVERRIDE;
51 virtual void StreamVolumeSet(AudioOutputProxy* stream_proxy, 52 virtual void StreamVolumeSet(AudioOutputProxy* stream_proxy,
52 double volume) OVERRIDE; 53 double volume) OVERRIDE;
(...skipping 14 matching lines...) Expand all
67 // on every StartStream() call and destroyed on CloseStream(). 68 // on every StartStream() call and destroyed on CloseStream().
68 typedef std::map<AudioOutputProxy*, OnMoreDataConverter*> CallbackMap; 69 typedef std::map<AudioOutputProxy*, OnMoreDataConverter*> CallbackMap;
69 CallbackMap callbacks_; 70 CallbackMap callbacks_;
70 71
71 // Used by AudioOutputDispatcherImpl; kept so we can reinitialize on the fly. 72 // Used by AudioOutputDispatcherImpl; kept so we can reinitialize on the fly.
72 base::TimeDelta close_delay_; 73 base::TimeDelta close_delay_;
73 74
74 // AudioParameters used to setup the output stream. 75 // AudioParameters used to setup the output stream.
75 AudioParameters output_params_; 76 AudioParameters output_params_;
76 77
77 // Device ID to be used by the unified IO to open the correct input device.
78 const std::string input_device_id_;
79
80 // Whether any streams have been opened through |dispatcher_|, if so we can't 78 // Whether any streams have been opened through |dispatcher_|, if so we can't
81 // fallback on future OpenStream() failures. 79 // fallback on future OpenStream() failures.
82 bool streams_opened_; 80 bool streams_opened_;
83 81
84 DISALLOW_COPY_AND_ASSIGN(AudioOutputResampler); 82 DISALLOW_COPY_AND_ASSIGN(AudioOutputResampler);
85 }; 83 };
86 84
87 } // namespace media 85 } // namespace media
88 86
89 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_ 87 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_
OLDNEW
« no previous file with comments | « media/audio/audio_output_proxy_unittest.cc ('k') | media/audio/audio_output_resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698