Implement operator<< for AudioCodecInfo and AudioCodecSpec
I keep having to re-write these whenever I'm debugging. BUG=webrtc:5806 Review-Url: https://codereview.webrtc.org/2936533003 Cr-Commit-Position: refs/heads/master@{#18586}
This commit is contained in:
parent
6c4ba9f77d
commit
96444aecfc
@ -108,4 +108,23 @@ AudioCodecInfo::AudioCodecInfo(int sample_rate_hz,
|
||||
RTC_DCHECK_GE(max_bitrate_bps, default_bitrate_bps);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const AudioCodecInfo& aci) {
|
||||
os << "{sample_rate_hz: " << aci.sample_rate_hz;
|
||||
os << ", num_channels: " << aci.num_channels;
|
||||
os << ", default_bitrate_bps: " << aci.default_bitrate_bps;
|
||||
os << ", min_bitrate_bps: " << aci.min_bitrate_bps;
|
||||
os << ", max_bitrate_bps: " << aci.max_bitrate_bps;
|
||||
os << ", allow_comfort_noise: " << aci.allow_comfort_noise;
|
||||
os << ", supports_network_adaption: " << aci.supports_network_adaption;
|
||||
os << "}";
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const AudioCodecSpec& acs) {
|
||||
os << "{format: " << acs.format;
|
||||
os << ", info: " << acs.info;
|
||||
os << "}";
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -120,6 +120,8 @@ struct AudioCodecInfo {
|
||||
// network conditions.
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const AudioCodecInfo& aci);
|
||||
|
||||
// AudioCodecSpec ties an audio format to specific information about the codec
|
||||
// and its implementation.
|
||||
struct AudioCodecSpec {
|
||||
@ -133,6 +135,8 @@ struct AudioCodecSpec {
|
||||
AudioCodecInfo info;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const AudioCodecSpec& acs);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_API_AUDIO_CODECS_AUDIO_FORMAT_H_
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user