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 |
11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ | 11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ |
12 #define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ | 12 #define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <map> | 15 #include <map> |
16 #include <set> | 16 #include <set> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
20 #include "webrtc/base/scoped_ptr.h" | 20 #include "webrtc/base/scoped_ptr.h" |
21 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 21 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
22 #include "webrtc/video_receive_stream.h" | |
23 #include "webrtc/video_send_stream.h" | |
24 | 22 |
25 namespace webrtc { | 23 namespace webrtc { |
26 | 24 |
27 class BitrateAllocator; | 25 class BitrateAllocator; |
28 class CallStats; | 26 class CallStats; |
29 class Config; | 27 class Config; |
30 class EncoderStateFeedback; | 28 class EncoderStateFeedback; |
31 class I420FrameCallback; | 29 class I420FrameCallback; |
32 class PacedSender; | 30 class PacedSender; |
33 class PacketRouter; | 31 class PacketRouter; |
(...skipping 13 matching lines...) Expand all Loading... |
47 // group are assumed to send/receive data to the same end-point. | 45 // group are assumed to send/receive data to the same end-point. |
48 class ChannelGroup : public BitrateObserver { | 46 class ChannelGroup : public BitrateObserver { |
49 public: | 47 public: |
50 explicit ChannelGroup(ProcessThread* process_thread); | 48 explicit ChannelGroup(ProcessThread* process_thread); |
51 ~ChannelGroup(); | 49 ~ChannelGroup(); |
52 bool CreateSendChannel(int channel_id, | 50 bool CreateSendChannel(int channel_id, |
53 Transport* transport, | 51 Transport* transport, |
54 SendStatisticsProxy* stats_proxy, | 52 SendStatisticsProxy* stats_proxy, |
55 I420FrameCallback* pre_encode_callback, | 53 I420FrameCallback* pre_encode_callback, |
56 int number_of_cores, | 54 int number_of_cores, |
57 const VideoSendStream::Config& config); | 55 const std::vector<uint32_t>& ssrcs); |
58 bool CreateReceiveChannel(int channel_id, | 56 bool CreateReceiveChannel(int channel_id, |
59 Transport* transport, | 57 Transport* transport, |
60 int number_of_cores, | 58 int number_of_cores); |
61 const VideoReceiveStream::Config& config); | |
62 void DeleteChannel(int channel_id); | 59 void DeleteChannel(int channel_id); |
63 ViEChannel* GetChannel(int channel_id) const; | 60 ViEChannel* GetChannel(int channel_id) const; |
64 ViEEncoder* GetEncoder(int channel_id) const; | 61 ViEEncoder* GetEncoder(int channel_id) const; |
65 void SetSyncInterface(VoEVideoSync* sync_interface); | 62 void SetSyncInterface(VoEVideoSync* sync_interface); |
66 | 63 |
67 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel); | 64 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel); |
68 | 65 |
69 BitrateController* GetBitrateController() const; | 66 BitrateController* GetBitrateController() const; |
70 CallStats* GetCallStats() const; | 67 CallStats* GetCallStats() const; |
71 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const; | 68 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const; |
72 EncoderStateFeedback* GetEncoderStateFeedback() const; | 69 EncoderStateFeedback* GetEncoderStateFeedback() const; |
73 int64_t GetPacerQueuingDelayMs() const; | 70 int64_t GetPacerQueuingDelayMs() const; |
74 | 71 |
75 // Implements BitrateObserver. | 72 // Implements BitrateObserver. |
76 void OnNetworkChanged(uint32_t target_bitrate_bps, | 73 void OnNetworkChanged(uint32_t target_bitrate_bps, |
77 uint8_t fraction_loss, | 74 uint8_t fraction_loss, |
78 int64_t rtt) override; | 75 int64_t rtt) override; |
79 | 76 |
80 private: | 77 private: |
81 typedef std::map<int, ViEChannel*> ChannelMap; | 78 typedef std::map<int, ViEChannel*> ChannelMap; |
82 typedef std::map<int, ViEEncoder*> EncoderMap; | 79 typedef std::map<int, ViEEncoder*> EncoderMap; |
83 | 80 |
84 bool CreateChannel(int channel_id, | 81 bool CreateChannel(int channel_id, |
85 Transport* transport, | 82 Transport* transport, |
86 int number_of_cores, | 83 int number_of_cores, |
87 ViEEncoder* vie_encoder, | 84 ViEEncoder* vie_encoder, |
88 size_t max_rtp_streams, | 85 size_t max_rtp_streams, |
89 bool sender, | 86 bool sender); |
90 RemoteBitrateEstimator* bitrate_estimator, | |
91 TransportFeedbackObserver* feedback_observer); | |
92 ViEChannel* PopChannel(int channel_id); | 87 ViEChannel* PopChannel(int channel_id); |
93 | 88 |
94 rtc::scoped_ptr<VieRemb> remb_; | 89 rtc::scoped_ptr<VieRemb> remb_; |
95 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; | 90 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; |
96 rtc::scoped_ptr<CallStats> call_stats_; | 91 rtc::scoped_ptr<CallStats> call_stats_; |
| 92 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
| 93 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_; |
97 rtc::scoped_ptr<PacketRouter> packet_router_; | 94 rtc::scoped_ptr<PacketRouter> packet_router_; |
98 rtc::scoped_ptr<PacedSender> pacer_; | 95 rtc::scoped_ptr<PacedSender> pacer_; |
99 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; | |
100 rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_; | |
101 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_; | |
102 ChannelMap channel_map_; | 96 ChannelMap channel_map_; |
103 // Maps Channel id -> ViEEncoder. | 97 // Maps Channel id -> ViEEncoder. |
104 mutable rtc::CriticalSection encoder_map_crit_; | 98 mutable rtc::CriticalSection encoder_map_crit_; |
105 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_); | 99 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_); |
106 | 100 |
107 // Registered at construct time and assumed to outlive this class. | 101 // Registered at construct time and assumed to outlive this class. |
108 ProcessThread* const process_thread_; | 102 ProcessThread* const process_thread_; |
109 rtc::scoped_ptr<ProcessThread> pacer_thread_; | 103 rtc::scoped_ptr<ProcessThread> pacer_thread_; |
110 | 104 |
111 rtc::scoped_ptr<BitrateController> bitrate_controller_; | 105 rtc::scoped_ptr<BitrateController> bitrate_controller_; |
112 rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_; | |
113 }; | 106 }; |
114 | 107 |
115 } // namespace webrtc | 108 } // namespace webrtc |
116 | 109 |
117 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ | 110 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ |
OLD | NEW |