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

Side by Side Diff: content/browser/renderer_host/media/audio_output_stream_factory_context.h

Issue 2697663003: Add mojo interface+impl creation of audio streams. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_STREAM_FACTORY_CONTEXT_ H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_STREAM_FACTORY_CONTEXT_ H_
7
8 #include <memory>
9 #include <string>
10
11 #include "content/browser/renderer_host/media/audio_output_authorization_handler .h"
12 #include "content/common/content_export.h"
13 #include "media/audio/audio_output_delegate.h"
14
15 namespace media {
16 class AudioParameters;
17 }
18
19 namespace content {
20
21 namespace mojom {
22 class RendererAudioOutputStreamFactory;
23 } // namespace mojom
24
25 // AudioOutputStreamFactoryContext provides functions common to all
26 // AudioOutputFactory instances for a single renderer process.
27 class CONTENT_EXPORT AudioOutputStreamFactoryContext {
o1ka 2017/03/21 16:20:17 I'd prefer RendererAudioOutputStreamFactoryContext
Max Morin 2017/03/22 13:18:29 Done.
28 public:
29 virtual ~AudioOutputStreamFactoryContext() {}
30
31 using AuthorizationCompletedCallback =
32 AudioOutputAuthorizationHandler::AuthorizationCompletedCallback;
33
34 virtual int GetRenderProcessId() const = 0;
35 virtual const std::string& GetSalt() const = 0;
36
37 // Called to request access to a device on behalf of the renderer.
38 virtual void RequestDeviceAuthorization(
39 int render_frame_id,
40 int session_id,
41 const std::string& device_id,
42 const url::Origin& security_origin,
43 AuthorizationCompletedCallback cb) const = 0;
44
45 virtual std::unique_ptr<media::AudioOutputDelegate> CreateDelegate(
46 const std::string& unique_device_id,
47 int render_frame_id,
48 const media::AudioParameters& params,
49 media::AudioOutputDelegate::EventHandler* handler) = 0;
50
51 // Should be called by a service when it's done or has encountered an error.
52 // Will delete |service|.
53 virtual void OnFactoryFinished(
54 mojom::RendererAudioOutputStreamFactory* service) = 0;
55 };
56
57 } // namespace content
58
59 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_STREAM_FACTORY_CONT EXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698