mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-12 19:24:22 +08:00
feat: add H.265 profile parameters support for WebRTC SDP negotiation
This commit is contained in:
@@ -1845,7 +1845,8 @@ void RtcConfigure::setPlayRtspInfo(const string &sdp) {
|
||||
}
|
||||
}
|
||||
|
||||
static const string kProfile { "profile-level-id" };
|
||||
static const string kH264Profile { "profile-level-id" };
|
||||
static const string kH265Profile { "profile-id" };
|
||||
static const string kMode { "packetization-mode" };
|
||||
|
||||
bool RtcConfigure::onCheckCodecProfile(const RtcCodecPlan &plan, CodecId codec) const {
|
||||
@@ -1860,7 +1861,7 @@ bool RtcConfigure::onCheckCodecProfile(const RtcCodecPlan &plan, CodecId codec)
|
||||
if (_rtsp_video_plan && codec == CodecH264 && getCodecId(_rtsp_video_plan->codec) == CodecH264) {
|
||||
// h264时,profile-level-id [AUTO-TRANSLATED:94a5f360]
|
||||
// When h264, profile-level-id
|
||||
if (strcasecmp(_rtsp_video_plan->fmtp[kProfile].data(), const_cast<RtcCodecPlan &>(plan).fmtp[kProfile].data())) {
|
||||
if (strcasecmp(_rtsp_video_plan->fmtp[kH264Profile].data(), const_cast<RtcCodecPlan &>(plan).fmtp[kH264Profile].data())) {
|
||||
// profile-level-id 不匹配 [AUTO-TRANSLATED:814ec4c4]
|
||||
// profile-level-id does not match
|
||||
return false;
|
||||
@@ -1868,6 +1869,15 @@ bool RtcConfigure::onCheckCodecProfile(const RtcCodecPlan &plan, CodecId codec)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_rtsp_video_plan && codec == CodecH265 && getCodecId(_rtsp_video_plan->codec) == CodecH265) {
|
||||
// h265时,profile-id
|
||||
if (strcasecmp(_rtsp_video_plan->fmtp[kH265Profile].data(), const_cast<RtcCodecPlan &>(plan).fmtp[kH265Profile].data())) {
|
||||
// profile-id 不匹配
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user