Fix some comment blocks for easier merging

This commit is contained in:
Jim Gustafson 2024-06-21 13:52:48 -07:00 committed by GitHub
parent 67c77356bc
commit 1357e97179
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 89 additions and 78 deletions

View file

@ -809,7 +809,6 @@ std::vector<VideoCodec> WebRtcVideoEngine::recv_codecs(bool include_rtx) const {
include_rtx, trials_); include_rtx, trials_);
} }
// RingRTC change to disable unused header extensions
std::vector<webrtc::RtpHeaderExtensionCapability> std::vector<webrtc::RtpHeaderExtensionCapability>
WebRtcVideoEngine::GetRtpHeaderExtensions() const { WebRtcVideoEngine::GetRtpHeaderExtensions() const {
std::vector<webrtc::RtpHeaderExtensionCapability> result; std::vector<webrtc::RtpHeaderExtensionCapability> result;
@ -821,6 +820,7 @@ WebRtcVideoEngine::GetRtpHeaderExtensions() const {
webrtc::RtpExtension::kAbsSendTimeUri, webrtc::RtpExtension::kAbsSendTimeUri,
webrtc::RtpExtension::kVideoRotationUri, webrtc::RtpExtension::kVideoRotationUri,
webrtc::RtpExtension::kTransportSequenceNumberUri, webrtc::RtpExtension::kTransportSequenceNumberUri,
// RingRTC change to disable unused header extensions
// webrtc::RtpExtension::kPlayoutDelayUri, // webrtc::RtpExtension::kPlayoutDelayUri,
// webrtc::RtpExtension::kVideoContentTypeUri, // webrtc::RtpExtension::kVideoContentTypeUri,
// webrtc::RtpExtension::kVideoTimingUri, // webrtc::RtpExtension::kVideoTimingUri,
@ -831,29 +831,32 @@ WebRtcVideoEngine::GetRtpHeaderExtensions() const {
}) { }) {
result.emplace_back(uri, id++, webrtc::RtpTransceiverDirection::kSendRecv); result.emplace_back(uri, id++, webrtc::RtpTransceiverDirection::kSendRecv);
} }
// for (const auto& uri : {webrtc::RtpExtension::kAbsoluteCaptureTimeUri}) { // RingRTC change to disable unused header extensions
// result.emplace_back(uri, id, webrtc::RtpTransceiverDirection::kStopped); #if 0
// } for (const auto& uri : {webrtc::RtpExtension::kAbsoluteCaptureTimeUri}) {
// result.emplace_back(webrtc::RtpExtension::kGenericFrameDescriptorUri00, id, result.emplace_back(uri, id, webrtc::RtpTransceiverDirection::kStopped);
// IsEnabled(trials_, "WebRTC-GenericDescriptorAdvertised") }
// ? webrtc::RtpTransceiverDirection::kSendRecv result.emplace_back(webrtc::RtpExtension::kGenericFrameDescriptorUri00, id,
// : webrtc::RtpTransceiverDirection::kStopped); IsEnabled(trials_, "WebRTC-GenericDescriptorAdvertised")
// result.emplace_back( ? webrtc::RtpTransceiverDirection::kSendRecv
// webrtc::RtpExtension::kDependencyDescriptorUri, id, : webrtc::RtpTransceiverDirection::kStopped);
// IsEnabled(trials_, "WebRTC-DependencyDescriptorAdvertised") result.emplace_back(
// ? webrtc::RtpTransceiverDirection::kSendRecv webrtc::RtpExtension::kDependencyDescriptorUri, id,
// : webrtc::RtpTransceiverDirection::kStopped); IsEnabled(trials_, "WebRTC-DependencyDescriptorAdvertised")
// result.emplace_back( ? webrtc::RtpTransceiverDirection::kSendRecv
// webrtc::RtpExtension::kVideoLayersAllocationUri, id, : webrtc::RtpTransceiverDirection::kStopped);
// IsEnabled(trials_, "WebRTC-VideoLayersAllocationAdvertised") result.emplace_back(
// ? webrtc::RtpTransceiverDirection::kSendRecv webrtc::RtpExtension::kVideoLayersAllocationUri, id,
// : webrtc::RtpTransceiverDirection::kStopped); IsEnabled(trials_, "WebRTC-VideoLayersAllocationAdvertised")
// ? webrtc::RtpTransceiverDirection::kSendRecv
// // VideoFrameTrackingId is a test-only extension. : webrtc::RtpTransceiverDirection::kStopped);
// if (IsEnabled(trials_, "WebRTC-VideoFrameTrackingIdAdvertised")) {
// result.emplace_back(webrtc::RtpExtension::kVideoFrameTrackingIdUri, id, // VideoFrameTrackingId is a test-only extension.
// webrtc::RtpTransceiverDirection::kSendRecv); if (IsEnabled(trials_, "WebRTC-VideoFrameTrackingIdAdvertised")) {
// } result.emplace_back(webrtc::RtpExtension::kVideoFrameTrackingIdUri, id,
webrtc::RtpTransceiverDirection::kSendRecv);
}
#endif // RingRTC change to disable unused header extensions
return result; return result;
} }
@ -3104,54 +3107,56 @@ bool WebRtcVideoReceiveChannel::MaybeCreateDefaultReceiveStream(
// know what stream it associates with, and we shouldn't ever create an // know what stream it associates with, and we shouldn't ever create an
// implicit channel for these. // implicit channel for these.
// RingRTC change to not process unsignaled SSRCs // RingRTC change to not process unsignaled SSRCs
// bool is_rtx_payload = false; #if 0
// for (auto& codec : recv_codecs_) { bool is_rtx_payload = false;
// if (packet.PayloadType() == codec.ulpfec.red_rtx_payload_type || for (auto& codec : recv_codecs_) {
// packet.PayloadType() == codec.ulpfec.ulpfec_payload_type) { if (packet.PayloadType() == codec.ulpfec.red_rtx_payload_type ||
// return false; packet.PayloadType() == codec.ulpfec.ulpfec_payload_type) {
// } return false;
// }
// if (packet.PayloadType() == codec.rtx_payload_type) {
// is_rtx_payload = true; if (packet.PayloadType() == codec.rtx_payload_type) {
// break; is_rtx_payload = true;
// } break;
// } }
// }
// if (is_rtx_payload) {
// // As we don't support receiving simulcast there can only be one RTX if (is_rtx_payload) {
// // stream, which will be associated with unsignaled media stream. // As we don't support receiving simulcast there can only be one RTX
// absl::optional<uint32_t> current_default_ssrc = GetUnsignaledSsrc(); // stream, which will be associated with unsignaled media stream.
// if (current_default_ssrc) { absl::optional<uint32_t> current_default_ssrc = GetUnsignaledSsrc();
// FindReceiveStream(*current_default_ssrc)->UpdateRtxSsrc(packet.Ssrc()); if (current_default_ssrc) {
// } else { FindReceiveStream(*current_default_ssrc)->UpdateRtxSsrc(packet.Ssrc());
// // Received unsignaled RTX packet before a media packet. Create a default } else {
// // stream with a "random" SSRC and the RTX SSRC from the packet. The // Received unsignaled RTX packet before a media packet. Create a default
// // stream will be recreated on the first media packet, unless we are // stream with a "random" SSRC and the RTX SSRC from the packet. The
// // extremely lucky and used the right media SSRC. // stream will be recreated on the first media packet, unless we are
// ReCreateDefaultReceiveStream(/*ssrc =*/14795, /*rtx_ssrc=*/packet.Ssrc()); // extremely lucky and used the right media SSRC.
// } ReCreateDefaultReceiveStream(/*ssrc =*/14795, /*rtx_ssrc=*/packet.Ssrc());
// return true; }
// } else { return true;
// // Ignore unknown ssrcs if we recently created an unsignalled receive } else {
// // stream since this shouldn't happen frequently. Getting into a state // Ignore unknown ssrcs if we recently created an unsignalled receive
// // of creating decoders on every packet eats up processing time (e.g. // stream since this shouldn't happen frequently. Getting into a state
// // https://crbug.com/1069603) and this cooldown prevents that. // of creating decoders on every packet eats up processing time (e.g.
// if (last_unsignalled_ssrc_creation_time_ms_.has_value()) { // https://crbug.com/1069603) and this cooldown prevents that.
// int64_t now_ms = rtc::TimeMillis(); if (last_unsignalled_ssrc_creation_time_ms_.has_value()) {
// if (now_ms - last_unsignalled_ssrc_creation_time_ms_.value() < int64_t now_ms = rtc::TimeMillis();
// kUnsignaledSsrcCooldownMs) { if (now_ms - last_unsignalled_ssrc_creation_time_ms_.value() <
// // We've already created an unsignalled ssrc stream within the last kUnsignaledSsrcCooldownMs) {
// // 0.5 s, ignore with a warning. // We've already created an unsignalled ssrc stream within the last
// RTC_LOG(LS_WARNING) // 0.5 s, ignore with a warning.
// << "Another unsignalled ssrc packet arrived shortly after the " RTC_LOG(LS_WARNING)
// << "creation of an unsignalled ssrc stream. Dropping packet."; << "Another unsignalled ssrc packet arrived shortly after the "
// return false; << "creation of an unsignalled ssrc stream. Dropping packet.";
// } return false;
// } }
// } }
// // RTX SSRC not yet known. }
// ReCreateDefaultReceiveStream(packet.Ssrc(), absl::nullopt); // RTX SSRC not yet known.
// last_unsignalled_ssrc_creation_time_ms_ = rtc::TimeMillis(); ReCreateDefaultReceiveStream(packet.Ssrc(), absl::nullopt);
last_unsignalled_ssrc_creation_time_ms_ = rtc::TimeMillis();
#endif // RingRTC change to not process unsignaled SSRCs
return false; return false;
} }

View file

@ -443,19 +443,23 @@ TEST_F(WebRtcVideoEngineTest, SupportsVideoRotationHeaderExtension) {
ExpectRtpCapabilitySupport(RtpExtension::kVideoRotationUri, true); ExpectRtpCapabilitySupport(RtpExtension::kVideoRotationUri, true);
} }
TEST_F(WebRtcVideoEngineTest, SupportsPlayoutDelayHeaderExtension) { // RingRTC change to disable unused header extensions
TEST_F(WebRtcVideoEngineTest, DISABLED_SupportsPlayoutDelayHeaderExtension) {
ExpectRtpCapabilitySupport(RtpExtension::kPlayoutDelayUri, true); ExpectRtpCapabilitySupport(RtpExtension::kPlayoutDelayUri, true);
} }
TEST_F(WebRtcVideoEngineTest, SupportsVideoContentTypeHeaderExtension) { // RingRTC change to disable unused header extensions
TEST_F(WebRtcVideoEngineTest, DISABLED_SupportsVideoContentTypeHeaderExtension) {
ExpectRtpCapabilitySupport(RtpExtension::kVideoContentTypeUri, true); ExpectRtpCapabilitySupport(RtpExtension::kVideoContentTypeUri, true);
} }
TEST_F(WebRtcVideoEngineTest, SupportsVideoTimingHeaderExtension) { // RingRTC change to disable unused header extensions
TEST_F(WebRtcVideoEngineTest, DISABLED_SupportsVideoTimingHeaderExtension) {
ExpectRtpCapabilitySupport(RtpExtension::kVideoTimingUri, true); ExpectRtpCapabilitySupport(RtpExtension::kVideoTimingUri, true);
} }
TEST_F(WebRtcVideoEngineTest, SupportsColorSpaceHeaderExtension) { // RingRTC change to disable unused header extensions
TEST_F(WebRtcVideoEngineTest, DISABLED_SupportsColorSpaceHeaderExtension) {
ExpectRtpCapabilitySupport(RtpExtension::kColorSpaceUri, true); ExpectRtpCapabilitySupport(RtpExtension::kColorSpaceUri, true);
} }
@ -922,7 +926,8 @@ void WebRtcVideoEngineTest::ExpectRtpCapabilitySupport(const char* uri,
} }
} }
TEST_F(WebRtcVideoEngineTest, SendsFeedbackAfterUnsignaledRtxPacket) { // RingRTC change to not process unsignaled SSRCs
TEST_F(WebRtcVideoEngineTest, DISABLED_SendsFeedbackAfterUnsignaledRtxPacket) {
// Setup a channel with VP8, RTX and transport sequence number header // Setup a channel with VP8, RTX and transport sequence number header
// extension. Receive stream is not explicitly configured. // extension. Receive stream is not explicitly configured.
AddSupportedVideoCodecType("VP8"); AddSupportedVideoCodecType("VP8");
@ -1014,7 +1019,8 @@ TEST_F(WebRtcVideoEngineTest, TooHighReceiveBufferSizeViaFieldTrial) {
receive_channel->SetInterface(nullptr); receive_channel->SetInterface(nullptr);
} }
TEST_F(WebRtcVideoEngineTest, UpdatesUnsignaledRtxSsrcAndRecoversPayload) { // RingRTC change to not process unsignaled SSRCs
TEST_F(WebRtcVideoEngineTest, DISABLED_UpdatesUnsignaledRtxSsrcAndRecoversPayload) {
// Setup a channel with VP8, RTX and transport sequence number header // Setup a channel with VP8, RTX and transport sequence number header
// extension. Receive stream is not explicitly configured. // extension. Receive stream is not explicitly configured.
AddSupportedVideoCodecType("VP8"); AddSupportedVideoCodecType("VP8");