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

Expose PeerConnectionInterface::SetBitrate #109

Merged
jehumb-havok merged 4 commits intomicrosoft:masterfrom
fiban-havok:set-bitrate
Oct 24, 2019
Merged

Expose PeerConnectionInterface::SetBitrate #109
jehumb-havok merged 4 commits intomicrosoft:masterfrom
fiban-havok:set-bitrate

Conversation

@fiban-havok
Copy link
Copy Markdown
Member

Add usage example in TestAppUWP.
Mitigates #107.

@fiban-havok fiban-havok added the enhancement New feature or request label Oct 23, 2019
@fiban-havok fiban-havok added this to the v1.0 release milestone Oct 23, 2019
Comment on lines +604 to +611
/// Set the bitrate allocated to all RTP streams sent by this connection.
/// Other limitations might affect these limits and are respected (for example
/// "b=AS" in SDP).
///
/// Setting |start_bitrate_bps| will reset the current bitrate estimate to the
/// provided value.
///
/// If any of the arguments has a negative value, it will be ignored.
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.

Please add the unit of those (i.e. expand "bps" to "bits-per-second").

Comment on lines +1167 to +1169
/// <param name="minBitrateBps">Minimum bitrate.</param>
/// <param name="startBitrateBps">Start/current target bitrate.</param>
/// <param name="maxBitrateBps">Maximum bitrate.</param>
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.

Same: "Minimum bitrate, in bits per second.", etc.

Comment on lines +1176 to +1180
if (PeerConnectionInterop.PeerConnection_SetBitrate(_nativePeerhandle,
signedMinBitrateBps, signedStartBitrateBps, signedMaxBitrateBps) != Utils.MRS_SUCCESS)
{
throw new InvalidOperationException();
}
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.

uint res = PeerConnectionInterop.PeerConnection_SetBitrate(...);
Utils.ThrowOnErrorCode(res);

This makes customizing the mapping {error code} <-> {exception} must easier, for example if we add new exception types in the future, and keeps it consistent.

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