1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

Fix #3093: WebRTC: Ignore unknown fmtp for h.264. v4.0.263

This commit is contained in:
winlin 2022-09-09 16:16:50 +08:00
parent ef3347e37e
commit 1c0236aa0d
3 changed files with 31 additions and 23 deletions

View file

@ -8,6 +8,7 @@ The changelog for SRS.
## SRS 4.0 Changelog ## SRS 4.0 Changelog
* v4.0, 2022-09-09, Fix [#3093](https://github.com/ossrs/srs/issues/3093): WebRTC: Ignore unknown fmtp for h.264. v4.0.263
* v4.0, 2022-09-06, Fix [#3170](https://github.com/ossrs/srs/issues/3170): WebRTC: Support WHIP(WebRTC-HTTP ingestion protocol). v4.0.262 * v4.0, 2022-09-06, Fix [#3170](https://github.com/ossrs/srs/issues/3170): WebRTC: Support WHIP(WebRTC-HTTP ingestion protocol). v4.0.262
* v4.0, 2022-09-03, Fix HTTP url parsing bug. v4.0.261 * v4.0, 2022-09-03, Fix HTTP url parsing bug. v4.0.261
* v4.0, 2022-09-03, For [#3167](https://github.com/ossrs/srs/issues/3167): WebRTC: Play stucked when republish. v4.0.260 * v4.0, 2022-09-03, For [#3167](https://github.com/ossrs/srs/issues/3167): WebRTC: Play stucked when republish. v4.0.260

View file

@ -56,32 +56,39 @@ static void skip_first_spaces(std::string& str)
srs_error_t srs_parse_h264_fmtp(const std::string& fmtp, H264SpecificParam& h264_param) srs_error_t srs_parse_h264_fmtp(const std::string& fmtp, H264SpecificParam& h264_param)
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
std::vector<std::string> vec = split_str(fmtp, ";");
std::vector<std::string> vec = srs_string_split(fmtp, ";");
for (size_t i = 0; i < vec.size(); ++i) { for (size_t i = 0; i < vec.size(); ++i) {
std::vector<std::string> kv = split_str(vec[i], "="); std::vector<std::string> kv = srs_string_split(vec[i], "=");
if (kv.size() == 2) { if (kv.size() != 2) continue;
if (kv[0] == "profile-level-id") {
h264_param.profile_level_id = kv[1]; if (kv[0] == "profile-level-id") {
} else if (kv[0] == "packetization-mode") { h264_param.profile_level_id = kv[1];
// 6.3. Non-Interleaved Mode } else if (kv[0] == "packetization-mode") {
// This mode is in use when the value of the OPTIONAL packetization-mode // 6.3. Non-Interleaved Mode
// media type parameter is equal to 1. This mode SHOULD be supported. // This mode is in use when the value of the OPTIONAL packetization-mode
// It is primarily intended for low-delay applications. Only single NAL // media type parameter is equal to 1. This mode SHOULD be supported.
// unit packets, STAP-As, and FU-As MAY be used in this mode. STAP-Bs, // It is primarily intended for low-delay applications. Only single NAL
// MTAPs, and FU-Bs MUST NOT be used. The transmission order of NAL // unit packets, STAP-As, and FU-As MAY be used in this mode. STAP-Bs,
// units MUST comply with the NAL unit decoding order. // MTAPs, and FU-Bs MUST NOT be used. The transmission order of NAL
// @see https://tools.ietf.org/html/rfc6184#section-6.3 // units MUST comply with the NAL unit decoding order.
h264_param.packetization_mode = kv[1]; // @see https://tools.ietf.org/html/rfc6184#section-6.3
} else if (kv[0] == "level-asymmetry-allowed") { h264_param.packetization_mode = kv[1];
h264_param.level_asymmerty_allow = kv[1]; } else if (kv[0] == "level-asymmetry-allowed") {
} else { h264_param.level_asymmerty_allow = kv[1];
return srs_error_new(ERROR_RTC_SDP_DECODE, "invalid h264 param=%s", kv[0].c_str());
}
} else {
return srs_error_new(ERROR_RTC_SDP_DECODE, "invalid h264 param=%s", vec[i].c_str());
} }
} }
if (h264_param.profile_level_id.empty()) {
return srs_error_new(ERROR_RTC_SDP_DECODE, "no h264 param: profile-level-id");
}
if (h264_param.packetization_mode.empty()) {
return srs_error_new(ERROR_RTC_SDP_DECODE, "no h264 param: packetization-mode");
}
if (h264_param.level_asymmerty_allow.empty()) {
return srs_error_new(ERROR_RTC_SDP_DECODE, "no h264 param: level-asymmetry-allowed");
}
return err; return err;
} }

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 4 #define VERSION_MAJOR 4
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 262 #define VERSION_REVISION 263
#endif #endif