-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement RTCRtpSender.getCapabilities
method
#3737
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
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 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 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 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#![allow(unused_imports)] | ||
#![allow(clippy::all)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpCapabilities)] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `RtcRtpCapabilities` dictionary."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] | ||
pub type RtcRtpCapabilities; | ||
} | ||
impl RtcRtpCapabilities { | ||
#[doc = "Construct a new `RtcRtpCapabilities`."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] | ||
pub fn new() -> Self { | ||
#[allow(unused_mut)] | ||
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); | ||
ret | ||
} | ||
#[doc = "Change the `codecs` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] | ||
pub fn codecs(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = | ||
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codecs"), &JsValue::from(val)); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
#[doc = "Change the `headerExtensions` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] | ||
pub fn header_extensions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = ::js_sys::Reflect::set( | ||
self.as_ref(), | ||
&JsValue::from("headerExtensions"), | ||
&JsValue::from(val), | ||
); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
} | ||
impl Default for RtcRtpCapabilities { | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} |
This file contains 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 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 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 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 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -38,6 +38,8 @@ dictionary RTCRtpEncodingParameters { | |||||||||||||||||
RTCDegradationPreference degradationPreference = "balanced"; | ||||||||||||||||||
DOMString rid; | ||||||||||||||||||
float scaleResolutionDownBy = 1.0; | ||||||||||||||||||
DOMString scalabilityMode; | ||||||||||||||||||
RTCRtpCodecParameters codec; | ||||||||||||||||||
}; | ||||||||||||||||||
|
||||||||||||||||||
dictionary RTCRtpHeaderExtensionParameters { | ||||||||||||||||||
|
@@ -66,6 +68,11 @@ dictionary RTCRtpParameters { | |||||||||||||||||
sequence<RTCRtpCodecParameters> codecs; | ||||||||||||||||||
}; | ||||||||||||||||||
|
||||||||||||||||||
dictionary RTCRtpCapabilities { | ||||||||||||||||||
sequence<RTCRtpCodecParameters> codecs; | ||||||||||||||||||
sequence<RTCRtpHeaderExtensionParameters> headerExtensions; | ||||||||||||||||||
}; | ||||||||||||||||||
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. Where exactly did you get this from?
Suggested change
|
||||||||||||||||||
|
||||||||||||||||||
[Pref="media.peerconnection.enabled", | ||||||||||||||||||
JSImplementation="@mozilla.org/dom/rtpsender;1"] | ||||||||||||||||||
interface RTCRtpSender { | ||||||||||||||||||
|
@@ -74,6 +81,7 @@ interface RTCRtpSender { | |||||||||||||||||
RTCRtpParameters getParameters(); | ||||||||||||||||||
Promise<undefined> replaceTrack(MediaStreamTrack? withTrack); | ||||||||||||||||||
Promise<RTCStatsReport> getStats(); | ||||||||||||||||||
static RTCRtpCapabilities getCapabilities(DOMString kind); | ||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||
[Pref="media.peerconnection.dtmf.enabled"] | ||||||||||||||||||
readonly attribute RTCDTMFSender? dtmf; | ||||||||||||||||||
// Ugh, can't use a ChromeOnly attribute sequence<MediaStream>... | ||||||||||||||||||
|
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.
This whole type seems to be wrong, but where did you get these added fields from?
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.
Unfortunately, I have not found these fields in the current spec.
I have seen these fields there:
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.
Adding these bindings seems fine to me, but they would have to be added as unstable as far as I can see.