-
Notifications
You must be signed in to change notification settings - Fork 138
Bump protocol to v1.37.1 and add audio_features handling #634
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6aa8ae8
Add lifetime annotations
lukasIO cceb6ea
Add stubs for new protocol fields
lukasIO ad8dc8f
Add ConnectionTimeout to DisconnectReason
lukasIO 7cec42b
protocol bump to v1.37.1
lukasIO 112e09f
More ConnectionTimeout handling
lukasIO d1f5ccf
Handle audio track feature updates
lukasIO f4dddc2
cleanup
lukasIO 3c2d3ee
simplify
lukasIO 743b9d2
Add ffi support for audio track features
lukasIO c498be5
Add FFI audio track feature conversion
lukasIO 1515dd0
don't rely on int
theomonnom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1392,6 +1392,8 @@ pub struct TrackPublicationInfo { | |
| pub remote: bool, | ||
| #[prost(enumeration="EncryptionType", required, tag="11")] | ||
| pub encryption_type: i32, | ||
| #[prost(enumeration="AudioTrackFeature", repeated, packed="false", tag="12")] | ||
| pub audio_features: ::prost::alloc::vec::Vec<i32>, | ||
| } | ||
| #[allow(clippy::derive_partial_eq_without_eq)] | ||
| #[derive(Clone, PartialEq, ::prost::Message)] | ||
|
|
@@ -1575,6 +1577,48 @@ impl StreamState { | |
| } | ||
| } | ||
| } | ||
| #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] | ||
| #[repr(i32)] | ||
| pub enum AudioTrackFeature { | ||
| TfStereo = 0, | ||
| TfNoDtx = 1, | ||
| TfAutoGainControl = 2, | ||
| TfEchoCancellation = 3, | ||
| TfNoiseSuppression = 4, | ||
| TfEnhancedNoiseCancellation = 5, | ||
| /// client will buffer audio once available and send it to the server via bytes stream once connected | ||
| TfPreconnectBuffer = 6, | ||
| } | ||
| impl AudioTrackFeature { | ||
| /// String value of the enum field names used in the ProtoBuf definition. | ||
| /// | ||
| /// The values are not transformed in any way and thus are considered stable | ||
| /// (if the ProtoBuf definition does not change) and safe for programmatic use. | ||
| pub fn as_str_name(&self) -> &'static str { | ||
| match self { | ||
| AudioTrackFeature::TfStereo => "TF_STEREO", | ||
| AudioTrackFeature::TfNoDtx => "TF_NO_DTX", | ||
| AudioTrackFeature::TfAutoGainControl => "TF_AUTO_GAIN_CONTROL", | ||
| AudioTrackFeature::TfEchoCancellation => "TF_ECHO_CANCELLATION", | ||
| AudioTrackFeature::TfNoiseSuppression => "TF_NOISE_SUPPRESSION", | ||
| AudioTrackFeature::TfEnhancedNoiseCancellation => "TF_ENHANCED_NOISE_CANCELLATION", | ||
| AudioTrackFeature::TfPreconnectBuffer => "TF_PRECONNECT_BUFFER", | ||
| } | ||
| } | ||
| /// Creates an enum from field names used in the ProtoBuf definition. | ||
| pub fn from_str_name(value: &str) -> ::core::option::Option<Self> { | ||
| match value { | ||
| "TF_STEREO" => Some(Self::TfStereo), | ||
| "TF_NO_DTX" => Some(Self::TfNoDtx), | ||
| "TF_AUTO_GAIN_CONTROL" => Some(Self::TfAutoGainControl), | ||
| "TF_ECHO_CANCELLATION" => Some(Self::TfEchoCancellation), | ||
| "TF_NOISE_SUPPRESSION" => Some(Self::TfNoiseSuppression), | ||
| "TF_ENHANCED_NOISE_CANCELLATION" => Some(Self::TfEnhancedNoiseCancellation), | ||
| "TF_PRECONNECT_BUFFER" => Some(Self::TfPreconnectBuffer), | ||
| _ => None, | ||
| } | ||
| } | ||
| } | ||
| /// Enable/Disable a remote track publication | ||
| #[allow(clippy::derive_partial_eq_without_eq)] | ||
| #[derive(Clone, PartialEq, ::prost::Message)] | ||
|
|
@@ -1694,6 +1738,7 @@ pub enum DisconnectReason { | |
| UserRejected = 12, | ||
| /// SIP protocol failure or unexpected response | ||
| SipTrunkFailure = 13, | ||
| ConnectionTimeout = 14, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we simply add this without breaking users' code? |
||
| } | ||
| impl DisconnectReason { | ||
| /// String value of the enum field names used in the ProtoBuf definition. | ||
|
|
@@ -1716,6 +1761,7 @@ impl DisconnectReason { | |
| DisconnectReason::UserUnavailable => "USER_UNAVAILABLE", | ||
| DisconnectReason::UserRejected => "USER_REJECTED", | ||
| DisconnectReason::SipTrunkFailure => "SIP_TRUNK_FAILURE", | ||
| DisconnectReason::ConnectionTimeout => "CONNECTION_TIMEOUT", | ||
| } | ||
| } | ||
| /// Creates an enum from field names used in the ProtoBuf definition. | ||
|
|
@@ -1735,6 +1781,7 @@ impl DisconnectReason { | |
| "USER_UNAVAILABLE" => Some(Self::UserUnavailable), | ||
| "USER_REJECTED" => Some(Self::UserRejected), | ||
| "SIP_TRUNK_FAILURE" => Some(Self::SipTrunkFailure), | ||
| "CONNECTION_TIMEOUT" => Some(Self::ConnectionTimeout), | ||
| _ => None, | ||
| } | ||
| } | ||
|
|
||
Submodule protocol
updated
95 files
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a similar conversion for the TrackFeature?
impl From< AudioTrackFeature > for proto:: AudioTrackFeature {We're currently only relying on the integer, which is unsafe and will panic as soon as the proto adds a new one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theomonnom I added conversions in both directions and added AudioTrackFeature to the rtc prelude