Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 MEDIA_BASE_AUDIO_RENDERER_MIXER_POOL_H_ | |
| 6 #define MEDIA_BASE_AUDIO_RENDERER_MIXER_POOL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "media/base/output_device_info.h" | |
| 11 | |
| 12 namespace url { | |
| 13 class Origin; | |
| 14 } | |
| 15 | |
| 16 namespace media { | |
| 17 class AudioParameters; | |
| 18 class AudioRendererMixer; | |
| 19 | |
| 20 // Provides AudioRendererMixer instances for shared usage. | |
| 21 // Thread safe. | |
| 22 class MEDIA_EXPORT AudioRendererMixerPool { | |
| 23 public: | |
| 24 AudioRendererMixerPool() {} | |
| 25 virtual ~AudioRendererMixerPool() {} | |
| 26 | |
| 27 // Obtains a pointer to mixer instance based on AudioParameters. The pointer | |
| 28 // is guaranteed to be valid (at least) until it's rereleased by a call to | |
| 29 // ReturnMixer(). | |
| 30 virtual AudioRendererMixer* GetMixer(int owner_id, | |
| 31 const AudioParameters& params, | |
| 32 const std::string& device_id, | |
| 33 const url::Origin& security_origin, | |
| 34 OutputDeviceStatus* device_status) = 0; | |
| 35 | |
| 36 // Returns mixer back to the pool, must be called when the mixer is not needed | |
| 37 // any more to avoid memory leakage. | |
| 38 virtual void ReturnMixer(int owner_id, | |
|
miu
2016/05/25 01:23:20
Not sure if this was already addressed in other re
o1ka
2016/05/25 12:20:52
Yes, that discussion was for SinkCache and I rever
| |
| 39 const AudioParameters& params, | |
| 40 const std::string& device_id, | |
| 41 const url::Origin& security_origin) = 0; | |
| 42 | |
| 43 // Returns output device information | |
| 44 virtual OutputDeviceInfo GetOutputDeviceInfo( | |
| 45 int owner_id, | |
| 46 int session_id, | |
| 47 const std::string& device_id, | |
| 48 const url::Origin& security_origin) = 0; | |
| 49 | |
| 50 private: | |
| 51 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerPool); | |
| 52 }; | |
| 53 | |
| 54 } // namespace media | |
| 55 | |
| 56 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_POOL_H_ | |
| OLD | NEW |