diff --git a/CHANGELOG.md b/CHANGELOG.md index 85cfdd4dce9..78a755cdb68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ * Deprecate async constructors. [#4402](https://github.com/rustwasm/wasm-bindgen/pull/4402) +* Update Update WebCodecs to 2024-12-12 and MediaRecorder to 2024-10-31. + [#4411](https://github.com/rustwasm/wasm-bindgen/pull/4411) + -------------------------------------------------------------------------------- ## [0.2.100](https://github.com/rustwasm/wasm-bindgen/compare/0.2.99...0.2.100) diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index c3a73eaa363..2eac771e438 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -88,12 +88,12 @@ AudioContextState = [] AudioData = [] AudioDataCopyToOptions = [] AudioDataInit = [] -AudioDecoder = [] +AudioDecoder = ["EventTarget"] AudioDecoderConfig = [] AudioDecoderInit = [] AudioDecoderSupport = [] AudioDestinationNode = ["AudioNode", "EventTarget"] -AudioEncoder = [] +AudioEncoder = ["EventTarget"] AudioEncoderConfig = [] AudioEncoderInit = [] AudioEncoderSupport = [] @@ -152,6 +152,7 @@ BinaryType = [] BiquadFilterNode = ["AudioNode", "EventTarget"] BiquadFilterOptions = [] BiquadFilterType = [] +BitrateMode = [] Blob = [] BlobEvent = ["Event"] BlobEventInit = [] @@ -1519,11 +1520,12 @@ VideoColorPrimaries = [] VideoColorSpace = [] VideoColorSpaceInit = [] VideoConfiguration = [] -VideoDecoder = [] +VideoDecoder = ["EventTarget"] VideoDecoderConfig = [] VideoDecoderInit = [] VideoDecoderSupport = [] -VideoEncoder = [] +VideoEncoder = ["EventTarget"] +VideoEncoderBitrateMode = [] VideoEncoderConfig = [] VideoEncoderEncodeOptions = [] VideoEncoderInit = [] @@ -1533,6 +1535,7 @@ VideoFrame = [] VideoFrameBufferInit = [] VideoFrameCopyToOptions = [] VideoFrameInit = [] +VideoFrameMetadata = [] VideoMatrixCoefficients = [] VideoPixelFormat = [] VideoPlaybackQuality = [] diff --git a/crates/web-sys/src/features/gen_AudioDataInit.rs b/crates/web-sys/src/features/gen_AudioDataInit.rs index 251b10110e6..4d973f65f93 100644 --- a/crates/web-sys/src/features/gen_AudioDataInit.rs +++ b/crates/web-sys/src/features/gen_AudioDataInit.rs @@ -124,6 +124,24 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "timestamp")] pub fn set_timestamp(this: &AudioDataInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "transfer")] + pub fn get_transfer(this: &AudioDataInit) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "transfer")] + pub fn set_transfer(this: &AudioDataInit, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl AudioDataInit { @@ -189,4 +207,10 @@ impl AudioDataInit { self.set_timestamp(val); self } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_transfer()` instead."] + pub fn transfer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_transfer(val); + self + } } diff --git a/crates/web-sys/src/features/gen_AudioDecoder.rs b/crates/web-sys/src/features/gen_AudioDecoder.rs index 5482b063269..5a70584ac78 100644 --- a/crates/web-sys/src/features/gen_AudioDecoder.rs +++ b/crates/web-sys/src/features/gen_AudioDecoder.rs @@ -5,7 +5,7 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioDecoder , typescript_type = "AudioDecoder")] + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioDecoder , typescript_type = "AudioDecoder")] #[derive(Debug, Clone, PartialEq, Eq)] #[doc = "The `AudioDecoder` class."] #[doc = ""] @@ -40,6 +40,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn decode_queue_size(this: &AudioDecoder) -> u32; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "AudioDecoder" , js_name = ondequeue)] + #[doc = "Getter for the `ondequeue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/ondequeue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ondequeue(this: &AudioDecoder) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "AudioDecoder" , js_name = ondequeue)] + #[doc = "Setter for the `ondequeue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/ondequeue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ondequeue(this: &AudioDecoder, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioDecoderInit")] #[wasm_bindgen(catch, constructor, js_class = "AudioDecoder")] #[doc = "The `new AudioDecoder(..)` constructor, creating a new instance of `AudioDecoder`."] diff --git a/crates/web-sys/src/features/gen_AudioEncoder.rs b/crates/web-sys/src/features/gen_AudioEncoder.rs index 5d00c15abab..4f70ab97748 100644 --- a/crates/web-sys/src/features/gen_AudioEncoder.rs +++ b/crates/web-sys/src/features/gen_AudioEncoder.rs @@ -5,7 +5,7 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioEncoder , typescript_type = "AudioEncoder")] + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioEncoder , typescript_type = "AudioEncoder")] #[derive(Debug, Clone, PartialEq, Eq)] #[doc = "The `AudioEncoder` class."] #[doc = ""] @@ -40,6 +40,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn encode_queue_size(this: &AudioEncoder) -> u32; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "AudioEncoder" , js_name = ondequeue)] + #[doc = "Getter for the `ondequeue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/ondequeue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ondequeue(this: &AudioEncoder) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "AudioEncoder" , js_name = ondequeue)] + #[doc = "Setter for the `ondequeue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/ondequeue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ondequeue(this: &AudioEncoder, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioEncoderInit")] #[wasm_bindgen(catch, constructor, js_class = "AudioEncoder")] #[doc = "The `new AudioEncoder(..)` constructor, creating a new instance of `AudioEncoder`."] diff --git a/crates/web-sys/src/features/gen_AudioEncoderConfig.rs b/crates/web-sys/src/features/gen_AudioEncoderConfig.rs index 4553ce74ec4..9436f44f544 100644 --- a/crates/web-sys/src/features/gen_AudioEncoderConfig.rs +++ b/crates/web-sys/src/features/gen_AudioEncoderConfig.rs @@ -33,6 +33,26 @@ extern "C" { #[wasm_bindgen(method, setter = "bitrate")] pub fn set_bitrate(this: &AudioEncoderConfig, val: f64); #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BitrateMode")] + #[doc = "Get the `bitrateMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`, `BitrateMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bitrateMode")] + pub fn get_bitrate_mode(this: &AudioEncoderConfig) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BitrateMode")] + #[doc = "Change the `bitrateMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`, `BitrateMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bitrateMode")] + pub fn set_bitrate_mode(this: &AudioEncoderConfig, val: BitrateMode); + #[cfg(web_sys_unstable_apis)] #[doc = "Get the `codec` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"] @@ -108,6 +128,13 @@ impl AudioEncoderConfig { self } #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BitrateMode")] + #[deprecated = "Use `set_bitrate_mode()` instead."] + pub fn bitrate_mode(&mut self, val: BitrateMode) -> &mut Self { + self.set_bitrate_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_codec()` instead."] pub fn codec(&mut self, val: &str) -> &mut Self { self.set_codec(val); diff --git a/crates/web-sys/src/features/gen_BitrateMode.rs b/crates/web-sys/src/features/gen_BitrateMode.rs new file mode 100644 index 00000000000..3f040f5b1a2 --- /dev/null +++ b/crates/web-sys/src/features/gen_BitrateMode.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `BitrateMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `BitrateMode`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum BitrateMode { + Constant = "constant", + Variable = "variable", +} diff --git a/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs b/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs index f0bc1d16885..3220c2c9c86 100644 --- a/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs +++ b/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs @@ -69,6 +69,24 @@ extern "C" { #[wasm_bindgen(method, setter = "timestamp")] pub fn set_timestamp(this: &EncodedAudioChunkInit, val: f64); #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunkInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "transfer")] + pub fn get_transfer(this: &EncodedAudioChunkInit) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunkInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "transfer")] + pub fn set_transfer(this: &EncodedAudioChunkInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "EncodedAudioChunkType")] #[doc = "Get the `type` field of this object."] #[doc = ""] @@ -125,6 +143,12 @@ impl EncodedAudioChunkInit { self } #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_transfer()` instead."] + pub fn transfer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_transfer(val); + self + } + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "EncodedAudioChunkType")] #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: EncodedAudioChunkType) -> &mut Self { diff --git a/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs b/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs index 54372df9910..b08b7e9368c 100644 --- a/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs +++ b/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs @@ -69,6 +69,24 @@ extern "C" { #[wasm_bindgen(method, setter = "timestamp")] pub fn set_timestamp(this: &EncodedVideoChunkInit, val: f64); #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "transfer")] + pub fn get_transfer(this: &EncodedVideoChunkInit) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "transfer")] + pub fn set_transfer(this: &EncodedVideoChunkInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "EncodedVideoChunkType")] #[doc = "Get the `type` field of this object."] #[doc = ""] @@ -125,6 +143,12 @@ impl EncodedVideoChunkInit { self } #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_transfer()` instead."] + pub fn transfer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_transfer(val); + self + } + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "EncodedVideoChunkType")] #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: EncodedVideoChunkType) -> &mut Self { diff --git a/crates/web-sys/src/features/gen_ImageDecoderInit.rs b/crates/web-sys/src/features/gen_ImageDecoderInit.rs index 8347a669e0e..15881e92c6f 100644 --- a/crates/web-sys/src/features/gen_ImageDecoderInit.rs +++ b/crates/web-sys/src/features/gen_ImageDecoderInit.rs @@ -107,25 +107,23 @@ extern "C" { #[wasm_bindgen(method, setter = "preferAnimation")] pub fn set_prefer_animation(this: &ImageDecoderInit, val: bool); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "PremultiplyAlpha")] - #[doc = "Get the `premultiplyAlpha` field of this object."] + #[doc = "Get the `transfer` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`, `PremultiplyAlpha`*"] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - #[wasm_bindgen(method, getter = "premultiplyAlpha")] - pub fn get_premultiply_alpha(this: &ImageDecoderInit) -> Option; + #[wasm_bindgen(method, getter = "transfer")] + pub fn get_transfer(this: &ImageDecoderInit) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "PremultiplyAlpha")] - #[doc = "Change the `premultiplyAlpha` field of this object."] + #[doc = "Change the `transfer` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`, `PremultiplyAlpha`*"] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - #[wasm_bindgen(method, setter = "premultiplyAlpha")] - pub fn set_premultiply_alpha(this: &ImageDecoderInit, val: PremultiplyAlpha); + #[wasm_bindgen(method, setter = "transfer")] + pub fn set_transfer(this: &ImageDecoderInit, val: &::wasm_bindgen::JsValue); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `type` field of this object."] #[doc = ""] @@ -192,10 +190,9 @@ impl ImageDecoderInit { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "PremultiplyAlpha")] - #[deprecated = "Use `set_premultiply_alpha()` instead."] - pub fn premultiply_alpha(&mut self, val: PremultiplyAlpha) -> &mut Self { - self.set_premultiply_alpha(val); + #[deprecated = "Use `set_transfer()` instead."] + pub fn transfer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_transfer(val); self } #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_ImageTrack.rs b/crates/web-sys/src/features/gen_ImageTrack.rs index 66aa5ac4c9b..87e3140fa8b 100644 --- a/crates/web-sys/src/features/gen_ImageTrack.rs +++ b/crates/web-sys/src/features/gen_ImageTrack.rs @@ -50,28 +50,6 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn repetition_count(this: &ImageTrack) -> f32; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "ImageTrack" , js_name = onchange)] - #[doc = "Getter for the `onchange` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageTrack/onchange)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageTrack`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn onchange(this: &ImageTrack) -> Option<::js_sys::Function>; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , setter , js_class = "ImageTrack" , js_name = onchange)] - #[doc = "Setter for the `onchange` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageTrack/onchange)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageTrack`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_onchange(this: &ImageTrack, value: Option<&::js_sys::Function>); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ImageTrack" , js_name = selected)] #[doc = "Getter for the `selected` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MediaRecorder.rs b/crates/web-sys/src/features/gen_MediaRecorder.rs index 7cb779d4c65..fe4e87066f7 100644 --- a/crates/web-sys/src/features/gen_MediaRecorder.rs +++ b/crates/web-sys/src/features/gen_MediaRecorder.rs @@ -63,6 +63,34 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] pub fn set_onerror(this: &MediaRecorder, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onpause)] + #[doc = "Getter for the `onpause` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onpause)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] + pub fn onpause(this: &MediaRecorder) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = onpause)] + #[doc = "Setter for the `onpause` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onpause)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] + pub fn set_onpause(this: &MediaRecorder, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onresume)] + #[doc = "Getter for the `onresume` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onresume)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] + pub fn onresume(this: &MediaRecorder) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = onresume)] + #[doc = "Setter for the `onresume` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onresume)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] + pub fn set_onresume(this: &MediaRecorder, value: Option<&::js_sys::Function>); # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onstart)] #[doc = "Getter for the `onstart` field of this object."] #[doc = ""] @@ -91,20 +119,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] pub fn set_onstop(this: &MediaRecorder, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onwarning)] - #[doc = "Getter for the `onwarning` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = videoBitsPerSecond)] + #[doc = "Getter for the `videoBitsPerSecond` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onwarning)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/videoBitsPerSecond)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] - pub fn onwarning(this: &MediaRecorder) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = onwarning)] - #[doc = "Setter for the `onwarning` field of this object."] + pub fn video_bits_per_second(this: &MediaRecorder) -> u32; + # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = audioBitsPerSecond)] + #[doc = "Getter for the `audioBitsPerSecond` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onwarning)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/audioBitsPerSecond)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] - pub fn set_onwarning(this: &MediaRecorder, value: Option<&::js_sys::Function>); + pub fn audio_bits_per_second(this: &MediaRecorder) -> u32; + #[cfg(feature = "BitrateMode")] + # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = audioBitrateMode)] + #[doc = "Getter for the `audioBitrateMode` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/audioBitrateMode)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BitrateMode`, `MediaRecorder`*"] + pub fn audio_bitrate_mode(this: &MediaRecorder) -> BitrateMode; #[cfg(feature = "MediaStream")] #[wasm_bindgen(catch, constructor, js_class = "MediaRecorder")] #[doc = "The `new MediaRecorder(..)` constructor, creating a new instance of `MediaRecorder`."] diff --git a/crates/web-sys/src/features/gen_MediaRecorderOptions.rs b/crates/web-sys/src/features/gen_MediaRecorderOptions.rs index 7346fa75627..48d57c7eab7 100644 --- a/crates/web-sys/src/features/gen_MediaRecorderOptions.rs +++ b/crates/web-sys/src/features/gen_MediaRecorderOptions.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] pub type MediaRecorderOptions; + #[cfg(feature = "BitrateMode")] + #[doc = "Get the `audioBitrateMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BitrateMode`, `MediaRecorderOptions`*"] + #[wasm_bindgen(method, getter = "audioBitrateMode")] + pub fn get_audio_bitrate_mode(this: &MediaRecorderOptions) -> Option; + #[cfg(feature = "BitrateMode")] + #[doc = "Change the `audioBitrateMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BitrateMode`, `MediaRecorderOptions`*"] + #[wasm_bindgen(method, setter = "audioBitrateMode")] + pub fn set_audio_bitrate_mode(this: &MediaRecorderOptions, val: BitrateMode); #[doc = "Get the `audioBitsPerSecond` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] @@ -50,6 +62,26 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] #[wasm_bindgen(method, setter = "videoBitsPerSecond")] pub fn set_video_bits_per_second(this: &MediaRecorderOptions, val: u32); + #[doc = "Get the `videoKeyFrameIntervalCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, getter = "videoKeyFrameIntervalCount")] + pub fn get_video_key_frame_interval_count(this: &MediaRecorderOptions) -> Option; + #[doc = "Change the `videoKeyFrameIntervalCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, setter = "videoKeyFrameIntervalCount")] + pub fn set_video_key_frame_interval_count(this: &MediaRecorderOptions, val: u32); + #[doc = "Get the `videoKeyFrameIntervalDuration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, getter = "videoKeyFrameIntervalDuration")] + pub fn get_video_key_frame_interval_duration(this: &MediaRecorderOptions) -> Option; + #[doc = "Change the `videoKeyFrameIntervalDuration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, setter = "videoKeyFrameIntervalDuration")] + pub fn set_video_key_frame_interval_duration(this: &MediaRecorderOptions, val: f64); } impl MediaRecorderOptions { #[doc = "Construct a new `MediaRecorderOptions`."] @@ -60,6 +92,12 @@ impl MediaRecorderOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } + #[cfg(feature = "BitrateMode")] + #[deprecated = "Use `set_audio_bitrate_mode()` instead."] + pub fn audio_bitrate_mode(&mut self, val: BitrateMode) -> &mut Self { + self.set_audio_bitrate_mode(val); + self + } #[deprecated = "Use `set_audio_bits_per_second()` instead."] pub fn audio_bits_per_second(&mut self, val: u32) -> &mut Self { self.set_audio_bits_per_second(val); @@ -80,6 +118,16 @@ impl MediaRecorderOptions { self.set_video_bits_per_second(val); self } + #[deprecated = "Use `set_video_key_frame_interval_count()` instead."] + pub fn video_key_frame_interval_count(&mut self, val: u32) -> &mut Self { + self.set_video_key_frame_interval_count(val); + self + } + #[deprecated = "Use `set_video_key_frame_interval_duration()` instead."] + pub fn video_key_frame_interval_duration(&mut self, val: f64) -> &mut Self { + self.set_video_key_frame_interval_duration(val); + self + } } impl Default for MediaRecorderOptions { fn default() -> Self { diff --git a/crates/web-sys/src/features/gen_VideoColorPrimaries.rs b/crates/web-sys/src/features/gen_VideoColorPrimaries.rs index 31c6f0e739e..892d1199d2d 100644 --- a/crates/web-sys/src/features/gen_VideoColorPrimaries.rs +++ b/crates/web-sys/src/features/gen_VideoColorPrimaries.rs @@ -14,4 +14,6 @@ pub enum VideoColorPrimaries { Bt709 = "bt709", Bt470bg = "bt470bg", Smpte170m = "smpte170m", + Bt2020 = "bt2020", + Smpte432 = "smpte432", } diff --git a/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs b/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs index fbf7cd1bc19..72c70587696 100644 --- a/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs +++ b/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs @@ -31,7 +31,7 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "fullRange")] - pub fn set_full_range(this: &VideoColorSpaceInit, val: bool); + pub fn set_full_range(this: &VideoColorSpaceInit, val: Option); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoMatrixCoefficients")] #[doc = "Get the `matrix` field of this object."] @@ -51,7 +51,7 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "matrix")] - pub fn set_matrix(this: &VideoColorSpaceInit, val: VideoMatrixCoefficients); + pub fn set_matrix(this: &VideoColorSpaceInit, val: Option); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoColorPrimaries")] #[doc = "Get the `primaries` field of this object."] @@ -71,7 +71,7 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "primaries")] - pub fn set_primaries(this: &VideoColorSpaceInit, val: VideoColorPrimaries); + pub fn set_primaries(this: &VideoColorSpaceInit, val: Option); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoTransferCharacteristics")] #[doc = "Get the `transfer` field of this object."] @@ -91,7 +91,7 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "transfer")] - pub fn set_transfer(this: &VideoColorSpaceInit, val: VideoTransferCharacteristics); + pub fn set_transfer(this: &VideoColorSpaceInit, val: Option); } #[cfg(web_sys_unstable_apis)] impl VideoColorSpaceInit { @@ -108,28 +108,28 @@ impl VideoColorSpaceInit { } #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_full_range()` instead."] - pub fn full_range(&mut self, val: bool) -> &mut Self { + pub fn full_range(&mut self, val: Option) -> &mut Self { self.set_full_range(val); self } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoMatrixCoefficients")] #[deprecated = "Use `set_matrix()` instead."] - pub fn matrix(&mut self, val: VideoMatrixCoefficients) -> &mut Self { + pub fn matrix(&mut self, val: Option) -> &mut Self { self.set_matrix(val); self } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoColorPrimaries")] #[deprecated = "Use `set_primaries()` instead."] - pub fn primaries(&mut self, val: VideoColorPrimaries) -> &mut Self { + pub fn primaries(&mut self, val: Option) -> &mut Self { self.set_primaries(val); self } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoTransferCharacteristics")] #[deprecated = "Use `set_transfer()` instead."] - pub fn transfer(&mut self, val: VideoTransferCharacteristics) -> &mut Self { + pub fn transfer(&mut self, val: Option) -> &mut Self { self.set_transfer(val); self } diff --git a/crates/web-sys/src/features/gen_VideoDecoder.rs b/crates/web-sys/src/features/gen_VideoDecoder.rs index 1002aca6be2..aea9e62a8e4 100644 --- a/crates/web-sys/src/features/gen_VideoDecoder.rs +++ b/crates/web-sys/src/features/gen_VideoDecoder.rs @@ -5,7 +5,7 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = VideoDecoder , typescript_type = "VideoDecoder")] + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = VideoDecoder , typescript_type = "VideoDecoder")] #[derive(Debug, Clone, PartialEq, Eq)] #[doc = "The `VideoDecoder` class."] #[doc = ""] @@ -40,6 +40,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn decode_queue_size(this: &VideoDecoder) -> u32; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "VideoDecoder" , js_name = ondequeue)] + #[doc = "Getter for the `ondequeue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/ondequeue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ondequeue(this: &VideoDecoder) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "VideoDecoder" , js_name = ondequeue)] + #[doc = "Setter for the `ondequeue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/ondequeue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ondequeue(this: &VideoDecoder, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoDecoderInit")] #[wasm_bindgen(catch, constructor, js_class = "VideoDecoder")] #[doc = "The `new VideoDecoder(..)` constructor, creating a new instance of `VideoDecoder`."] diff --git a/crates/web-sys/src/features/gen_VideoEncoder.rs b/crates/web-sys/src/features/gen_VideoEncoder.rs index 84d74ae01a4..aa615ce4fb7 100644 --- a/crates/web-sys/src/features/gen_VideoEncoder.rs +++ b/crates/web-sys/src/features/gen_VideoEncoder.rs @@ -5,7 +5,7 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = VideoEncoder , typescript_type = "VideoEncoder")] + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = VideoEncoder , typescript_type = "VideoEncoder")] #[derive(Debug, Clone, PartialEq, Eq)] #[doc = "The `VideoEncoder` class."] #[doc = ""] @@ -40,6 +40,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn encode_queue_size(this: &VideoEncoder) -> u32; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "VideoEncoder" , js_name = ondequeue)] + #[doc = "Getter for the `ondequeue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/ondequeue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ondequeue(this: &VideoEncoder) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "VideoEncoder" , js_name = ondequeue)] + #[doc = "Setter for the `ondequeue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/ondequeue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ondequeue(this: &VideoEncoder, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoEncoderInit")] #[wasm_bindgen(catch, constructor, js_class = "VideoEncoder")] #[doc = "The `new VideoEncoder(..)` constructor, creating a new instance of `VideoEncoder`."] diff --git a/crates/web-sys/src/features/gen_VideoEncoderBitrateMode.rs b/crates/web-sys/src/features/gen_VideoEncoderBitrateMode.rs new file mode 100644 index 00000000000..5c944713767 --- /dev/null +++ b/crates/web-sys/src/features/gen_VideoEncoderBitrateMode.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `VideoEncoderBitrateMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `VideoEncoderBitrateMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum VideoEncoderBitrateMode { + Constant = "constant", + Variable = "variable", + Quantizer = "quantizer", +} diff --git a/crates/web-sys/src/features/gen_VideoEncoderConfig.rs b/crates/web-sys/src/features/gen_VideoEncoderConfig.rs index 4251ddf8eba..fe1f9035669 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderConfig.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderConfig.rs @@ -53,6 +53,26 @@ extern "C" { #[wasm_bindgen(method, setter = "bitrate")] pub fn set_bitrate(this: &VideoEncoderConfig, val: f64); #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoEncoderBitrateMode")] + #[doc = "Get the `bitrateMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderBitrateMode`, `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bitrateMode")] + pub fn get_bitrate_mode(this: &VideoEncoderConfig) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoEncoderBitrateMode")] + #[doc = "Change the `bitrateMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderBitrateMode`, `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bitrateMode")] + pub fn set_bitrate_mode(this: &VideoEncoderConfig, val: VideoEncoderBitrateMode); + #[cfg(web_sys_unstable_apis)] #[doc = "Get the `codec` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] @@ -71,6 +91,24 @@ extern "C" { #[wasm_bindgen(method, setter = "codec")] pub fn set_codec(this: &VideoEncoderConfig, val: &str); #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `contentHint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "contentHint")] + pub fn get_content_hint(this: &VideoEncoderConfig) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `contentHint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "contentHint")] + pub fn set_content_hint(this: &VideoEncoderConfig, val: &str); + #[cfg(web_sys_unstable_apis)] #[doc = "Get the `displayHeight` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] @@ -249,12 +287,25 @@ impl VideoEncoderConfig { self } #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoEncoderBitrateMode")] + #[deprecated = "Use `set_bitrate_mode()` instead."] + pub fn bitrate_mode(&mut self, val: VideoEncoderBitrateMode) -> &mut Self { + self.set_bitrate_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_codec()` instead."] pub fn codec(&mut self, val: &str) -> &mut Self { self.set_codec(val); self } #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_content_hint()` instead."] + pub fn content_hint(&mut self, val: &str) -> &mut Self { + self.set_content_hint(val); + self + } + #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_display_height()` instead."] pub fn display_height(&mut self, val: u32) -> &mut Self { self.set_display_height(val); diff --git a/crates/web-sys/src/features/gen_VideoFrame.rs b/crates/web-sys/src/features/gen_VideoFrame.rs index 962c353b1b5..ad24e4db0d7 100644 --- a/crates/web-sys/src/features/gen_VideoFrame.rs +++ b/crates/web-sys/src/features/gen_VideoFrame.rs @@ -75,6 +75,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn visible_rect(this: &VideoFrame) -> Option; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "VideoFrame" , js_name = rotation)] + #[doc = "Getter for the `rotation` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/rotation)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn rotation(this: &VideoFrame) -> f64; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "VideoFrame" , js_name = flip)] + #[doc = "Getter for the `flip` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/flip)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn flip(this: &VideoFrame) -> bool; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "VideoFrame" , js_name = displayWidth)] #[doc = "Getter for the `displayWidth` field of this object."] #[doc = ""] @@ -498,4 +520,16 @@ extern "C" { destination: &::js_sys::Uint8Array, options: &VideoFrameCopyToOptions, ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameMetadata")] + # [wasm_bindgen (method , structural , js_class = "VideoFrame" , js_name = metadata)] + #[doc = "The `metadata()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/metadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `VideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn metadata(this: &VideoFrame) -> VideoFrameMetadata; } diff --git a/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs b/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs index 20c3aa7e845..8f251bc0494 100644 --- a/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs +++ b/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs @@ -125,6 +125,24 @@ extern "C" { #[wasm_bindgen(method, setter = "duration")] pub fn set_duration(this: &VideoFrameBufferInit, val: f64); #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `flip` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "flip")] + pub fn get_flip(this: &VideoFrameBufferInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `flip` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "flip")] + pub fn set_flip(this: &VideoFrameBufferInit, val: bool); + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoPixelFormat")] #[doc = "Get the `format` field of this object."] #[doc = ""] @@ -163,6 +181,44 @@ extern "C" { #[wasm_bindgen(method, setter = "layout")] pub fn set_layout(this: &VideoFrameBufferInit, val: &::wasm_bindgen::JsValue); #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameMetadata")] + #[doc = "Get the `metadata` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "metadata")] + pub fn get_metadata(this: &VideoFrameBufferInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameMetadata")] + #[doc = "Change the `metadata` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "metadata")] + pub fn set_metadata(this: &VideoFrameBufferInit, val: &VideoFrameMetadata); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rotation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rotation")] + pub fn get_rotation(this: &VideoFrameBufferInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rotation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rotation")] + pub fn set_rotation(this: &VideoFrameBufferInit, val: f64); + #[cfg(web_sys_unstable_apis)] #[doc = "Get the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] @@ -181,6 +237,24 @@ extern "C" { #[wasm_bindgen(method, setter = "timestamp")] pub fn set_timestamp(this: &VideoFrameBufferInit, val: f64); #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "transfer")] + pub fn get_transfer(this: &VideoFrameBufferInit) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "transfer")] + pub fn set_transfer(this: &VideoFrameBufferInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DomRectInit")] #[doc = "Get the `visibleRect` field of this object."] #[doc = ""] @@ -262,6 +336,12 @@ impl VideoFrameBufferInit { self } #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_flip()` instead."] + pub fn flip(&mut self, val: bool) -> &mut Self { + self.set_flip(val); + self + } + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoPixelFormat")] #[deprecated = "Use `set_format()` instead."] pub fn format(&mut self, val: VideoPixelFormat) -> &mut Self { @@ -275,12 +355,31 @@ impl VideoFrameBufferInit { self } #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameMetadata")] + #[deprecated = "Use `set_metadata()` instead."] + pub fn metadata(&mut self, val: &VideoFrameMetadata) -> &mut Self { + self.set_metadata(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rotation()` instead."] + pub fn rotation(&mut self, val: f64) -> &mut Self { + self.set_rotation(val); + self + } + #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { self.set_timestamp(val); self } #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_transfer()` instead."] + pub fn transfer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_transfer(val); + self + } + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DomRectInit")] #[deprecated = "Use `set_visible_rect()` instead."] pub fn visible_rect(&mut self, val: &DomRectInit) -> &mut Self { diff --git a/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs b/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs index 686a12cbd92..b9059cb5aed 100644 --- a/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs +++ b/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs @@ -15,6 +15,26 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoFrameCopyToOptions; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoPixelFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameCopyToOptions`, `VideoPixelFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &VideoFrameCopyToOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoPixelFormat")] + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameCopyToOptions`, `VideoPixelFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &VideoFrameCopyToOptions, val: VideoPixelFormat); + #[cfg(web_sys_unstable_apis)] #[doc = "Get the `layout` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoFrameCopyToOptions`*"] @@ -67,6 +87,13 @@ impl VideoFrameCopyToOptions { ret } #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoPixelFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: VideoPixelFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_layout()` instead."] pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { self.set_layout(val); diff --git a/crates/web-sys/src/features/gen_VideoFrameInit.rs b/crates/web-sys/src/features/gen_VideoFrameInit.rs index 2180804556f..29e1433f72a 100644 --- a/crates/web-sys/src/features/gen_VideoFrameInit.rs +++ b/crates/web-sys/src/features/gen_VideoFrameInit.rs @@ -89,6 +89,62 @@ extern "C" { #[wasm_bindgen(method, setter = "duration")] pub fn set_duration(this: &VideoFrameInit, val: f64); #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `flip` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "flip")] + pub fn get_flip(this: &VideoFrameInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `flip` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "flip")] + pub fn set_flip(this: &VideoFrameInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameMetadata")] + #[doc = "Get the `metadata` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`, `VideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "metadata")] + pub fn get_metadata(this: &VideoFrameInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameMetadata")] + #[doc = "Change the `metadata` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`, `VideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "metadata")] + pub fn set_metadata(this: &VideoFrameInit, val: &VideoFrameMetadata); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rotation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rotation")] + pub fn get_rotation(this: &VideoFrameInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rotation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rotation")] + pub fn set_rotation(this: &VideoFrameInit, val: f64); + #[cfg(web_sys_unstable_apis)] #[doc = "Get the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] @@ -166,6 +222,25 @@ impl VideoFrameInit { self } #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_flip()` instead."] + pub fn flip(&mut self, val: bool) -> &mut Self { + self.set_flip(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameMetadata")] + #[deprecated = "Use `set_metadata()` instead."] + pub fn metadata(&mut self, val: &VideoFrameMetadata) -> &mut Self { + self.set_metadata(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rotation()` instead."] + pub fn rotation(&mut self, val: f64) -> &mut Self { + self.set_rotation(val); + self + } + #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { self.set_timestamp(val); diff --git a/crates/web-sys/src/features/gen_VideoFrameMetadata.rs b/crates/web-sys/src/features/gen_VideoFrameMetadata.rs new file mode 100644 index 00000000000..7997c4037fe --- /dev/null +++ b/crates/web-sys/src/features/gen_VideoFrameMetadata.rs @@ -0,0 +1,37 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = VideoFrameMetadata)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `VideoFrameMetadata` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type VideoFrameMetadata; +} +#[cfg(web_sys_unstable_apis)] +impl VideoFrameMetadata { + #[doc = "Construct a new `VideoFrameMetadata`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for VideoFrameMetadata { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_VideoMatrixCoefficients.rs b/crates/web-sys/src/features/gen_VideoMatrixCoefficients.rs index 196688d6add..108048847b4 100644 --- a/crates/web-sys/src/features/gen_VideoMatrixCoefficients.rs +++ b/crates/web-sys/src/features/gen_VideoMatrixCoefficients.rs @@ -15,4 +15,5 @@ pub enum VideoMatrixCoefficients { Bt709 = "bt709", Bt470bg = "bt470bg", Smpte170m = "smpte170m", + Bt2020Ncl = "bt2020-ncl", } diff --git a/crates/web-sys/src/features/gen_VideoPixelFormat.rs b/crates/web-sys/src/features/gen_VideoPixelFormat.rs index e2348ed9495..d266254ef1e 100644 --- a/crates/web-sys/src/features/gen_VideoPixelFormat.rs +++ b/crates/web-sys/src/features/gen_VideoPixelFormat.rs @@ -12,9 +12,23 @@ use wasm_bindgen::prelude::*; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum VideoPixelFormat { I420 = "I420", + I420p10 = "I420P10", + I420p12 = "I420P12", I420a = "I420A", + I420ap10 = "I420AP10", + I420ap12 = "I420AP12", I422 = "I422", + I422p10 = "I422P10", + I422p12 = "I422P12", + I422a = "I422A", + I422ap10 = "I422AP10", + I422ap12 = "I422AP12", I444 = "I444", + I444p10 = "I444P10", + I444p12 = "I444P12", + I444a = "I444A", + I444ap10 = "I444AP10", + I444ap12 = "I444AP12", Nv12 = "NV12", Rgba = "RGBA", Rgbx = "RGBX", diff --git a/crates/web-sys/src/features/gen_VideoTransferCharacteristics.rs b/crates/web-sys/src/features/gen_VideoTransferCharacteristics.rs index dbb6684f5a5..a35cf7412b2 100644 --- a/crates/web-sys/src/features/gen_VideoTransferCharacteristics.rs +++ b/crates/web-sys/src/features/gen_VideoTransferCharacteristics.rs @@ -14,4 +14,7 @@ pub enum VideoTransferCharacteristics { Bt709 = "bt709", Smpte170m = "smpte170m", Iec6196621 = "iec61966-2-1", + Linear = "linear", + Pq = "pq", + Hlg = "hlg", } diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 4ffc9995e6f..d72bf7e8967 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -747,6 +747,13 @@ mod gen_BiquadFilterType; #[allow(unused_imports)] pub use gen_BiquadFilterType::*; +#[cfg(feature = "BitrateMode")] +#[allow(non_snake_case)] +mod gen_BitrateMode; +#[cfg(feature = "BitrateMode")] +#[allow(unused_imports)] +pub use gen_BitrateMode::*; + #[cfg(feature = "Blob")] #[allow(non_snake_case)] mod gen_Blob; @@ -10351,6 +10358,13 @@ mod gen_VideoEncoder; #[allow(unused_imports)] pub use gen_VideoEncoder::*; +#[cfg(feature = "VideoEncoderBitrateMode")] +#[allow(non_snake_case)] +mod gen_VideoEncoderBitrateMode; +#[cfg(feature = "VideoEncoderBitrateMode")] +#[allow(unused_imports)] +pub use gen_VideoEncoderBitrateMode::*; + #[cfg(feature = "VideoEncoderConfig")] #[allow(non_snake_case)] mod gen_VideoEncoderConfig; @@ -10414,6 +10428,13 @@ mod gen_VideoFrameInit; #[allow(unused_imports)] pub use gen_VideoFrameInit::*; +#[cfg(feature = "VideoFrameMetadata")] +#[allow(non_snake_case)] +mod gen_VideoFrameMetadata; +#[cfg(feature = "VideoFrameMetadata")] +#[allow(unused_imports)] +pub use gen_VideoFrameMetadata::*; + #[cfg(feature = "VideoMatrixCoefficients")] #[allow(non_snake_case)] mod gen_VideoMatrixCoefficients; diff --git a/crates/web-sys/webidls/enabled/MediaRecorder.webidl b/crates/web-sys/webidls/enabled/MediaRecorder.webidl index 76f161e5896..d39c46dfdbc 100644 --- a/crates/web-sys/webidls/enabled/MediaRecorder.webidl +++ b/crates/web-sys/webidls/enabled/MediaRecorder.webidl @@ -10,6 +10,8 @@ * liability, trademark and document use rules apply. */ +enum BitrateMode { "constant", "variable" }; + enum RecordingState { "inactive", "recording", "paused" }; [Constructor(MediaStream stream, optional MediaRecorderOptions options), @@ -27,11 +29,19 @@ interface MediaRecorder : EventTarget { attribute EventHandler onerror; + attribute EventHandler onpause; + + attribute EventHandler onresume; + attribute EventHandler onstart; attribute EventHandler onstop; - attribute EventHandler onwarning; + readonly attribute unsigned long videoBitsPerSecond; + + readonly attribute unsigned long audioBitsPerSecond; + + readonly attribute BitrateMode audioBitrateMode; [Throws] undefined start(optional long timeSlice); @@ -56,4 +66,7 @@ dictionary MediaRecorderOptions { unsigned long audioBitsPerSecond; unsigned long videoBitsPerSecond; unsigned long bitsPerSecond; + BitrateMode audioBitrateMode = "variable"; + DOMHighResTimeStamp videoKeyFrameIntervalDuration; + unsigned long videoKeyFrameIntervalCount; }; diff --git a/crates/web-sys/webidls/unstable/WebCodecs.webidl b/crates/web-sys/webidls/unstable/WebCodecs.webidl index 880323e1b43..1eefd6af462 100644 --- a/crates/web-sys/webidls/unstable/WebCodecs.webidl +++ b/crates/web-sys/webidls/unstable/WebCodecs.webidl @@ -1,9 +1,10 @@ [Exposed=(Window,DedicatedWorker), SecureContext] -interface AudioDecoder { +interface AudioDecoder : EventTarget { constructor(AudioDecoderInit init); readonly attribute CodecState state; readonly attribute unsigned long decodeQueueSize; + attribute EventHandler ondequeue; [Throws] undefined configure(AudioDecoderConfig config); [Throws] undefined decode(EncodedAudioChunk chunk); @@ -22,11 +23,12 @@ dictionary AudioDecoderInit { callback AudioDataOutputCallback = undefined(AudioData output); [Exposed=(Window,DedicatedWorker), SecureContext] -interface VideoDecoder { +interface VideoDecoder : EventTarget { constructor(VideoDecoderInit init); readonly attribute CodecState state; readonly attribute unsigned long decodeQueueSize; + attribute EventHandler ondequeue; [Throws] undefined configure(VideoDecoderConfig config); [Throws] undefined decode(EncodedVideoChunk chunk); @@ -45,11 +47,12 @@ dictionary VideoDecoderInit { callback VideoFrameOutputCallback = undefined(VideoFrame output); [Exposed=(Window,DedicatedWorker), SecureContext] -interface AudioEncoder { +interface AudioEncoder : EventTarget { constructor(AudioEncoderInit init); readonly attribute CodecState state; readonly attribute unsigned long encodeQueueSize; + attribute EventHandler ondequeue; [Throws] undefined configure(AudioEncoderConfig config); [Throws] undefined encode(AudioData data); @@ -74,11 +77,12 @@ dictionary EncodedAudioChunkMetadata { }; [Exposed=(Window,DedicatedWorker), SecureContext] -interface VideoEncoder { +interface VideoEncoder : EventTarget { constructor(VideoEncoderInit init); readonly attribute CodecState state; readonly attribute unsigned long encodeQueueSize; + attribute EventHandler ondequeue; [Throws] undefined configure(VideoEncoderConfig config); [Throws] undefined encode(VideoFrame frame, optional VideoEncoderEncodeOptions options = {}); @@ -137,7 +141,7 @@ dictionary AudioDecoderConfig { dictionary VideoDecoderConfig { required DOMString codec; - BufferSource description; + AllowSharedBufferSource description; [EnforceRange] unsigned long codedWidth; [EnforceRange] unsigned long codedHeight; [EnforceRange] unsigned long displayAspectWidth; @@ -152,6 +156,7 @@ dictionary AudioEncoderConfig { [EnforceRange] unsigned long sampleRate; [EnforceRange] unsigned long numberOfChannels; [EnforceRange] unsigned long long bitrate; + BitrateMode bitrateMode = "variable"; }; dictionary VideoEncoderConfig { @@ -161,12 +166,13 @@ dictionary VideoEncoderConfig { [EnforceRange] unsigned long displayWidth; [EnforceRange] unsigned long displayHeight; [EnforceRange] unsigned long long bitrate; - [EnforceRange] double framerate; + double framerate; HardwareAcceleration hardwareAcceleration = "no-preference"; AlphaOption alpha = "discard"; DOMString scalabilityMode; - BitrateMode bitrateMode = "variable"; + VideoEncoderBitrateMode bitrateMode = "variable"; LatencyMode latencyMode = "quality"; + DOMString contentHint; }; enum HardwareAcceleration { @@ -189,6 +195,12 @@ dictionary VideoEncoderEncodeOptions { boolean keyFrame = false; }; +enum VideoEncoderBitrateMode { + "constant", + "variable", + "quantizer" +}; + enum CodecState { "unconfigured", "configured", @@ -197,7 +209,7 @@ enum CodecState { callback WebCodecsErrorCallback = undefined(DOMException error); -[Exposed=(Window,DedicatedWorker)] +[Exposed=(Window,DedicatedWorker), Serializable] interface EncodedAudioChunk { [Throws] constructor(EncodedAudioChunkInit init); readonly attribute EncodedAudioChunkType type; @@ -205,14 +217,15 @@ interface EncodedAudioChunk { readonly attribute unsigned long long? duration; // microseconds readonly attribute unsigned long byteLength; - [Throws] undefined copyTo([AllowShared] BufferSource destination); + [Throws] undefined copyTo(AllowSharedBufferSource destination); }; dictionary EncodedAudioChunkInit { required EncodedAudioChunkType type; [EnforceRange] required long long timestamp; // microseconds [EnforceRange] unsigned long long duration; // microseconds - required BufferSource data; + required AllowSharedBufferSource data; + sequence transfer = []; }; enum EncodedAudioChunkType { @@ -220,7 +233,7 @@ enum EncodedAudioChunkType { "delta", }; -[Exposed=(Window,DedicatedWorker)] +[Exposed=(Window,DedicatedWorker), Serializable] interface EncodedVideoChunk { [Throws] constructor(EncodedVideoChunkInit init); readonly attribute EncodedVideoChunkType type; @@ -228,14 +241,15 @@ interface EncodedVideoChunk { readonly attribute unsigned long long? duration; // microseconds readonly attribute unsigned long byteLength; - [Throws] undefined copyTo([AllowShared] BufferSource destination); + [Throws] undefined copyTo(AllowSharedBufferSource destination); }; dictionary EncodedVideoChunkInit { required EncodedVideoChunkType type; [EnforceRange] required long long timestamp; // microseconds [EnforceRange] unsigned long long duration; // microseconds - required BufferSource data; + required AllowSharedBufferSource data; + sequence transfer = []; }; enum EncodedVideoChunkType { @@ -255,7 +269,7 @@ interface AudioData { readonly attribute long long timestamp; // microseconds [Throws] unsigned long allocationSize(AudioDataCopyToOptions options); - [Throws] undefined copyTo([AllowShared] BufferSource destination, AudioDataCopyToOptions options); + [Throws] undefined copyTo(AllowSharedBufferSource destination, AudioDataCopyToOptions options); [Throws] AudioData clone(); undefined close(); }; @@ -267,6 +281,7 @@ dictionary AudioDataInit { [EnforceRange] required unsigned long numberOfChannels; [EnforceRange] required long long timestamp; // microseconds required BufferSource data; + sequence transfer = []; }; dictionary AudioDataCopyToOptions { @@ -290,23 +305,27 @@ enum AudioSampleFormat { [Exposed=(Window,DedicatedWorker), Serializable, Transferable] interface VideoFrame { [Throws] constructor(CanvasImageSource image, optional VideoFrameInit init = {}); - [Throws] constructor([AllowShared] BufferSource data, VideoFrameBufferInit init); + [Throws] constructor(AllowSharedBufferSource data, VideoFrameBufferInit init); readonly attribute VideoPixelFormat? format; readonly attribute unsigned long codedWidth; readonly attribute unsigned long codedHeight; readonly attribute DOMRectReadOnly? codedRect; readonly attribute DOMRectReadOnly? visibleRect; + readonly attribute double rotation; + readonly attribute boolean flip; readonly attribute unsigned long displayWidth; readonly attribute unsigned long displayHeight; readonly attribute unsigned long long? duration; // microseconds readonly attribute long long? timestamp; // microseconds readonly attribute VideoColorSpace colorSpace; + VideoFrameMetadata metadata(); + [Throws] unsigned long allocationSize( optional VideoFrameCopyToOptions options = {}); Promise> copyTo( - [AllowShared] BufferSource destination, + AllowSharedBufferSource destination, optional VideoFrameCopyToOptions options = {}); [Throws] VideoFrame clone(); undefined close(); @@ -321,10 +340,15 @@ dictionary VideoFrameInit { // new computation of displayWidth and displayHeight using image’s pixel // aspect ratio unless an explicit displayWidth and displayHeight are given. DOMRectInit visibleRect; + + double rotation = 0; + boolean flip = false; // Default matches image unless visibleRect is provided. [EnforceRange] unsigned long displayWidth; [EnforceRange] unsigned long displayHeight; + + VideoFrameMetadata metadata; }; dictionary VideoFrameBufferInit { @@ -339,17 +363,30 @@ dictionary VideoFrameBufferInit { // Default visible rect is coded size positioned at (0,0) DOMRectInit visibleRect; + + double rotation = 0; + boolean flip = false; // Default display dimensions match visibleRect. [EnforceRange] unsigned long displayWidth; [EnforceRange] unsigned long displayHeight; VideoColorSpaceInit colorSpace; + + sequence transfer = []; + + VideoFrameMetadata metadata; +}; + +dictionary VideoFrameMetadata { + // Possible members are recorded in the VideoFrame Metadata Registry. }; dictionary VideoFrameCopyToOptions { DOMRectInit rect; sequence layout; + VideoPixelFormat format; + PredefinedColorSpace colorSpace; }; dictionary PlaneLayout { @@ -360,21 +397,37 @@ dictionary PlaneLayout { enum VideoPixelFormat { // 4:2:0 Y, U, V "I420", + "I420P10", + "I420P12", // 4:2:0 Y, U, V, A "I420A", + "I420AP10", + "I420AP12", // 4:2:2 Y, U, V "I422", + "I422P10", + "I422P12", + // 4:2:2 Y, U, V, A + "I422A", + "I422AP10", + "I422AP12", // 4:4:4 Y, U, V "I444", + "I444P10", + "I444P12", + // 4:4:4 Y, U, V, A + "I444A", + "I444AP10", + "I444AP12", // 4:2:0 Y, UV "NV12", - // 32bpp RGBA + // 4:4:4 RGBA "RGBA", - // 32bpp RGBX (opaque) + // 4:4:4 RGBX (opaque) "RGBX", - // 32bpp BGRA + // 4:4:4 BGRA "BGRA", - // 32bpp BGRX (opaque) + // 4:4:4 BGRX (opaque) "BGRX", }; @@ -391,29 +444,35 @@ interface VideoColorSpace { }; dictionary VideoColorSpaceInit { - VideoColorPrimaries primaries; - VideoTransferCharacteristics transfer; - VideoMatrixCoefficients matrix; - boolean fullRange; + VideoColorPrimaries? primaries = null; + VideoTransferCharacteristics? transfer = null; + VideoMatrixCoefficients? matrix = null; + boolean? fullRange = null; }; enum VideoColorPrimaries { - "bt709", // BT.709, sRGB - "bt470bg", // BT.601 PAL - "smpte170m", // BT.601 NTSC + "bt709", + "bt470bg", + "smpte170m", + "bt2020", + "smpte432", }; enum VideoTransferCharacteristics { - "bt709", // BT.709 - "smpte170m", // BT.601 (functionally the same as bt709) - "iec61966-2-1", // sRGB + "bt709", + "smpte170m", + "iec61966-2-1", + "linear", + "pq", + "hlg", }; enum VideoMatrixCoefficients { - "rgb", // sRGB - "bt709", // BT.709 - "bt470bg", // BT.601 PAL - "smpte170m", // BT.601 NTSC (functionally the same as bt470bg) + "rgb", + "bt709", + "bt470bg", + "smpte170m", + "bt2020-ncl", }; [Exposed=(Window,DedicatedWorker), SecureContext] @@ -437,11 +496,11 @@ typedef (BufferSource or ReadableStream) ImageBufferSource; dictionary ImageDecoderInit { required DOMString type; required ImageBufferSource data; - PremultiplyAlpha premultiplyAlpha = "default"; ColorSpaceConversion colorSpaceConversion = "default"; [EnforceRange] unsigned long desiredWidth; [EnforceRange] unsigned long desiredHeight; boolean preferAnimation; + sequence transfer = []; }; @@ -473,6 +532,5 @@ interface ImageTrack : EventTarget { readonly attribute boolean animated; readonly attribute unsigned long frameCount; readonly attribute unrestricted float repetitionCount; - attribute EventHandler onchange; attribute boolean selected; };