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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h

Issue 1290813008: Add RemoteEstimatorProxy for capturing receive times (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 4 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
(Empty)
1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_
12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_
13
14 #include <map>
15 #include <vector>
16
17 #include "webrtc/base/criticalsection.h"
18 #include "webrtc/modules/interface/module_common_types.h"
19 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h"
20
21 namespace webrtc {
22
23 class Clock;
24 class PacketRouter;
25 namespace rtcp {
26 class TransportFeedback;
27 }
28
29 // Class used when send-side BWE is enabled: This proxy is instantiated on the
30 // receive side. It buffers a number of receive timestamps and then sends
31 // transport feedback messages back too the send side.
32
33 class RemoteEstimatorProxy : public RemoteBitrateEstimator {
34 public:
35 RemoteEstimatorProxy(Clock* clock, PacketRouter* packet_router);
36 virtual ~RemoteEstimatorProxy();
37
38 void IncomingPacketFeedbackVector(
39 const std::vector<PacketInfo>& packet_feedback_vector) override;
40 void IncomingPacket(int64_t arrival_time_ms,
41 size_t payload_size,
42 const RTPHeader& header,
43 bool was_paced) override;
44 void RemoveStream(unsigned int ssrc) override;
45 bool LatestEstimate(std::vector<unsigned int>* ssrcs,
46 unsigned int* bitrate_bps) const override;
47 bool GetStats(ReceiveBandwidthEstimatorStats* output) const override;
48 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override;
49 int64_t TimeUntilNextProcess() override;
50 int32_t Process() override;
51
52 static const int kDefaultProcessIntervalMs;
53 static const int kBackWindowMs;
stefan-webrtc 2015/09/04 07:31:36 Can these be in the .cc file?
sprang_webrtc 2015/09/04 13:29:44 Put them here so the unit tests can access them.
54
55 private:
56 void OnPacketArrival(uint16_t sequence_number, int64_t arrival_time)
57 EXCLUSIVE_LOCKS_REQUIRED(&lock_);
58 bool BuildFeedbackPacket(rtcp::TransportFeedback* feedback_packetket);
stefan-webrtc 2015/09/04 07:31:36 feedback_packet
sprang_webrtc 2015/09/04 13:29:44 Done.
59
60 Clock* const clock_;
61 PacketRouter* const packet_router_;
62 int64_t last_process_time_ms_;
63
64 rtc::CriticalSection lock_;
65
66 uint32_t media_ssrc_ GUARDED_BY(&lock_);
67 uint8_t feedback_sequence_ GUARDED_BY(&lock_);
68 SequenceNumberUnwrapper unwrapper_ GUARDED_BY(&lock_);
69 int64_t window_start_seq_ GUARDED_BY(&lock_);
70 // Map unwrapped seq -> time.
71 std::map<int64_t, int64_t> received_packets_ GUARDED_BY(&lock_);
stefan-webrtc 2015/09/04 07:31:36 Maybe a better name would be packet_arrival_times_
sprang_webrtc 2015/09/04 13:29:44 Done.
72 };
73
74 } // namespace webrtc
75
76 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698