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

Unified Diff: remoting/host/win/audio_volume_filter_win.h

Issue 2840773004: [Chromoting] Add AudioVolumeApplier to reduce the complexity and the dependency of kChannels (Closed)
Patch Set: Resolve review comments Created 3 years, 8 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: remoting/host/win/audio_volume_filter_win.h
diff --git a/remoting/host/win/audio_volume_filter_win.h b/remoting/host/win/audio_volume_filter_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..994b849e9ebf5664442ac2a29e2c0c94ca7d7d8a
--- /dev/null
+++ b/remoting/host/win/audio_volume_filter_win.h
@@ -0,0 +1,36 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_WIN_AUDIO_VOLUME_FILTER_WIN_H_
+#define REMOTING_HOST_WIN_AUDIO_VOLUME_FILTER_WIN_H_
+
+#include <endpointvolume.h>
+#include <mmdeviceapi.h>
+
+#include "base/win/scoped_comptr.h"
+#include "remoting/host/audio_volume_filter.h"
+
+namespace remoting {
+
+// An implementation of AudioVolumeFilter for Windows only.
+class AudioVolumeFilterWin : public AudioVolumeFilter {
+ public:
+ explicit AudioVolumeFilterWin(int silence_threshold);
+ ~AudioVolumeFilterWin() override;
+
+ // Initializes |audio_volume_|. Returns false if Windows APIs fail.
+ bool ActivateBy(IMMDevice* mm_device);
+
+ protected:
+ // Returns current audio level from |audio_volume_|. If the initialization
+ // failed, this function returns 1.
+ float GetAudioLevel() override;
+
+ private:
+ base::win::ScopedComPtr<IAudioEndpointVolume> audio_volume_;
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_WIN_AUDIO_VOLUME_FILTER_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698