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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 size_t max_rtp_streams, | 78 size_t max_rtp_streams, |
79 bool sender); | 79 bool sender); |
80 ~ViEChannel(); | 80 ~ViEChannel(); |
81 | 81 |
82 int32_t Init(); | 82 int32_t Init(); |
83 | 83 |
84 // Sets the encoder to use for the channel. |new_stream| indicates the encoder | 84 // Sets the encoder to use for the channel. |new_stream| indicates the encoder |
85 // type has changed and we should start a new RTP stream. | 85 // type has changed and we should start a new RTP stream. |
86 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); | 86 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); |
87 | 87 |
88 void SetRTCPMode(const RtcpMode rtcp_mode); | |
89 void SetProtectionMode(bool enable_nack, | 88 void SetProtectionMode(bool enable_nack, |
90 bool enable_fec, | 89 bool enable_fec, |
91 int payload_type_red, | 90 int payload_type_red, |
92 int payload_type_fec); | 91 int payload_type_fec); |
93 bool IsSendingFecEnabled(); | |
94 int SetSenderBufferingMode(int target_delay_ms); | 92 int SetSenderBufferingMode(int target_delay_ms); |
95 int SetSendTimestampOffsetStatus(bool enable, int id); | 93 int SetSendTimestampOffsetStatus(bool enable, int id); |
96 int SetSendAbsoluteSendTimeStatus(bool enable, int id); | 94 int SetSendAbsoluteSendTimeStatus(bool enable, int id); |
97 int SetSendVideoRotationStatus(bool enable, int id); | 95 int SetSendVideoRotationStatus(bool enable, int id); |
98 int SetSendTransportSequenceNumber(bool enable, int id); | 96 int SetSendTransportSequenceNumber(bool enable, int id); |
99 | 97 |
100 // Sets SSRC for outgoing stream. | |
101 int32_t SetSSRC(const uint32_t SSRC, | |
102 const StreamType usage, | |
103 const unsigned char simulcast_idx); | |
104 | |
105 // Gets SSRC for outgoing stream number |idx|. | |
106 int32_t GetLocalSSRC(uint8_t idx, unsigned int* ssrc); | |
107 | |
108 int SetRtxSendPayloadType(int payload_type, int associated_payload_type); | |
109 | |
110 void SetRtpStateForSsrc(uint32_t ssrc, const RtpState& rtp_state); | |
111 RtpState GetRtpStateForSsrc(uint32_t ssrc) const; | 98 RtpState GetRtpStateForSsrc(uint32_t ssrc) const; |
112 | 99 |
113 // Sets the CName for the outgoing stream on the channel. | |
114 int32_t SetRTCPCName(const char* rtcp_cname); | |
115 | |
116 // Gets the CName of the incoming stream. | |
117 int32_t GetRemoteRTCPCName(char rtcp_cname[]); | |
118 | |
119 // Returns statistics reported by the remote client in an RTCP packet. | 100 // Returns statistics reported by the remote client in an RTCP packet. |
120 // TODO(pbos): Remove this along with VideoSendStream::GetRtt(). | 101 // TODO(pbos): Remove this along with VideoSendStream::GetRtt(). |
121 int32_t GetSendRtcpStatistics(uint16_t* fraction_lost, | 102 int32_t GetSendRtcpStatistics(uint16_t* fraction_lost, |
122 uint32_t* cumulative_lost, | 103 uint32_t* cumulative_lost, |
123 uint32_t* extended_max, | 104 uint32_t* extended_max, |
124 uint32_t* jitter_samples, | 105 uint32_t* jitter_samples, |
125 int64_t* rtt_ms) const; | 106 int64_t* rtt_ms) const; |
126 | 107 |
127 // Called on receipt of RTCP report block from remote side. | |
128 void RegisterSendChannelRtcpStatisticsCallback( | |
129 RtcpStatisticsCallback* callback); | |
130 | |
131 // Gets send statistics for the rtp and rtx stream. | 108 // Gets send statistics for the rtp and rtx stream. |
132 void GetSendStreamDataCounters(StreamDataCounters* rtp_counters, | 109 void GetSendStreamDataCounters(StreamDataCounters* rtp_counters, |
133 StreamDataCounters* rtx_counters) const; | 110 StreamDataCounters* rtx_counters) const; |
134 | 111 |
135 // Gets received stream data counters. | 112 // Gets received stream data counters. |
136 void GetReceiveStreamDataCounters(StreamDataCounters* rtp_counters, | 113 void GetReceiveStreamDataCounters(StreamDataCounters* rtp_counters, |
137 StreamDataCounters* rtx_counters) const; | 114 StreamDataCounters* rtx_counters) const; |
138 | 115 |
139 // Called on update of RTP statistics. | |
140 void RegisterSendChannelRtpStatisticsCallback( | |
141 StreamDataCountersCallback* callback); | |
142 | |
143 void GetSendRtcpPacketTypeCounter( | 116 void GetSendRtcpPacketTypeCounter( |
144 RtcpPacketTypeCounter* packet_counter) const; | 117 RtcpPacketTypeCounter* packet_counter) const; |
145 | 118 |
146 void GetReceiveRtcpPacketTypeCounter( | 119 void GetReceiveRtcpPacketTypeCounter( |
147 RtcpPacketTypeCounter* packet_counter) const; | 120 RtcpPacketTypeCounter* packet_counter) const; |
148 | 121 |
149 void RegisterSendSideDelayObserver(SendSideDelayObserver* observer); | 122 void RegisterSendSideDelayObserver(SendSideDelayObserver* observer); |
150 | 123 |
151 // Called on any new send bitrate estimate. | 124 // Called on any new send bitrate estimate. |
152 void RegisterSendBitrateObserver(BitrateStatisticsObserver* observer); | 125 void RegisterSendBitrateObserver(BitrateStatisticsObserver* observer); |
153 | 126 |
154 // Implements RtpFeedback. | 127 // Implements RtpFeedback. |
155 int32_t OnInitializeDecoder(const int8_t payload_type, | 128 int32_t OnInitializeDecoder(const int8_t payload_type, |
156 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 129 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
157 const int frequency, | 130 const int frequency, |
158 const size_t channels, | 131 const size_t channels, |
159 const uint32_t rate) override; | 132 const uint32_t rate) override; |
160 void OnIncomingSSRCChanged(const uint32_t ssrc) override; | 133 void OnIncomingSSRCChanged(const uint32_t ssrc) override; |
161 void OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) override; | 134 void OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) override; |
162 | 135 |
163 int32_t StartSend(); | 136 int32_t StartSend(); |
164 int32_t StopSend(); | 137 int32_t StopSend(); |
165 | 138 |
166 // Sets the maximum transfer unit size for the network link, i.e. including | |
167 // IP, UDP and RTP headers. | |
168 int32_t SetMTU(uint16_t mtu); | |
169 | |
170 // Gets the modules used by the channel. | 139 // Gets the modules used by the channel. |
171 RtpRtcp* rtp_rtcp(); | 140 const std::vector<RtpRtcp*>& rtp_rtcp() const; |
172 ViEReceiver* vie_receiver(); | 141 ViEReceiver* vie_receiver(); |
173 VCMProtectionCallback* vcm_protection_callback(); | 142 VCMProtectionCallback* vcm_protection_callback(); |
174 | 143 |
175 | 144 |
176 CallStatsObserver* GetStatsObserver(); | 145 CallStatsObserver* GetStatsObserver(); |
177 | 146 |
178 // Implements VCMReceiveCallback. | 147 // Implements VCMReceiveCallback. |
179 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT | 148 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT |
180 | 149 |
181 // Implements VCMReceiveCallback. | 150 // Implements VCMReceiveCallback. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 SendSideDelayObserver* send_side_delay_observer, | 220 SendSideDelayObserver* send_side_delay_observer, |
252 size_t num_modules); | 221 size_t num_modules); |
253 | 222 |
254 // Assumed to be protected. | 223 // Assumed to be protected. |
255 void StartDecodeThread(); | 224 void StartDecodeThread(); |
256 void StopDecodeThread(); | 225 void StopDecodeThread(); |
257 | 226 |
258 void ProcessNACKRequest(const bool enable); | 227 void ProcessNACKRequest(const bool enable); |
259 // Compute NACK list parameters for the buffering mode. | 228 // Compute NACK list parameters for the buffering mode. |
260 int GetRequiredNackListSize(int target_delay_ms); | 229 int GetRequiredNackListSize(int target_delay_ms); |
261 void SetRtxSendStatus(bool enable); | |
262 | 230 |
263 void UpdateHistograms(); | 231 void UpdateHistograms(); |
264 | 232 |
265 // ViEChannel exposes methods that allow to modify observers and callbacks | 233 // ViEChannel exposes methods that allow to modify observers and callbacks |
266 // to be modified. Such an API-style is cumbersome to implement and maintain | 234 // to be modified. Such an API-style is cumbersome to implement and maintain |
267 // at all the levels when comparing to only setting them at construction. As | 235 // at all the levels when comparing to only setting them at construction. As |
268 // so this class instantiates its children with a wrapper that can be modified | 236 // so this class instantiates its children with a wrapper that can be modified |
269 // at a later time. | 237 // at a later time. |
270 template <class T> | 238 template <class T> |
271 class RegisterableCallback : public T { | 239 class RegisterableCallback : public T { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 size_t num_rtts_ GUARDED_BY(crit_); | 356 size_t num_rtts_ GUARDED_BY(crit_); |
389 | 357 |
390 // RtpRtcp modules, declared last as they use other members on construction. | 358 // RtpRtcp modules, declared last as they use other members on construction. |
391 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 359 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
392 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); | 360 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); |
393 }; | 361 }; |
394 | 362 |
395 } // namespace webrtc | 363 } // namespace webrtc |
396 | 364 |
397 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ | 365 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ |
OLD | NEW |