From fb97c2139a064c2c36e0221d2183d2ef57836be6 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Thu, 18 Nov 2021 21:36:10 +0800 Subject: [PATCH] =?UTF-8?q?Refine:=20=E4=BC=98=E5=8C=96webrtc=20sdp?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 10 ++++------ webrtc/Sdp.h | 7 ++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index 04f40c53..0831a1cf 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1447,16 +1447,14 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){ } } -void RtcConfigure::setDefaultSetting(string ice_ufrag, - string ice_pwd, - RtpDirection direction, +void RtcConfigure::setDefaultSetting(string ice_ufrag, string ice_pwd, RtpDirection direction, const SdpAttrFingerprint &fingerprint) { video.setDefaultSetting(TrackVideo); audio.setDefaultSetting(TrackAudio); application.setDefaultSetting(TrackApplication); - video.ice_ufrag = audio.ice_ufrag = application.ice_ufrag = ice_ufrag; - video.ice_pwd = audio.ice_pwd = application.ice_pwd = ice_pwd; + video.ice_ufrag = audio.ice_ufrag = application.ice_ufrag = std::move(ice_ufrag); + video.ice_pwd = audio.ice_pwd = application.ice_pwd = std::move(ice_pwd); video.direction = audio.direction = application.direction = direction; video.fingerprint = audio.fingerprint = application.fingerprint = fingerprint; } @@ -1579,7 +1577,7 @@ static RtpDirection matchDirection(RtpDirection offer_direction, RtpDirection su } } -void RtcConfigure::matchMedia(shared_ptr &ret, TrackType type, const vector &medias, const RtcTrackConfigure &configure){ +void RtcConfigure::matchMedia(const shared_ptr &ret, TrackType type, const vector &medias, const RtcTrackConfigure &configure){ bool check_profile = true; bool check_codec = true; diff --git a/webrtc/Sdp.h b/webrtc/Sdp.h index 9e8f8f71..d75f58e0 100644 --- a/webrtc/Sdp.h +++ b/webrtc/Sdp.h @@ -710,10 +710,7 @@ public: RtcTrackConfigure audio; RtcTrackConfigure application; - void setDefaultSetting(string ice_ufrag, - string ice_pwd, - RtpDirection direction, - const SdpAttrFingerprint &fingerprint); + void setDefaultSetting(string ice_ufrag, string ice_pwd, RtpDirection direction, const SdpAttrFingerprint &fingerprint); void addCandidate(const SdpAttrCandidate &candidate, TrackType type = TrackInvalid); shared_ptr createAnswer(const RtcSession &offer); @@ -724,7 +721,7 @@ public: void enableREMB(bool enable = true, TrackType type = TrackInvalid); private: - void matchMedia(shared_ptr &ret, TrackType type, const vector &medias, const RtcTrackConfigure &configure); + void matchMedia(const shared_ptr &ret, TrackType type, const vector &medias, const RtcTrackConfigure &configure); bool onCheckCodecProfile(const RtcCodecPlan &plan, CodecId codec); void onSelectPlan(RtcCodecPlan &plan, CodecId codec);