From b5e6c12ee8f073ef46abf7a130d0bd61954b9760 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Tue, 6 Apr 2021 23:46:45 +0800 Subject: [PATCH] =?UTF-8?q?H264=20profile=E6=AF=94=E5=AF=B9=E4=B8=8D?= =?UTF-8?q?=E5=8C=BA=E5=88=86=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 6 +++--- webrtc/Sdp.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index 8a5f6f02..38506b5e 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1535,7 +1535,7 @@ static map toMap(const vectorcodec)) { if (plan.sample_rate != _rtsp_audio_plan->sample_rate || plan.channel != _rtsp_audio_plan->channel) { //音频采样率和通道数必须相同 @@ -1548,12 +1548,12 @@ bool RtcConfigure::onMatchCodecPlan(const RtcCodecPlan &plan, CodecId codec){ auto rtc_fmt_map = toMap(plan.fmtp); auto rtsp_fmt_map = toMap(_rtsp_video_plan->fmtp); auto &profile = rtsp_fmt_map[kProfile]; - if (!profile.empty() && profile != rtc_fmt_map[kProfile]) { + if (!profile.empty() && strcasecmp(profile.data(), rtc_fmt_map[kProfile].data())) { //profile-level-id 不匹配 return false; } auto &mode = rtsp_fmt_map[kMode]; - if (!mode.empty() && mode != rtc_fmt_map[kMode]) { + if (!mode.empty() && atoi(mode.data()) != atoi(rtc_fmt_map[kMode].data())) { //packetization-mode不匹配 return false; } diff --git a/webrtc/Sdp.h b/webrtc/Sdp.h index 7fc0b0b9..2a9eb6ee 100644 --- a/webrtc/Sdp.h +++ b/webrtc/Sdp.h @@ -708,7 +708,7 @@ public: private: void matchMedia(shared_ptr &ret, TrackType type, const vector &medias, const RtcTrackConfigure &configure); - bool onMatchCodecPlan(const RtcCodecPlan &plan, CodecId codec); + bool onCheckCodecProfile(const RtcCodecPlan &plan, CodecId codec); private: RtcCodecPlan::Ptr _rtsp_video_plan;