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

Select audio/video codec via SDP message manipulation#9

Merged
jehumb-havok merged 6 commits intodevfrom
feature/sdp_force_codecs
Jul 5, 2019
Merged

Select audio/video codec via SDP message manipulation#9
jehumb-havok merged 6 commits intodevfrom
feature/sdp_force_codecs

Conversation

@jehumb-havok
Copy link
Copy Markdown
Member

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.
@jehumb-havok jehumb-havok added the enhancement New feature or request label Jul 4, 2019
@jehumb-havok jehumb-havok added this to the Initial public preview milestone Jul 4, 2019
@jehumb-havok jehumb-havok 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
Copy Markdown
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
Copy Markdown
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.

2 participants