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

Unified Diff: content/browser/renderer_host/media/audio_output_service_context.h

Issue 2319493002: Add mojo interface for audio rendering. (Closed)
Patch Set: Refactor factory. Created 3 years, 11 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: content/browser/renderer_host/media/audio_output_service_context.h
diff --git a/content/browser/renderer_host/media/audio_output_service_context.h b/content/browser/renderer_host/media/audio_output_service_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..684fc322a1979476b3c8ecf52c754d3bf79dbcca
--- /dev/null
+++ b/content/browser/renderer_host/media/audio_output_service_context.h
@@ -0,0 +1,77 @@
+// 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "content/browser/renderer_host/media/audio_output_authorization_handler.h"
+#include "content/browser/renderer_host/media/audio_output_delegate.h"
+#include "content/common/content_export.h"
+#include "media/mojo/interfaces/audio_output.mojom.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+
+namespace media {
+class AudioManager;
+
+namespace mojom {
+class AudioOutputService;
+} // namespace mojom
+} // namespace media
+
+namespace content {
+
+class AudioMirroringManager;
+class AudioOutputServiceImpl;
+class MediaStreamManager;
+
+class CONTENT_EXPORT AudioOutputServiceContext {
+ public:
+ AudioOutputServiceContext(int render_process_id,
+ media::AudioManager* audio_manager,
+ MediaStreamManager* media_stream_manager,
+ AudioMirroringManager* mirroring_manager,
+ const std::string& salt);
+ ~AudioOutputServiceContext();
+
+ void CreateService(
+ int frame_host_id,
+ mojo::InterfaceRequest<media::mojom::AudioOutputService> request);
+
+ void ServiceHadConnectionError(AudioOutputServiceImpl* service);
+
+ // Accessors for data common to all AudioOutputServiceImpls for a single
+ // render process.
+ int render_process_id() const { return render_process_id_; }
+
+ const AudioOutputAuthorizationHandler* authorization_handler() const {
+ return &authorization_handler_;
+ }
+
+ const std::string& salt() const { return salt_; }
+
+ AudioOutputDelegate::UniquePtr CreateDelegate(
+ const std::string& unique_device_id,
+ int render_frame_id,
+ AudioOutputDelegate::EventHandler* handler,
+ const media::AudioParameters& params);
+
+ private:
+ const int render_process_id_;
+ media::AudioManager* const audio_manager_;
o1ka 2017/01/25 15:15:21 It would be great to avoid duplications between Au
+ MediaStreamManager* const media_stream_manager_;
+ AudioMirroringManager* const mirroring_manager_;
+ const std::string salt_;
+ AudioOutputAuthorizationHandler authorization_handler_;
+ int next_stream_id_ = 0;
+
+ std::vector<std::unique_ptr<AudioOutputServiceImpl>> services_;
o1ka 2017/01/25 15:15:21 Can't you manage it with StrongBindingSet instead?
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698