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

Unified Diff: content/browser/renderer_host/media/render_frame_audio_output_service.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/render_frame_audio_output_service.h
diff --git a/content/browser/renderer_host/media/render_frame_audio_output_service.h b/content/browser/renderer_host/media/render_frame_audio_output_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..9c96c4a9b51ea7c68395d6b4715c20c3c1e135d7
--- /dev/null
+++ b/content/browser/renderer_host/media/render_frame_audio_output_service.h
@@ -0,0 +1,67 @@
+// 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_RENDER_FRAME_AUDIO_OUTPUT_SERVICE_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_RENDER_FRAME_AUDIO_OUTPUT_SERVICE_H_
+
+// Handles a RendererAudioOutputServiceRequest for a render frame host, using
+// the provided AudioOutputServiceContext.
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "content/common/content_export.h"
+#include "content/common/media/audio_output.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace content {
+
+class AudioOutputServiceContext;
+
+class CONTENT_EXPORT RenderFrameAudioOutputService
+ : public mojom::RendererAudioOutputService {
+ public:
+ RenderFrameAudioOutputService(
+ AudioOutputServiceContext* context,
+ int render_frame_id,
+ mojom::RendererAudioOutputServiceRequest request);
+
+ ~RenderFrameAudioOutputService() override;
+
+ private:
+ using AudioOutputVector = std::vector<std::unique_ptr<mojom::AudioOutput>>;
+
+ // mojom::RendererAudioOutputService implementation.
+ void RequestDeviceAuthorization(
+ mojom::AudioOutputRequest audio_output,
+ int64_t session_id,
+ const std::string& device_id,
+ const url::Origin& origin,
+ const RequestDeviceAuthorizationCallback& callback) override;
+
+ void AuthorizationCompleted(
+ const url::Origin& origin,
+ base::TimeTicks auth_start_time,
+ mojom::AudioOutputRequest request,
+ const RequestDeviceAuthorizationCallback& callback,
+ media::OutputDeviceStatus status,
+ bool should_send_id,
+ const media::AudioParameters& params,
+ const std::string& raw_device_id);
+
+ void RemoveOutput(mojom::AudioOutput* audio_output);
+
+ mojo::Binding<mojom::RendererAudioOutputService> binding_;
+ AudioOutputServiceContext* context_;
+ AudioOutputVector audio_outputs_;
+ const int render_frame_id_;
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(RenderFrameAudioOutputService);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_RENDER_FRAME_AUDIO_OUTPUT_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698