Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.h

Issue 2979413002: Refactor composing report blocks for rtcp Sender/Receiver reports (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void SetVideoBitrateAllocation(const BitrateAllocation& bitrate); 150 void SetVideoBitrateAllocation(const BitrateAllocation& bitrate);
151 bool SendFeedbackPacket(const rtcp::TransportFeedback& packet); 151 bool SendFeedbackPacket(const rtcp::TransportFeedback& packet);
152 152
153 private: 153 private:
154 class RtcpContext; 154 class RtcpContext;
155 155
156 // Determine which RTCP messages should be sent and setup flags. 156 // Determine which RTCP messages should be sent and setup flags.
157 void PrepareReport(const FeedbackState& feedback_state) 157 void PrepareReport(const FeedbackState& feedback_state)
158 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); 158 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
159 159
160 bool AddReportBlock(const FeedbackState& feedback_state, 160 std::vector<rtcp::ReportBlock> CreateReportBlocks(
161 uint32_t ssrc, 161 const FeedbackState& feedback_state)
162 StreamStatistician* statistician)
163 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); 162 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
164 163
165 std::unique_ptr<rtcp::RtcpPacket> BuildSR(const RtcpContext& context) 164 std::unique_ptr<rtcp::RtcpPacket> BuildSR(const RtcpContext& context)
166 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); 165 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
167 std::unique_ptr<rtcp::RtcpPacket> BuildRR(const RtcpContext& context) 166 std::unique_ptr<rtcp::RtcpPacket> BuildRR(const RtcpContext& context)
168 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); 167 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
169 std::unique_ptr<rtcp::RtcpPacket> BuildSDES(const RtcpContext& context) 168 std::unique_ptr<rtcp::RtcpPacket> BuildSDES(const RtcpContext& context)
170 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); 169 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
171 std::unique_ptr<rtcp::RtcpPacket> BuildPLI(const RtcpContext& context) 170 std::unique_ptr<rtcp::RtcpPacket> BuildPLI(const RtcpContext& context)
172 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); 171 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 uint32_t timestamp_offset_ GUARDED_BY(critical_section_rtcp_sender_); 206 uint32_t timestamp_offset_ GUARDED_BY(critical_section_rtcp_sender_);
208 uint32_t last_rtp_timestamp_ GUARDED_BY(critical_section_rtcp_sender_); 207 uint32_t last_rtp_timestamp_ GUARDED_BY(critical_section_rtcp_sender_);
209 int64_t last_frame_capture_time_ms_ GUARDED_BY(critical_section_rtcp_sender_); 208 int64_t last_frame_capture_time_ms_ GUARDED_BY(critical_section_rtcp_sender_);
210 uint32_t ssrc_ GUARDED_BY(critical_section_rtcp_sender_); 209 uint32_t ssrc_ GUARDED_BY(critical_section_rtcp_sender_);
211 // SSRC that we receive on our RTP channel 210 // SSRC that we receive on our RTP channel
212 uint32_t remote_ssrc_ GUARDED_BY(critical_section_rtcp_sender_); 211 uint32_t remote_ssrc_ GUARDED_BY(critical_section_rtcp_sender_);
213 std::string cname_ GUARDED_BY(critical_section_rtcp_sender_); 212 std::string cname_ GUARDED_BY(critical_section_rtcp_sender_);
214 213
215 ReceiveStatistics* receive_statistics_ 214 ReceiveStatistics* receive_statistics_
216 GUARDED_BY(critical_section_rtcp_sender_); 215 GUARDED_BY(critical_section_rtcp_sender_);
217 std::map<uint32_t, rtcp::ReportBlock> report_blocks_
218 GUARDED_BY(critical_section_rtcp_sender_);
219 std::map<uint32_t, std::string> csrc_cnames_ 216 std::map<uint32_t, std::string> csrc_cnames_
220 GUARDED_BY(critical_section_rtcp_sender_); 217 GUARDED_BY(critical_section_rtcp_sender_);
221 218
222 // send CSRCs 219 // send CSRCs
223 std::vector<uint32_t> csrcs_ GUARDED_BY(critical_section_rtcp_sender_); 220 std::vector<uint32_t> csrcs_ GUARDED_BY(critical_section_rtcp_sender_);
224 221
225 // Full intra request 222 // Full intra request
226 uint8_t sequence_number_fir_ GUARDED_BY(critical_section_rtcp_sender_); 223 uint8_t sequence_number_fir_ GUARDED_BY(critical_section_rtcp_sender_);
227 224
228 // REMB 225 // REMB
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 typedef std::unique_ptr<rtcp::RtcpPacket> (RTCPSender::*BuilderFunc)( 280 typedef std::unique_ptr<rtcp::RtcpPacket> (RTCPSender::*BuilderFunc)(
284 const RtcpContext&); 281 const RtcpContext&);
285 // Map from RTCPPacketType to builder. 282 // Map from RTCPPacketType to builder.
286 std::map<uint32_t, BuilderFunc> builders_; 283 std::map<uint32_t, BuilderFunc> builders_;
287 284
288 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTCPSender); 285 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTCPSender);
289 }; 286 };
290 } // namespace webrtc 287 } // namespace webrtc
291 288
292 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_ 289 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698