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

Unified Diff: webrtc/media/base/codec.h

Issue 2705203002: Implement operator<< for AudioCodec (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | webrtc/media/base/codec_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/codec.h
diff --git a/webrtc/media/base/codec.h b/webrtc/media/base/codec.h
index 7dd8889671beffeee56216c9548b8e3549437d42..0aa0d58ef76b6cc07ec10c5c0a0ea2b88b5fd487 100644
--- a/webrtc/media/base/codec.h
+++ b/webrtc/media/base/codec.h
@@ -144,6 +144,28 @@ struct AudioCodec : public Codec {
}
};
+inline std::ostream& operator<<(std::ostream& os, const AudioCodec& ac) {
+ os << "{id: " << ac.id;
+ os << ", name: " << ac.name;
+ os << ", clockrate: " << ac.clockrate;
+ os << ", bitrate: " << ac.bitrate;
+ os << ", channels: " << ac.channels;
+ os << ", params: {";
+ const char* sep = "";
+ for (const auto& kv : ac.params) {
+ os << sep << kv.first << ": " << kv.second;
+ sep = ", ";
+ }
+ os << "}, feedback_params: {";
+ sep = "";
+ for (const FeedbackParam& fp : ac.feedback_params.params()) {
+ os << sep << fp.id() << ": " << fp.param();
+ sep = ", ";
+ }
+ os << "}}";
+ return os;
+}
+
struct VideoCodec : public Codec {
// Creates a codec with the given parameters.
VideoCodec(int id, const std::string& name);
« no previous file with comments | « no previous file | webrtc/media/base/codec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698