Summary: | calling transceiver setCodecPreferences doesn't change the order of codecs in the offer/answer generated by the browser | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jaya <jaya.allamsetty> | ||||||
Component: | WebRTC | Assignee: | youenn fablet <youennf> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, clopez, darin, eric.carlson, esprehn+autocc, ews-watchlist, glenn, hta, jer.noble, kondapallykalyan, philipj, sergio, tommyw, webkit-bug-importer, youennf | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | Safari Technology Preview | ||||||||
Hardware: | Mac | ||||||||
OS: | macOS 10.15 | ||||||||
See Also: | https://github.com/web-platform-tests/wpt/pull/25360 | ||||||||
Attachments: |
|
Description
Jaya
2020-08-17 07:15:07 PDT
Created attachment 407754 [details]
Patch
Created attachment 407758 [details]
Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/25360 Committed r266508: <https://trac.webkit.org/changeset/266508> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407758 [details]. Comment on attachment 407758 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407758&action=review > Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:413 > + if (hasParameter) > + sdpFmtpLine.append(";"); > + else > + hasParameter = true; > + sdpFmtpLine.append(StringView(parameter.first.data(), parameter.first.length())); > + sdpFmtpLine.append("="); > + sdpFmtpLine.append(StringView(parameter.second.data(), parameter.second.length())); Here’s a more efficient way to do this: const char* separator = hasParameter ? ";" : ""; hasParameter = true; sdpFmtpLine.append(separator, StringView(parameter.first.data(), parameter.first.length()), '=', StringView(parameter.second.data(), parameter.second.length())); A single call to append is more efficient than four separate calls to append. Or if you prefer, like this: sdpFmtpLine.append(hasParameter ? ";" : "", StringView(parameter.first.data(), parameter.first.length()), '=', StringView(parameter.second.data(), parameter.second.length())); hasParameter = true; Or even this: sdpFmtpLine.append(std::exchange(hasParameter, true) ? ";" : "", StringView(parameter.first.data(), parameter.first.length()), '=', StringView(parameter.second.data(), parameter.second.length())); |