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

Side by Side Diff: content/renderer/media/audio_device_factory.h

Issue 1769933002: Looking up device id by session id for AudioRendererMixerInput (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to use AudioDeviceFactory::GetOutputDevice() in AudioRendererMixerManager; AudioDeviceFactor… Created 4 years, 8 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Basing on |source_type| and build configuration, audio played out through 72 // Basing on |source_type| and build configuration, audio played out through
73 // the sink goes to AOD directly or can be mixed with other audio before that. 73 // the sink goes to AOD directly or can be mixed with other audio before that.
74 static scoped_refptr<media::SwitchableAudioRendererSink> 74 static scoped_refptr<media::SwitchableAudioRendererSink>
75 NewSwitchableAudioRendererSink(SourceType source_type, 75 NewSwitchableAudioRendererSink(SourceType source_type,
76 int render_frame_id, 76 int render_frame_id,
77 int session_id, 77 int session_id,
78 const std::string& device_id, 78 const std::string& device_id,
79 const url::Origin& security_origin); 79 const url::Origin& security_origin);
80 80
81 // A helper to get device info in the absence of AudioOutputDevice. 81 // A helper to get device info in the absence of AudioOutputDevice.
82 static media::OutputDeviceInfo GetOutputDeviceInfo( 82 static const media::OutputDeviceInfo GetOutputDeviceInfo(
tommi (sloooow) - chröme 2016/04/08 13:47:47 why this change? the caller can make the variable
o1ka 2016/04/08 19:07:25 No-no, no ref. Removing const to avoid confusion.
83 int render_frame_id, 83 int render_frame_id,
84 int session_id, 84 int session_id,
85 const std::string& device_id, 85 const std::string& device_id,
86 const url::Origin& security_origin); 86 const url::Origin& security_origin);
87 87
88 // Creates an AudioCapturerSource using the currently registered factory. 88 // Creates an AudioCapturerSource using the currently registered factory.
89 // |render_frame_id| refers to the RenderFrame containing the entity 89 // |render_frame_id| refers to the RenderFrame containing the entity
90 // consuming the audio. 90 // consuming the audio.
91 static scoped_refptr<media::AudioCapturerSource> NewAudioCapturerSource( 91 static scoped_refptr<media::AudioCapturerSource> NewAudioCapturerSource(
92 int render_frame_id); 92 int render_frame_id);
93 93
94 protected: 94 protected:
95 AudioDeviceFactory(); 95 AudioDeviceFactory();
96 virtual ~AudioDeviceFactory(); 96 virtual ~AudioDeviceFactory();
97 97
98 // You can derive from this class and specify an implementation for these 98 // You can derive from this class and specify an implementation for these
99 // functions to provide alternate audio device implementations. 99 // functions to provide alternate audio device implementations.
100 // If the return value of either of these function is NULL, we fall back 100 // If the return value of either of these function is NULL, we fall back
101 // on the default implementation. 101 // on the default implementation.
102 virtual scoped_refptr<media::AudioRendererSink> CreateAudioRendererMixerSink( 102
103 // Creates a final sink in the rendering pipeline, which represents the actual
104 // output device.
105 virtual scoped_refptr<media::AudioRendererSink> CreateFinalAudioRendererSink(
103 int render_frame_id, 106 int render_frame_id,
104 int sesssion_id, 107 int sesssion_id,
105 const std::string& device_id, 108 const std::string& device_id,
106 const url::Origin& security_origin) = 0; 109 const url::Origin& security_origin) = 0;
107 110
108 virtual scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink( 111 virtual scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink(
109 SourceType source_type, 112 SourceType source_type,
110 int render_frame_id, 113 int render_frame_id,
111 int sesssion_id, 114 int sesssion_id,
112 const std::string& device_id, 115 const std::string& device_id,
113 const url::Origin& security_origin) = 0; 116 const url::Origin& security_origin) = 0;
114 117
115 virtual scoped_refptr<media::SwitchableAudioRendererSink> 118 virtual scoped_refptr<media::SwitchableAudioRendererSink>
116 CreateSwitchableAudioRendererSink(SourceType source_type, 119 CreateSwitchableAudioRendererSink(SourceType source_type,
117 int render_frame_id, 120 int render_frame_id,
118 int sesssion_id, 121 int sesssion_id,
119 const std::string& device_id, 122 const std::string& device_id,
120 const url::Origin& security_origin) = 0; 123 const url::Origin& security_origin) = 0;
121 124
122 virtual scoped_refptr<media::AudioCapturerSource> CreateAudioCapturerSource( 125 virtual scoped_refptr<media::AudioCapturerSource> CreateAudioCapturerSource(
123 int render_frame_id) = 0; 126 int render_frame_id) = 0;
124 127
125 private: 128 private:
126 // The current globally registered factory. This is NULL when we should 129 // The current globally registered factory. This is NULL when we should
127 // create the default AudioRendererSinks. 130 // create the default AudioRendererSinks.
128 static AudioDeviceFactory* factory_; 131 static AudioDeviceFactory* factory_;
129 132
133 static scoped_refptr<media::AudioRendererSink> NewFinalAudioRendererSink(
134 int render_frame_id,
135 int session_id,
136 const std::string& device_id,
137 const url::Origin& security_origin);
138
130 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); 139 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory);
131 }; 140 };
132 141
133 } // namespace content 142 } // namespace content
134 143
135 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ 144 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698