aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
diff options
context:
space:
mode:
authorstefan@webrtc.org <stefan@webrtc.org>2015-02-02 14:51:20 +0000
committerstefan@webrtc.org <stefan@webrtc.org>2015-02-02 14:51:45 +0000
commit946ad76f7e37fc0af2c92a21684af486611c187e (patch)
treecfb62f5a414feba078dcd145ca605e3c1c3631a6 /webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
parentc957ffc6dc36879e5ad72d7f0af2a014707d70fa (diff)
downloadwebrtc-946ad76f7e37fc0af2c92a21684af486611c187e.tar.gz
Switched lists of packets to lists of packet pointers. Allows Packet polymorphism.
This allows for different packet types in a follow-up CL, so that feedback can be passed through the network instead being fed directly into senders. It also made the whole simulator faster. BUG=4173 R=pbos@webrtc.org, sprang@webrtc.org Review URL: https://webrtc-codereview.appspot.com/39679004 Cr-Commit-Position: refs/heads/master@{#8227} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8227 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h')
-rw-r--r--webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
index f9457d2227..3d79c96525 100644
--- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
+++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
@@ -42,6 +42,11 @@ class RateCounter;
typedef std::set<int> FlowIds;
const FlowIds CreateFlowIds(const int *flow_ids_array, size_t num_flow_ids);
+template <typename T>
+bool DereferencingComparator(const T* const& a, const T* const& b) {
+ return *a < *b;
+}
+
template<typename T> class Stats {
public:
Stats()
@@ -160,6 +165,8 @@ class Packet {
const RTPHeader& header);
Packet(int64_t send_time_us, uint32_t sequence_number);
+ virtual ~Packet();
+
bool operator<(const Packet& rhs) const;
int flow_id() const { return flow_id_; }
@@ -178,9 +185,9 @@ class Packet {
RTPHeader header_; // Actual contents.
};
-typedef std::list<Packet> Packets;
-typedef std::list<Packet>::iterator PacketsIt;
-typedef std::list<Packet>::const_iterator PacketsConstIt;
+typedef std::list<Packet*> Packets;
+typedef std::list<Packet*>::iterator PacketsIt;
+typedef std::list<Packet*>::const_iterator PacketsConstIt;
bool IsTimeSorted(const Packets& packets);