Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 #ifndef WEBRTC_API_CALL_AUDIO_STATE_H_ | 10 #ifndef WEBRTC_API_CALL_AUDIO_STATE_H_ |
| 11 #define WEBRTC_API_CALL_AUDIO_STATE_H_ | 11 #define WEBRTC_API_CALL_AUDIO_STATE_H_ |
| 12 | 12 |
| 13 #include "webrtc/api/audio/audio_mixer.h" | |
| 13 #include "webrtc/base/refcount.h" | 14 #include "webrtc/base/refcount.h" |
| 14 #include "webrtc/base/scoped_ref_ptr.h" | 15 #include "webrtc/base/scoped_ref_ptr.h" |
| 15 | 16 |
| 16 namespace webrtc { | 17 namespace webrtc { |
| 17 | 18 |
| 18 class AudioDeviceModule; | 19 class AudioDeviceModule; |
| 19 class VoiceEngine; | 20 class VoiceEngine; |
| 20 | 21 |
| 21 // WORK IN PROGRESS | 22 // WORK IN PROGRESS |
| 22 // This class is under development and is not yet intended for for use outside | 23 // This class is under development and is not yet intended for for use outside |
| 23 // of WebRtc/Libjingle. Please use the VoiceEngine API instead. | 24 // of WebRtc/Libjingle. Please use the VoiceEngine API instead. |
| 24 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690 | 25 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690 |
| 25 | 26 |
| 26 // AudioState holds the state which must be shared between multiple instances of | 27 // AudioState holds the state which must be shared between multiple instances of |
| 27 // webrtc::Call for audio processing purposes. | 28 // webrtc::Call for audio processing purposes. |
| 28 class AudioState : public rtc::RefCountInterface { | 29 class AudioState : public rtc::RefCountInterface { |
| 29 public: | 30 public: |
| 30 struct Config { | 31 struct Config { |
| 31 // VoiceEngine used for audio streams and audio/video synchronization. | 32 // VoiceEngine used for audio streams and audio/video synchronization. |
| 32 // AudioState will tickle the VoE refcount to keep it alive for as long as | 33 // AudioState will tickle the VoE refcount to keep it alive for as long as |
| 33 // the AudioState itself. | 34 // the AudioState itself. |
| 34 VoiceEngine* voice_engine = nullptr; | 35 VoiceEngine* voice_engine = nullptr; |
| 35 | 36 |
| 36 // The AudioDeviceModule associated with the Calls. | 37 // The audio mixer connected to active receive streams. One per |
| 37 AudioDeviceModule* audio_device_module = nullptr; | 38 // AudioState. |
|
aleloi
2016/10/31 11:45:01
This field is currently unused, and AudioState get
kwiberg-webrtc
2016/10/31 12:31:06
Acknowledged.
| |
| 39 rtc::scoped_refptr<AudioMixer> audio_mixer = nullptr; | |
|
kwiberg-webrtc
2016/10/31 12:31:06
You don't need to explicitly initialize scoped_ref
aleloi
2016/10/31 12:44:01
Thanks, removed default initializer (it is called
kwiberg-webrtc
2016/10/31 13:30:33
I think the term is "default member initializer".
aleloi
2016/10/31 14:56:40
Avoiding shared pointers is always good! I've aske
kwiberg-webrtc
2016/11/01 00:45:59
Excellent. It's not always possible to avoid share
ossu
2016/11/01 16:06:36
Agreed. unique_ptr sounds good to me!
I'd like to
| |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 // TODO(solenberg): Replace scoped_refptr with shared_ptr once we can use it. | 42 // TODO(solenberg): Replace scoped_refptr with shared_ptr once we can use it. |
| 41 static rtc::scoped_refptr<AudioState> Create( | 43 static rtc::scoped_refptr<AudioState> Create( |
| 42 const AudioState::Config& config); | 44 const AudioState::Config& config); |
| 43 | 45 |
| 44 virtual ~AudioState() {} | 46 virtual ~AudioState() {} |
| 45 }; | 47 }; |
| 46 } // namespace webrtc | 48 } // namespace webrtc |
| 47 | 49 |
| 48 #endif // WEBRTC_API_CALL_AUDIO_STATE_H_ | 50 #endif // WEBRTC_API_CALL_AUDIO_STATE_H_ |
| OLD | NEW |