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 | 10 |
11 #ifndef WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ | 11 #ifndef WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ |
12 #define WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ | 12 #define WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/audio_send_stream.h" | 16 #include "webrtc/audio_send_stream.h" |
17 #include "webrtc/audio_state.h" | 17 #include "webrtc/audio_state.h" |
18 #include "webrtc/base/constructormagic.h" | 18 #include "webrtc/base/constructormagic.h" |
19 #include "webrtc/base/thread_checker.h" | 19 #include "webrtc/base/thread_checker.h" |
| 20 #include "webrtc/call/bitrate_allocator.h" |
20 | 21 |
21 namespace webrtc { | 22 namespace webrtc { |
22 class CongestionController; | 23 class CongestionController; |
23 class VoiceEngine; | 24 class VoiceEngine; |
24 | 25 |
25 namespace voe { | 26 namespace voe { |
26 class ChannelProxy; | 27 class ChannelProxy; |
27 } // namespace voe | 28 } // namespace voe |
28 | 29 |
29 namespace internal { | 30 namespace internal { |
30 class AudioSendStream final : public webrtc::AudioSendStream { | 31 class AudioSendStream final : public webrtc::AudioSendStream, |
| 32 public webrtc::BitrateAllocatorObserver { |
31 public: | 33 public: |
32 AudioSendStream(const webrtc::AudioSendStream::Config& config, | 34 AudioSendStream(const webrtc::AudioSendStream::Config& config, |
33 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, | 35 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, |
34 CongestionController* congestion_controller); | 36 CongestionController* congestion_controller, |
| 37 BitrateAllocator* bitrate_allocator); |
35 ~AudioSendStream() override; | 38 ~AudioSendStream() override; |
36 | 39 |
37 // webrtc::AudioSendStream implementation. | 40 // webrtc::AudioSendStream implementation. |
38 void Start() override; | 41 void Start() override; |
39 void Stop() override; | 42 void Stop() override; |
40 bool SendTelephoneEvent(int payload_type, int event, | 43 bool SendTelephoneEvent(int payload_type, int event, |
41 int duration_ms) override; | 44 int duration_ms) override; |
42 void SetMuted(bool muted) override; | 45 void SetMuted(bool muted) override; |
43 webrtc::AudioSendStream::Stats GetStats() const override; | 46 webrtc::AudioSendStream::Stats GetStats() const override; |
44 | 47 |
45 void SignalNetworkState(NetworkState state); | 48 void SignalNetworkState(NetworkState state); |
46 bool DeliverRtcp(const uint8_t* packet, size_t length); | 49 bool DeliverRtcp(const uint8_t* packet, size_t length); |
| 50 |
| 51 // Implements BitrateAllocatorObserver. |
| 52 uint32_t OnBitrateUpdated(uint32_t bitrate_bps, |
| 53 uint8_t fraction_loss, |
| 54 int64_t rtt) override; |
| 55 |
47 const webrtc::AudioSendStream::Config& config() const; | 56 const webrtc::AudioSendStream::Config& config() const; |
48 | 57 |
49 private: | 58 private: |
50 VoiceEngine* voice_engine() const; | 59 VoiceEngine* voice_engine() const; |
51 | 60 |
52 rtc::ThreadChecker thread_checker_; | 61 rtc::ThreadChecker thread_checker_; |
53 const webrtc::AudioSendStream::Config config_; | 62 const webrtc::AudioSendStream::Config config_; |
54 rtc::scoped_refptr<webrtc::AudioState> audio_state_; | 63 rtc::scoped_refptr<webrtc::AudioState> audio_state_; |
55 std::unique_ptr<voe::ChannelProxy> channel_proxy_; | 64 std::unique_ptr<voe::ChannelProxy> channel_proxy_; |
56 | 65 |
| 66 BitrateAllocator* const bitrate_allocator_; |
| 67 |
57 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream); | 68 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream); |
58 }; | 69 }; |
59 } // namespace internal | 70 } // namespace internal |
60 } // namespace webrtc | 71 } // namespace webrtc |
61 | 72 |
62 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ | 73 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ |
OLD | NEW |