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

Unified Diff: media/cast/test/utility/udp_proxy.cc

Issue 480563004: Cast: Reject old RTCP packets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/test/utility/udp_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/test/utility/udp_proxy.cc
diff --git a/media/cast/test/utility/udp_proxy.cc b/media/cast/test/utility/udp_proxy.cc
index e71678c482ed8cfb85f46f870d7c43386ec010bd..4dbac83fa51980c25f4beba5784195dc2bad5d75 100644
--- a/media/cast/test/utility/udp_proxy.cc
+++ b/media/cast/test/utility/udp_proxy.cc
@@ -186,6 +186,29 @@ scoped_ptr<PacketPipe> NewRandomUnsortedDelay(double random_delay) {
return scoped_ptr<PacketPipe>(new RandomUnsortedDelay(random_delay)).Pass();
}
+class DuplicateAndDelay : public RandomUnsortedDelay {
+ public:
+ DuplicateAndDelay(double delay_min,
+ double random_delay) :
+ RandomUnsortedDelay(random_delay),
+ delay_min_(delay_min) {
+ }
+ virtual void Send(scoped_ptr<Packet> packet) OVERRIDE {
+ pipe_->Send(scoped_ptr<Packet>(new Packet(*packet.get())));
+ RandomUnsortedDelay::Send(packet.Pass());
+ }
+ virtual double GetDelay() OVERRIDE {
+ return RandomUnsortedDelay::GetDelay() + delay_min_;
+ }
+ private:
+ double delay_min_;
+};
+
+scoped_ptr<PacketPipe> NewDuplicateAndDelay(double delay_min,
+ double random_delay) {
+ return scoped_ptr<PacketPipe>(
+ new DuplicateAndDelay(delay_min, random_delay)).Pass();
+}
class RandomSortedDelay : public PacketPipe {
public:
« no previous file with comments | « media/cast/test/utility/udp_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698