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

Side by Side Diff: media/cast/net/rtcp/rtcp.h

Issue 513313004: Cast: Re-factor rtcp_sender.cc into rtcp_builder.cc and do some cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed leaky and unused testing_clock_ Created 6 years, 3 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
« no previous file with comments | « media/cast/cast_testing.gypi ('k') | media/cast/net/rtcp/rtcp.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This class maintains a bi-directional RTCP connection with a remote 5 // This class maintains a bi-directional RTCP connection with a remote
6 // peer. 6 // peer.
7 7
8 #ifndef MEDIA_CAST_RTCP_RTCP_H_ 8 #ifndef MEDIA_CAST_RTCP_RTCP_H_
9 #define MEDIA_CAST_RTCP_RTCP_H_ 9 #define MEDIA_CAST_RTCP_RTCP_H_
10 10
11 #include <map> 11 #include <map>
12 #include <queue> 12 #include <queue>
13 #include <string> 13 #include <string>
14 14
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/time/tick_clock.h" 18 #include "base/time/tick_clock.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "media/cast/cast_config.h" 20 #include "media/cast/cast_config.h"
21 #include "media/cast/cast_defines.h" 21 #include "media/cast/cast_defines.h"
22 #include "media/cast/common/clock_drift_smoother.h" 22 #include "media/cast/common/clock_drift_smoother.h"
23 #include "media/cast/net/cast_transport_defines.h" 23 #include "media/cast/net/cast_transport_defines.h"
24 #include "media/cast/net/cast_transport_sender.h" 24 #include "media/cast/net/cast_transport_sender.h"
25 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h" 25 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h"
26 #include "media/cast/net/rtcp/rtcp_builder.h"
26 #include "media/cast/net/rtcp/rtcp_defines.h" 27 #include "media/cast/net/rtcp/rtcp_defines.h"
27 28
28 namespace media { 29 namespace media {
29 namespace cast { 30 namespace cast {
30 31
31 class LocalRtcpReceiverFeedback; 32 class LocalRtcpReceiverFeedback;
32 class PacedPacketSender; 33 class PacedPacketSender;
33 class RtcpReceiver; 34 class RtcpReceiver;
34 class RtcpSender; 35 class RtcpBuilder;
35 36
36 typedef std::pair<uint32, base::TimeTicks> RtcpSendTimePair; 37 typedef std::pair<uint32, base::TimeTicks> RtcpSendTimePair;
37 typedef std::map<uint32, base::TimeTicks> RtcpSendTimeMap; 38 typedef std::map<uint32, base::TimeTicks> RtcpSendTimeMap;
38 typedef std::queue<RtcpSendTimePair> RtcpSendTimeQueue; 39 typedef std::queue<RtcpSendTimePair> RtcpSendTimeQueue;
39 40
40 class RtpReceiverStatistics { 41 class RtpReceiverStatistics {
41 public: 42 public:
42 virtual void GetStatistics(uint8* fraction_lost, 43 virtual void GetStatistics(uint8* fraction_lost,
43 uint32* cumulative_lost, // 24 bits valid. 44 uint32* cumulative_lost, // 24 bits valid.
44 uint32* extended_high_sequence_number, 45 uint32* extended_high_sequence_number,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 uint32 last_ntp_fraction); 132 uint32 last_ntp_fraction);
132 133
133 // Remove duplicate events in |receiver_log|. 134 // Remove duplicate events in |receiver_log|.
134 // Returns true if any events remain. 135 // Returns true if any events remain.
135 bool DedupeReceiverLog(RtcpReceiverLogMessage* receiver_log); 136 bool DedupeReceiverLog(RtcpReceiverLogMessage* receiver_log);
136 137
137 const RtcpCastMessageCallback cast_callback_; 138 const RtcpCastMessageCallback cast_callback_;
138 const RtcpRttCallback rtt_callback_; 139 const RtcpRttCallback rtt_callback_;
139 const RtcpLogMessageCallback log_callback_; 140 const RtcpLogMessageCallback log_callback_;
140 base::TickClock* const clock_; // Not owned by this class. 141 base::TickClock* const clock_; // Not owned by this class.
141 const scoped_ptr<RtcpSender> rtcp_sender_; 142 RtcpBuilder rtcp_builder_;
143 PacedPacketSender* packet_sender_; // Not owned.
142 const uint32 local_ssrc_; 144 const uint32 local_ssrc_;
143 const uint32 remote_ssrc_; 145 const uint32 remote_ssrc_;
144 146
145 RtcpSendTimeMap last_reports_sent_map_; 147 RtcpSendTimeMap last_reports_sent_map_;
146 RtcpSendTimeQueue last_reports_sent_queue_; 148 RtcpSendTimeQueue last_reports_sent_queue_;
147 149
148 // The truncated (i.e., 64-->32-bit) NTP timestamp provided in the last report 150 // The truncated (i.e., 64-->32-bit) NTP timestamp provided in the last report
149 // from the remote peer, along with the local time at which the report was 151 // from the remote peer, along with the local time at which the report was
150 // received. These values are used for ping-pong'ing NTP timestamps between 152 // received. These values are used for ping-pong'ing NTP timestamps between
151 // the peers so that they can estimate the network's round-trip time. 153 // the peers so that they can estimate the network's round-trip time.
(...skipping 29 matching lines...) Expand all
181 base::hash_set<ReceiverEventKey> receiver_event_key_set_; 183 base::hash_set<ReceiverEventKey> receiver_event_key_set_;
182 std::queue<ReceiverEventKey> receiver_event_key_queue_; 184 std::queue<ReceiverEventKey> receiver_event_key_queue_;
183 185
184 DISALLOW_COPY_AND_ASSIGN(Rtcp); 186 DISALLOW_COPY_AND_ASSIGN(Rtcp);
185 }; 187 };
186 188
187 } // namespace cast 189 } // namespace cast
188 } // namespace media 190 } // namespace media
189 191
190 #endif // MEDIA_CAST_RTCP_RTCP_H_ 192 #endif // MEDIA_CAST_RTCP_RTCP_H_
OLDNEW
« no previous file with comments | « media/cast/cast_testing.gypi ('k') | media/cast/net/rtcp/rtcp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698