Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实例化RTCRtpParametersImpl时没有初始化rtp_parameters_ #54

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

zjzhang-cn
Copy link
Collaborator

No description provided.

Copy link
Member

@cloudwebrtc cloudwebrtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cloudwebrtc cloudwebrtc merged commit 8379c61 into webrtc-sdk:master Nov 16, 2022
@zjzhang-cn zjzhang-cn deleted the fix_rtpparamers branch November 16, 2022 05:24
@Meonardo
Copy link

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.

Could you take a look? thanks.

@zjzhang-cn
Copy link
Collaborator Author

zjzhang-cn commented Nov 17, 2022

image
Sender cannot be in stop state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants