From 5bf4e0810cf4b1580726596e5d3d8bd44e018b55 Mon Sep 17 00:00:00 2001 From: kwiberg Date: Mon, 19 Dec 2016 06:04:04 -0800 Subject: [PATCH] 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} --- webrtc/common_types.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webrtc/common_types.h b/webrtc/common_types.h index 2988bf9f41..fd5d820892 100644 --- a/webrtc/common_types.h +++ b/webrtc/common_types.h @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -328,6 +329,16 @@ struct CodecInst { } 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