Hi, I could not set the encoding params successfully, sender->set_parameters(p) always return false
here the code what I am using to set the encoding params:
void ApplyBitrateSettings() {
auto senders = pc_->senders();
for (int i = 0; i < senders.size(); i++) {
auto sender = senders[i];
auto sender_track = sender->track();
if (sender_track == nullptr)
return;
if (sender_track->kind().std_string() == "video") {
auto vec = sender->parameters()->encodings().std_vector();
if (!vec.empty()) {
auto p = vec.front();
p->set_min_bitrate_bps(1000 * 1000 * 2);
p->set_max_bitrate_bps(1000 * 1000 * 4);
} else {
auto p = RTCRtpEncodingParameters::Create();
p1->set_min_bitrate_bps(1000 * 1000 * 2);
p1->set_max_bitrate_bps(1000 * 1000 * 4);
vec.push_back(p1);
}
auto p = sender->parameters();
p->set_encodings(vec);
bool success = sender->set_parameters(p);
std::cout << "Update RTCRTPEncodingParameter result: " << success
<< std::endl;
break;
}
}
}
I call ApplyBitrateSettings() after I set local sdp successfully.
Hi, I could not set the encoding params successfully,
sender->set_parameters(p)
always returnfalse
here the code what I am using to set the encoding params:I call
ApplyBitrateSettings()
after I set local sdp successfully.Could you take a look? thanks.