CodecInst operator<<
I always find myself re-writing this function for debug purposes. It'd
save so much time if it already existed...
BUG=none
Review-Url: https://codereview.webrtc.org/2589773002
Cr-Commit-Position: refs/heads/master@{#15677}
diff --git a/webrtc/common_types.h b/webrtc/common_types.h
index 2988bf9f..fd5d820 100644
--- a/webrtc/common_types.h
+++ b/webrtc/common_types.h
@@ -14,6 +14,7 @@
#include <stddef.h>
#include <string.h>
+#include <ostream>
#include <string>
#include <vector>
@@ -328,6 +329,16 @@
}
bool operator!=(const CodecInst& other) const { return !(*this == other); }
+
+ friend std::ostream& operator<<(std::ostream& os, const CodecInst& ci) {
+ os << "{pltype: " << ci.pltype;
+ os << ", plname: " << ci.plname;
+ os << ", plfreq: " << ci.plfreq;
+ os << ", pacsize: " << ci.pacsize;
+ os << ", channels: " << ci.channels;
+ os << ", rate: " << ci.rate << "}";
+ return os;
+ }
};
// RTP