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

Unified Diff: webrtc/call/flexfec_receive_stream.cc

Issue 2542413002: Generalize FlexfecReceiveStream::Config. (CL1) (Closed)
Patch Set: Rebase. Created 4 years 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 | « webrtc/call/call_unittest.cc ('k') | webrtc/call/flexfec_receive_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/flexfec_receive_stream.cc
diff --git a/webrtc/call/flexfec_receive_stream.cc b/webrtc/call/flexfec_receive_stream.cc
index 6ab1c3ab66dd4d6bbf6b0e7580d62ca78eb86126..61a31418ccda31af061dbb8e50a2dd4b030bf649 100644
--- a/webrtc/call/flexfec_receive_stream.cc
+++ b/webrtc/call/flexfec_receive_stream.cc
@@ -22,20 +22,42 @@ std::string FlexfecReceiveStream::Stats::ToString(int64_t time_ms) const {
return ss.str();
}
+std::string FlexfecReceiveStream::Config::ToString() const {
+ std::stringstream ss;
+ ss << "{payload_type: " << payload_type;
+ ss << ", remote_ssrc: " << remote_ssrc;
+ ss << ", local_ssrc: " << local_ssrc;
+ ss << ", protected_media_ssrcs: [";
+ size_t i = 0;
+ for (; i + 1 < protected_media_ssrcs.size(); ++i)
+ ss << protected_media_ssrcs[i] << ", ";
+ if (!protected_media_ssrcs.empty())
+ ss << protected_media_ssrcs[i];
+ ss << "], transport_cc: " << (transport_cc ? "on" : "off");
+ ss << ", extensions: [";
+ i = 0;
+ for (; i + 1 < extensions.size(); ++i)
+ ss << extensions[i].ToString() << ", ";
+ if (!extensions.empty())
+ ss << extensions[i].ToString();
+ ss << "]}";
+ return ss.str();
+}
+
namespace {
// TODO(brandtr): Update this function when we support multistream protection.
std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver(
const FlexfecReceiveStream::Config& config,
RecoveredPacketReceiver* recovered_packet_callback) {
- if (config.flexfec_payload_type < 0) {
+ if (config.payload_type < 0) {
LOG(LS_WARNING) << "Invalid FlexFEC payload type given. "
<< "This FlexfecReceiveStream will therefore be useless.";
return nullptr;
}
- RTC_DCHECK_GE(config.flexfec_payload_type, 0);
- RTC_DCHECK_LE(config.flexfec_payload_type, 127);
- if (config.flexfec_ssrc == 0) {
+ RTC_DCHECK_GE(config.payload_type, 0);
+ RTC_DCHECK_LE(config.payload_type, 127);
+ if (config.remote_ssrc == 0) {
LOG(LS_WARNING) << "Invalid FlexFEC SSRC given. "
<< "This FlexfecReceiveStream will therefore be useless.";
return nullptr;
@@ -56,7 +78,7 @@ std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver(
}
RTC_DCHECK_EQ(1U, config.protected_media_ssrcs.size());
return std::unique_ptr<FlexfecReceiver>(
- new FlexfecReceiver(config.flexfec_ssrc, config.protected_media_ssrcs[0],
+ new FlexfecReceiver(config.remote_ssrc, config.protected_media_ssrcs[0],
recovered_packet_callback));
}
« no previous file with comments | « webrtc/call/call_unittest.cc ('k') | webrtc/call/flexfec_receive_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698