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

Unified Diff: components/arc/audio/arc_audio_bridge.h

Issue 1817093003: Host-side implementation of ARC audio bridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated commit message Created 4 years, 9 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: components/arc/audio/arc_audio_bridge.h
diff --git a/components/arc/audio/arc_audio_bridge.h b/components/arc/audio/arc_audio_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f57043bc96b50327e9c4500f07ebb8fe1b8974f
--- /dev/null
+++ b/components/arc/audio/arc_audio_bridge.h
@@ -0,0 +1,43 @@
+// Copyright 2016 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 COMPONENTS_ARC_AUDIO_ARC_AUDIO_BRIDGE_H_
+#define COMPONENTS_ARC_AUDIO_ARC_AUDIO_BRIDGE_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "chromeos/audio/cras_audio_handler.h"
+#include "components/arc/arc_bridge_service.h"
+#include "components/arc/arc_service.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace arc {
+
+class ArcAudioBridge : public ArcService,
+ public ArcBridgeService::Observer,
+ public AudioHost,
+ public chromeos::CrasAudioHandler::AudioObserver {
+ public:
+ explicit ArcAudioBridge(ArcBridgeService* bridge_service);
+ ~ArcAudioBridge() override;
+
+ // ArcBridgeService::Observer overrides.
+ void OnAudioInstanceReady() override;
+
+ private:
+ mojo::Binding<AudioHost> binding_;
+ chromeos::CrasAudioHandler* cras_audio_handler_;
jennyz 2016/03/23 23:50:42 InitializeL cras_audio_handler_ = nullptr;
chinyue 2016/03/25 09:50:31 Done.
+
+ // chromeos::CrasAudioHandler::AudioObserver overrides.
+ void OnAudioNodesChanged() override;
+
+ void SendSwitchState(bool headphone_inserted, bool microphone_inserted);
+
+ DISALLOW_COPY_AND_ASSIGN(ArcAudioBridge);
+};
+
+} // namespace arc
+
+#endif // COMPONENTS_ARC_AUDIO_ARC_AUDIO_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698