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

Unified Diff: media/audio/win/audio_low_latency_input_win.h

Issue 2690793002: Add basic resample support to WASAPIAudioInputStream. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/win/audio_low_latency_input_win.h
diff --git a/media/audio/win/audio_low_latency_input_win.h b/media/audio/win/audio_low_latency_input_win.h
index 09aeaf9976520f012abe79822ef3d7b0eb5619d5..94307ade840cd2a734a7a2d06e944c9714f8b340 100644
--- a/media/audio/win/audio_low_latency_input_win.h
+++ b/media/audio/win/audio_low_latency_input_win.h
@@ -82,6 +82,7 @@ namespace media {
class AudioBus;
class AudioManagerWin;
+class MultiChannelResampler;
// AudioInputStream implementation using Windows Core Audio APIs.
class MEDIA_EXPORT WASAPIAudioInputStream
@@ -125,6 +126,10 @@ class MEDIA_EXPORT WASAPIAudioInputStream
HRESULT InitializeAudioEngine();
void ReportOpenResult() const;
+ // Provides input to the MultiChannelResampler. Called by the resampler when
+ // more data is necessary.
+ void ProvideInput(int resampler_frame_delay, AudioBus* audio_bus);
+
// Used to track down where we fail during initialization which at the
// moment seems to be happening frequently and we're not sure why.
// The reason might be expected (e.g. trying to open "default" on a machine
@@ -146,7 +151,8 @@ class MEDIA_EXPORT WASAPIAudioInputStream
OPEN_RESULT_SET_EVENT_HANDLE = 11,
OPEN_RESULT_NO_CAPTURE_CLIENT = 12,
OPEN_RESULT_NO_AUDIO_VOLUME = 13,
- OPEN_RESULT_MAX = OPEN_RESULT_NO_AUDIO_VOLUME
+ OPEN_RESULT_OK_WITH_RESAMPLING = 14,
+ OPEN_RESULT_MAX = OPEN_RESULT_OK_WITH_RESAMPLING
};
// Our creator, the audio manager needs to be notified when we close.
@@ -243,6 +249,11 @@ class MEDIA_EXPORT WASAPIAudioInputStream
// indicates that we need to unmute the system audio when stopping capturing.
bool mute_done_ = false;
+ // If the caller requires resampling (should only be in exceptional cases and
+ // ideally, never), we support using a MultiChannelResampler.
+ std::unique_ptr<MultiChannelResampler> resampler_;
+ std::unique_ptr<AudioBus> resample_bus_;
+
DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream);
};
« no previous file with comments | « no previous file | media/audio/win/audio_low_latency_input_win.cc » ('j') | media/audio/win/audio_low_latency_input_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698