Revert "RtpTransceiverInterface: introduce SetOfferedRtpHeaderExtensions."
This reverts commit 71db9acc4019b8c9c13b14e6a022cbb3b4255b09. Reason for revert: breaks downstream project. Reason for force push: win bot broken. Original change's description: > RtpTransceiverInterface: introduce SetOfferedRtpHeaderExtensions. > > This change adds exposure of a new transceiver method for > modifying the extensions offered in the next SDP negotiation, > following spec details in https://w3c.github.io/webrtc-extensions/#rtcrtptransceiver-interface. > > Features: > - The interface allows to control the negotiated direction as > per https://tools.ietf.org/html/rfc5285#page-7. > - The interface allows to remove an extension from SDP > negotiation by modifying the direction to > RtpTransceiverDirection::kStopped. > > Note: support for signalling directionality of header extensions > in the SDP isn't implemented yet. > > https://chromestatus.com/feature/5680189201711104. > Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/65YdUi02yZk > > Bug: chromium:1051821 > Change-Id: Iaabc34446f038c46d93c442e90c2a77f77d542d4 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176408 > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Commit-Queue: Markus Handell <handellm@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#31487} TBR=hta@webrtc.org,handellm@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. No-Try: true Bug: chromium:1051821 Change-Id: I70e1a07225d7eeec7480fa5577d8ff647eba6902 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177103 Commit-Queue: Markus Handell <handellm@webrtc.org> Reviewed-by: Markus Handell <handellm@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31516}
This commit is contained in:
committed by
Commit Bot
parent
4d11c02ad3
commit
6f727da62b
@ -114,7 +114,7 @@ RtpTransceiver::RtpTransceiver(
|
||||
: unified_plan_(true),
|
||||
media_type_(sender->media_type()),
|
||||
channel_manager_(channel_manager),
|
||||
header_extensions_to_offer_(std::move(header_extensions_offered)) {
|
||||
HeaderExtensionsToOffer_(std::move(header_extensions_offered)) {
|
||||
RTC_DCHECK(media_type_ == cricket::MEDIA_TYPE_AUDIO ||
|
||||
media_type_ == cricket::MEDIA_TYPE_VIDEO);
|
||||
RTC_DCHECK_EQ(sender->media_type(), receiver->media_type());
|
||||
@ -356,51 +356,7 @@ RTCError RtpTransceiver::SetCodecPreferences(
|
||||
|
||||
std::vector<RtpHeaderExtensionCapability>
|
||||
RtpTransceiver::HeaderExtensionsToOffer() const {
|
||||
return header_extensions_to_offer_;
|
||||
}
|
||||
|
||||
RTCError RtpTransceiver::SetOfferedRtpHeaderExtensions(
|
||||
rtc::ArrayView<const RtpHeaderExtensionCapability>
|
||||
header_extensions_to_offer) {
|
||||
for (const auto& entry : header_extensions_to_offer) {
|
||||
// Handle unsupported requests for mandatory extensions as per
|
||||
// https://w3c.github.io/webrtc-extensions/#rtcrtptransceiver-interface.
|
||||
// Note:
|
||||
// - We do not handle setOfferedRtpHeaderExtensions algorithm step 2.1,
|
||||
// this has to be checked on a higher level. We naturally error out
|
||||
// in the handling of Step 2.2 if an unset URI is encountered.
|
||||
|
||||
// Step 2.2.
|
||||
// Handle unknown extensions.
|
||||
auto it = std::find_if(
|
||||
header_extensions_to_offer_.begin(), header_extensions_to_offer_.end(),
|
||||
[&entry](const auto& offered) { return entry.uri == offered.uri; });
|
||||
if (it == header_extensions_to_offer_.end()) {
|
||||
return RTCError(RTCErrorType::INVALID_PARAMETER,
|
||||
"Attempted to modify an unoffered extension.");
|
||||
}
|
||||
|
||||
// Step 2.4-2.5.
|
||||
// - Use of the transceiver interface indicates unified plan is in effect,
|
||||
// hence the MID extension needs to be enabled.
|
||||
// - Also handle the mandatory video orientation extensions.
|
||||
if ((entry.uri == RtpExtension::kMidUri ||
|
||||
entry.uri == RtpExtension::kVideoRotationUri) &&
|
||||
entry.direction != RtpTransceiverDirection::kSendRecv) {
|
||||
return RTCError(RTCErrorType::INVALID_MODIFICATION,
|
||||
"Attempted to stop a mandatory extension.");
|
||||
}
|
||||
}
|
||||
|
||||
// Apply mutation after error checking.
|
||||
for (const auto& entry : header_extensions_to_offer) {
|
||||
auto it = std::find_if(
|
||||
header_extensions_to_offer_.begin(), header_extensions_to_offer_.end(),
|
||||
[&entry](const auto& offered) { return entry.uri == offered.uri; });
|
||||
it->direction = entry.direction;
|
||||
}
|
||||
|
||||
return RTCError::OK();
|
||||
return HeaderExtensionsToOffer_;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user