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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 size_t max_rtp_streams, | 77 size_t max_rtp_streams, |
78 bool sender); | 78 bool sender); |
79 ~ViEChannel(); | 79 ~ViEChannel(); |
80 | 80 |
81 int32_t Init(); | 81 int32_t Init(); |
82 | 82 |
83 // Sets the encoder to use for the channel. |new_stream| indicates the encoder | 83 // Sets the encoder to use for the channel. |new_stream| indicates the encoder |
84 // type has changed and we should start a new RTP stream. | 84 // type has changed and we should start a new RTP stream. |
85 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); | 85 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); |
86 | 86 |
87 void SetRTCPMode(const RtcpMode rtcp_mode); | |
88 void SetProtectionMode(bool enable_nack, | 87 void SetProtectionMode(bool enable_nack, |
89 bool enable_fec, | 88 bool enable_fec, |
90 int payload_type_red, | 89 int payload_type_red, |
91 int payload_type_fec); | 90 int payload_type_fec); |
92 bool IsSendingFecEnabled(); | |
93 int SetSendTimestampOffsetStatus(bool enable, int id); | 91 int SetSendTimestampOffsetStatus(bool enable, int id); |
94 int SetSendAbsoluteSendTimeStatus(bool enable, int id); | 92 int SetSendAbsoluteSendTimeStatus(bool enable, int id); |
95 int SetSendVideoRotationStatus(bool enable, int id); | 93 int SetSendVideoRotationStatus(bool enable, int id); |
96 int SetSendTransportSequenceNumber(bool enable, int id); | 94 int SetSendTransportSequenceNumber(bool enable, int id); |
97 | 95 |
98 // Sets SSRC for outgoing stream. | |
99 int32_t SetSSRC(const uint32_t SSRC, | |
100 const StreamType usage, | |
101 const unsigned char simulcast_idx); | |
102 | |
103 // Gets SSRC for outgoing stream number |idx|. | |
104 int32_t GetLocalSSRC(uint8_t idx, unsigned int* ssrc); | |
105 | |
106 int SetRtxSendPayloadType(int payload_type, int associated_payload_type); | |
107 | |
108 void SetRtpStateForSsrc(uint32_t ssrc, const RtpState& rtp_state); | |
109 RtpState GetRtpStateForSsrc(uint32_t ssrc) const; | 96 RtpState GetRtpStateForSsrc(uint32_t ssrc) const; |
110 | 97 |
111 // Sets the CName for the outgoing stream on the channel. | |
112 int32_t SetRTCPCName(const char* rtcp_cname); | |
113 | |
114 // Gets the CName of the incoming stream. | |
115 int32_t GetRemoteRTCPCName(char rtcp_cname[]); | |
116 | |
117 // Called on receipt of RTCP report block from remote side. | |
118 void RegisterSendChannelRtcpStatisticsCallback( | |
119 RtcpStatisticsCallback* callback); | |
120 | |
121 // Gets send statistics for the rtp and rtx stream. | 98 // Gets send statistics for the rtp and rtx stream. |
122 void GetSendStreamDataCounters(StreamDataCounters* rtp_counters, | 99 void GetSendStreamDataCounters(StreamDataCounters* rtp_counters, |
123 StreamDataCounters* rtx_counters) const; | 100 StreamDataCounters* rtx_counters) const; |
124 | 101 |
125 // Gets received stream data counters. | 102 // Gets received stream data counters. |
126 void GetReceiveStreamDataCounters(StreamDataCounters* rtp_counters, | 103 void GetReceiveStreamDataCounters(StreamDataCounters* rtp_counters, |
127 StreamDataCounters* rtx_counters) const; | 104 StreamDataCounters* rtx_counters) const; |
128 | 105 |
129 // Called on update of RTP statistics. | |
130 void RegisterSendChannelRtpStatisticsCallback( | |
131 StreamDataCountersCallback* callback); | |
132 | |
133 void GetSendRtcpPacketTypeCounter( | 106 void GetSendRtcpPacketTypeCounter( |
134 RtcpPacketTypeCounter* packet_counter) const; | 107 RtcpPacketTypeCounter* packet_counter) const; |
135 | 108 |
136 void GetReceiveRtcpPacketTypeCounter( | 109 void GetReceiveRtcpPacketTypeCounter( |
137 RtcpPacketTypeCounter* packet_counter) const; | 110 RtcpPacketTypeCounter* packet_counter) const; |
138 | 111 |
139 void RegisterSendSideDelayObserver(SendSideDelayObserver* observer); | 112 void RegisterSendSideDelayObserver(SendSideDelayObserver* observer); |
140 | 113 |
141 // Called on any new send bitrate estimate. | 114 // Called on any new send bitrate estimate. |
142 void RegisterSendBitrateObserver(BitrateStatisticsObserver* observer); | 115 void RegisterSendBitrateObserver(BitrateStatisticsObserver* observer); |
143 | 116 |
144 // Implements RtpFeedback. | 117 // Implements RtpFeedback. |
145 int32_t OnInitializeDecoder(const int8_t payload_type, | 118 int32_t OnInitializeDecoder(const int8_t payload_type, |
146 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 119 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
147 const int frequency, | 120 const int frequency, |
148 const size_t channels, | 121 const size_t channels, |
149 const uint32_t rate) override; | 122 const uint32_t rate) override; |
150 void OnIncomingSSRCChanged(const uint32_t ssrc) override; | 123 void OnIncomingSSRCChanged(const uint32_t ssrc) override; |
151 void OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) override; | 124 void OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) override; |
152 | 125 |
153 int32_t StartSend(); | 126 int32_t StartSend(); |
154 int32_t StopSend(); | 127 int32_t StopSend(); |
155 | 128 |
156 // Sets the maximum transfer unit size for the network link, i.e. including | |
157 // IP, UDP and RTP headers. | |
158 int32_t SetMTU(uint16_t mtu); | |
159 | |
160 // Gets the modules used by the channel. | 129 // Gets the modules used by the channel. |
161 RtpRtcp* rtp_rtcp(); | 130 const std::vector<RtpRtcp*>& rtp_rtcp() const; |
162 ViEReceiver* vie_receiver(); | 131 ViEReceiver* vie_receiver(); |
163 VCMProtectionCallback* vcm_protection_callback(); | 132 VCMProtectionCallback* vcm_protection_callback(); |
164 | 133 |
165 | 134 |
166 CallStatsObserver* GetStatsObserver(); | 135 CallStatsObserver* GetStatsObserver(); |
167 | 136 |
168 // Implements VCMReceiveCallback. | 137 // Implements VCMReceiveCallback. |
169 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT | 138 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT |
170 | 139 |
171 // Implements VCMReceiveCallback. | 140 // Implements VCMReceiveCallback. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 SendSideDelayObserver* send_side_delay_observer, | 206 SendSideDelayObserver* send_side_delay_observer, |
238 size_t num_modules); | 207 size_t num_modules); |
239 | 208 |
240 // Assumed to be protected. | 209 // Assumed to be protected. |
241 void StartDecodeThread(); | 210 void StartDecodeThread(); |
242 void StopDecodeThread(); | 211 void StopDecodeThread(); |
243 | 212 |
244 void ProcessNACKRequest(const bool enable); | 213 void ProcessNACKRequest(const bool enable); |
245 // Compute NACK list parameters for the buffering mode. | 214 // Compute NACK list parameters for the buffering mode. |
246 int GetRequiredNackListSize(int target_delay_ms); | 215 int GetRequiredNackListSize(int target_delay_ms); |
247 void SetRtxSendStatus(bool enable); | |
248 | 216 |
249 void UpdateHistograms(); | 217 void UpdateHistograms(); |
250 | 218 |
251 // ViEChannel exposes methods that allow to modify observers and callbacks | 219 // ViEChannel exposes methods that allow to modify observers and callbacks |
252 // to be modified. Such an API-style is cumbersome to implement and maintain | 220 // to be modified. Such an API-style is cumbersome to implement and maintain |
253 // at all the levels when comparing to only setting them at construction. As | 221 // at all the levels when comparing to only setting them at construction. As |
254 // so this class instantiates its children with a wrapper that can be modified | 222 // so this class instantiates its children with a wrapper that can be modified |
255 // at a later time. | 223 // at a later time. |
256 template <class T> | 224 template <class T> |
257 class RegisterableCallback : public T { | 225 class RegisterableCallback : public T { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 int64_t last_rtt_ms_ GUARDED_BY(crit_); | 336 int64_t last_rtt_ms_ GUARDED_BY(crit_); |
369 | 337 |
370 // RtpRtcp modules, declared last as they use other members on construction. | 338 // RtpRtcp modules, declared last as they use other members on construction. |
371 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 339 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
372 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); | 340 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); |
373 }; | 341 }; |
374 | 342 |
375 } // namespace webrtc | 343 } // namespace webrtc |
376 | 344 |
377 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ | 345 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ |
OLD | NEW |