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

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

Issue 2319493002: Add mojo interface for audio rendering. (Closed)
Patch Set: ++docs 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: content/browser/renderer_host/media/audio_output_service_context_impl.h
diff --git a/content/browser/renderer_host/media/audio_output_service_context_impl.h b/content/browser/renderer_host/media/audio_output_service_context_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..fafb8a806131701368ba6326728eabaa6da31bc9
--- /dev/null
+++ b/content/browser/renderer_host/media/audio_output_service_context_impl.h
@@ -0,0 +1,71 @@
+// 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_IMPL_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_IMPL_H_
+
+// In addition to being an AudioOutputServiceContext, this class also handles
+// requests for mojom::RendererAudioOutputService instances.
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "content/browser/renderer_host/media/audio_output_service_context.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+
+namespace media {
+class AudioManager;
+} // namespace media
+
+namespace content {
+
+class MediaStreamManager;
+
+class CONTENT_EXPORT AudioOutputServiceContextImpl
+ : public AudioOutputServiceContext {
+ public:
+ AudioOutputServiceContextImpl(int render_process_id,
+ media::AudioManager* audio_manager,
+ MediaStreamManager* media_stream_manager,
+ const std::string& salt);
+
+ ~AudioOutputServiceContextImpl() override;
+
+ void CreateService(
+ int frame_host_id,
+ mojo::InterfaceRequest<mojom::RendererAudioOutputService> request);
+
+ int GetRenderProcessId() const override;
+
+ void RequestDeviceAuthorization(
+ int render_frame_id,
+ int session_id,
+ const std::string& device_id,
+ const url::Origin& security_origin,
+ AuthorizationCompletedCallback cb) const override;
+
+ const std::string& GetSalt() const override;
+
+ std::unique_ptr<AudioOutputDelegate> CreateDelegate(
+ const std::string& unique_device_id,
+ int render_frame_id,
+ AudioOutputDelegate::EventHandler* handler,
+ const media::AudioParameters& params) override;
+
+ void OnServiceFinished(mojom::RendererAudioOutputService* service) override;
+
+ private:
+ const int render_process_id_;
+ media::AudioManager* const audio_manager_;
+ MediaStreamManager* const media_stream_manager_;
+ const std::string salt_;
+ const AudioOutputAuthorizationHandler authorization_handler_;
+ int next_stream_id_ = 0;
+ std::vector<std::unique_ptr<mojom::RendererAudioOutputService>> services_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698