OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "webrtc/base/socket.h" | 21 #include "webrtc/base/socket.h" |
22 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 22 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
23 #include "webrtc/video_receive_stream.h" | 23 #include "webrtc/video_receive_stream.h" |
24 #include "webrtc/video_send_stream.h" | 24 #include "webrtc/video_send_stream.h" |
25 | 25 |
26 namespace webrtc { | 26 namespace webrtc { |
27 | 27 |
28 class BitrateAllocator; | 28 class BitrateAllocator; |
29 class CallStats; | 29 class CallStats; |
30 class Config; | 30 class Config; |
31 class EncoderStateFeedback; | |
32 class I420FrameCallback; | |
33 class PacedSender; | 31 class PacedSender; |
34 class PacketRouter; | 32 class PacketRouter; |
35 class ProcessThread; | 33 class ProcessThread; |
36 class RemoteBitrateEstimator; | 34 class RemoteBitrateEstimator; |
37 class RemoteEstimatorProxy; | 35 class RemoteEstimatorProxy; |
| 36 class RtpRtcp; |
38 class SendStatisticsProxy; | 37 class SendStatisticsProxy; |
39 class TransportFeedbackAdapter; | 38 class TransportFeedbackAdapter; |
40 class ViEChannel; | |
41 class ViEEncoder; | 39 class ViEEncoder; |
42 class VieRemb; | 40 class VieRemb; |
43 | 41 |
44 // Channel group contains data common for several channels. All channels in the | 42 // Channel group contains data common for several channels. All channels in the |
45 // group are assumed to send/receive data to the same end-point. | 43 // group are assumed to send/receive data to the same end-point. |
46 class ChannelGroup : public BitrateObserver { | 44 class ChannelGroup : public BitrateObserver { |
47 public: | 45 public: |
48 explicit ChannelGroup(ProcessThread* process_thread); | 46 ChannelGroup(ProcessThread* process_thread, CallStats* call_stats); |
49 ~ChannelGroup(); | 47 ~ChannelGroup(); |
50 void AddEncoder(const std::vector<uint32_t>& ssrcs, ViEEncoder* encoder); | 48 void AddEncoder(ViEEncoder* encoder); |
51 void RemoveEncoder(ViEEncoder* encoder); | 49 void RemoveEncoder(ViEEncoder* encoder); |
52 void SetBweBitrates(int min_bitrate_bps, | 50 void SetBweBitrates(int min_bitrate_bps, |
53 int start_bitrate_bps, | 51 int start_bitrate_bps, |
54 int max_bitrate_bps); | 52 int max_bitrate_bps); |
55 | 53 |
56 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel); | 54 void SetChannelRembStatus(bool sender, bool receiver, RtpRtcp* rtp_module); |
57 | 55 |
58 void SignalNetworkState(NetworkState state); | 56 void SignalNetworkState(NetworkState state); |
59 | 57 |
60 BitrateController* GetBitrateController() const; | 58 BitrateController* GetBitrateController() const; |
61 RemoteBitrateEstimator* GetRemoteBitrateEstimator(bool send_side_bwe) const; | 59 RemoteBitrateEstimator* GetRemoteBitrateEstimator(bool send_side_bwe) const; |
62 CallStats* GetCallStats() const; | |
63 int64_t GetPacerQueuingDelayMs() const; | 60 int64_t GetPacerQueuingDelayMs() const; |
64 PacedSender* pacer() const { return pacer_.get(); } | 61 PacedSender* pacer() const { return pacer_.get(); } |
65 PacketRouter* packet_router() const { return packet_router_.get(); } | 62 PacketRouter* packet_router() const { return packet_router_.get(); } |
66 BitrateAllocator* bitrate_allocator() const { | 63 BitrateAllocator* bitrate_allocator() const { |
67 return bitrate_allocator_.get(); } | 64 return bitrate_allocator_.get(); } |
68 TransportFeedbackObserver* GetTransportFeedbackObserver(); | 65 TransportFeedbackObserver* GetTransportFeedbackObserver(); |
69 RtcpIntraFrameObserver* GetRtcpIntraFrameObserver() const; | 66 RtcpIntraFrameObserver* GetRtcpIntraFrameObserver() const; |
70 | 67 |
71 // Implements BitrateObserver. | 68 // Implements BitrateObserver. |
72 void OnNetworkChanged(uint32_t target_bitrate_bps, | 69 void OnNetworkChanged(uint32_t target_bitrate_bps, |
73 uint8_t fraction_loss, | 70 uint8_t fraction_loss, |
74 int64_t rtt) override; | 71 int64_t rtt) override; |
75 | 72 |
76 void OnSentPacket(const rtc::SentPacket& sent_packet); | 73 void OnSentPacket(const rtc::SentPacket& sent_packet); |
77 | 74 |
78 private: | 75 private: |
79 rtc::scoped_ptr<VieRemb> remb_; | 76 rtc::scoped_ptr<VieRemb> remb_; |
80 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; | 77 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; |
81 rtc::scoped_ptr<CallStats> call_stats_; | |
82 rtc::scoped_ptr<PacketRouter> packet_router_; | 78 rtc::scoped_ptr<PacketRouter> packet_router_; |
83 rtc::scoped_ptr<PacedSender> pacer_; | 79 rtc::scoped_ptr<PacedSender> pacer_; |
84 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; | 80 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
85 rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_; | 81 rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_; |
86 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_; | |
87 | 82 |
88 mutable rtc::CriticalSection encoder_crit_; | 83 mutable rtc::CriticalSection encoder_crit_; |
89 std::vector<ViEEncoder*> encoders_ GUARDED_BY(encoder_crit_); | 84 std::vector<ViEEncoder*> encoders_ GUARDED_BY(encoder_crit_); |
90 | 85 |
91 // Registered at construct time and assumed to outlive this class. | 86 // Registered at construct time and assumed to outlive this class. |
92 ProcessThread* const process_thread_; | 87 ProcessThread* const process_thread_; |
| 88 CallStats* const call_stats_; |
| 89 |
93 rtc::scoped_ptr<ProcessThread> pacer_thread_; | 90 rtc::scoped_ptr<ProcessThread> pacer_thread_; |
94 | 91 |
95 rtc::scoped_ptr<BitrateController> bitrate_controller_; | 92 rtc::scoped_ptr<BitrateController> bitrate_controller_; |
96 rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_; | 93 rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_; |
97 int min_bitrate_bps_; | 94 int min_bitrate_bps_; |
98 }; | 95 }; |
99 | 96 |
100 } // namespace webrtc | 97 } // namespace webrtc |
101 | 98 |
102 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ | 99 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ |
OLD | NEW |