Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Select audio/video codec via SDP message manipulation #9

Merged
merged 6 commits into from
Jul 5, 2019

Conversation

djee-ms
Copy link
Member

@djee-ms djee-ms commented Jul 4, 2019

Allow the user to select a preferred audio and/or video codec by manipulating the SDP offer message
sent to the remote peer to remove all other supported codecs.

If the audio (respectively, video) codec specified is not advertised in the SDP offer message, then all the
original audio (respectively, video) codecs are left as is in the offer, to leave a chance to establish a connection, even with other codecs.

This is a workaround for the absence of API for selecting the codecs directly. This method is also used by the PeerCC sample project of WebRTC UWP.

Allow the user to force a specific audio or video codec by tweaking the
SDP offer message to remove other codecs.
This is a workaround for the fact codec selection is not exposed in the
API.
@djee-ms djee-ms added the enhancement New feature or request label Jul 4, 2019
@djee-ms djee-ms added this to the Initial public preview milestone Jul 4, 2019
@djee-ms djee-ms requested a review from a team July 4, 2019 13:08
SdpForceCodecs(message_str, audio_codec_name_str, video_codec_name_str);
*length = std::min(out_message.size(), *length);
memcpy(buffer, out_message.c_str(), *length);
buffer[(*length)++] = '\0';
Copy link
Member

Choose a reason for hiding this comment

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

No way to detect truncation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I started to add it, and forgot to commit in that PR. Will fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants