Skip to content

Media-sender example with offer from the browser #1092

Closed Answered by ap0nia
ap0nia asked this question in Q&A
Discussion options

You must be logged in to vote

Solved based on the rough guidelines provided here: #1064 (comment)

The solution that worked for me was something like this:

 rtc::SSRC ssrc = 42;
 std::string targetCodec = "H264";
 int payloadType = -1;
// For POC, define track in outer scope
std::shared_ptr<rtc::Track> track;

 pc->onTrack([](const std::shared_ptr<rtc::Track>& t) {
  track = t;
  rtc::Description::Media description = track->description();
  description.addSSRC(ssrc, "video-send");

  // This stuff might be superfluous/unoptimal, but it was helpful for my understanding
  // Removes all payload types except for the target one, e.g. 39 for H264
  std::vector<int> payloadTypesToRemove;

  for (int p : description.payloadTypes

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@paullouisageneau
Comment options

Answer selected by ap0nia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants