1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Support OPUS stereo SDP option. v5.0.203 v6.0.105 (#3910)

In an SDK that supports RTC Opus stereo, the parameter "stereo=1" may
appear. SRS (Spatial Reference System) needs to handle this correctly
and return an answer to enable WebRTC stereo support.



---------

`TRANS_BY_GPT4`
This commit is contained in:
john 2023-12-14 23:29:22 +08:00 committed by GitHub
parent 6d56c407c6
commit 15601b4b2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 3 deletions

View file

@ -1968,6 +1968,7 @@ SrsAudioPayload::SrsAudioPayload(uint8_t pt, std::string encode_name, int sample
channel_ = channel;
opus_param_.minptime = 0;
opus_param_.use_inband_fec = false;
opus_param_.stereo = false;
opus_param_.usedtx = false;
}
@ -2009,6 +2010,9 @@ SrsMediaPayloadType SrsAudioPayload::generate_media_payload_type()
if (opus_param_.use_inband_fec) {
format_specific_param << ";useinbandfec=1";
}
if (opus_param_.stereo) {
format_specific_param << ";stereo=1";
}
if (opus_param_.usedtx) {
format_specific_param << ";usedtx=1";
}
@ -2028,6 +2032,8 @@ srs_error_t SrsAudioPayload::set_opus_param_desc(std::string fmtp)
opus_param_.minptime = (int)::atol(kv[1].c_str());
} else if (kv[0] == "useinbandfec") {
opus_param_.use_inband_fec = (kv[1] == "1") ? true : false;
} else if (kv[0] == "stereo") {
opus_param_.stereo = (kv[1] == "1") ? true : false;
} else if (kv[0] == "usedtx") {
opus_param_.usedtx = (kv[1] == "1") ? true : false;
}