Harden dependency and supply-chain policy (#100)
Some checks failed
Native code generation / deterministic (push) Failing after 2m6s
Imaging and meshing gate / native (push) Failing after 2m48s
JPEG 2000 feature / linux (push) Successful in 2m43s
Release platform and feature matrix / audit (push) Successful in 35s
Native Rust workspace compile / compile (push) Failing after 57s
Skia feature / linux (push) Successful in 31m0s
Release platform and feature matrix / matrix (false, linux-stable-minimal, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, macos-stable-portable, x86_64-apple-darwin, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, windows-stable-portable, x86_64-pc-windows-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-msrv-portable, x86_64-unknown-linux-gnu, 1.96.0) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-default, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-features, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-release-surface, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Dependency and supply-chain audit / audit (push) Has been cancelled
Some checks failed
Native code generation / deterministic (push) Failing after 2m6s
Imaging and meshing gate / native (push) Failing after 2m48s
JPEG 2000 feature / linux (push) Successful in 2m43s
Release platform and feature matrix / audit (push) Successful in 35s
Native Rust workspace compile / compile (push) Failing after 57s
Skia feature / linux (push) Successful in 31m0s
Release platform and feature matrix / matrix (false, linux-stable-minimal, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, macos-stable-portable, x86_64-apple-darwin, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, windows-stable-portable, x86_64-pc-windows-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-msrv-portable, x86_64-unknown-linux-gnu, 1.96.0) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-default, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-features, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-release-surface, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Dependency and supply-chain audit / audit (push) Has been cancelled
This commit is contained in:
@@ -7,8 +7,7 @@
|
||||
#![allow(clippy::too_many_arguments)] // The RTC loop receives independent owned I/O resources.
|
||||
#![allow(clippy::too_many_lines)] // Linear loops preserve the WebRTC mutation/drain ordering.
|
||||
|
||||
use audiopus::coder::{Decoder, Encoder};
|
||||
use audiopus::{Application, Channels, SampleRate};
|
||||
use libremetaverse_opus::{Channels, Decoder, Encoder};
|
||||
use libremetaverse_types::UUID;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Map, Value, json};
|
||||
@@ -262,7 +261,7 @@ pub struct OpusFrame(pub Vec<u8>);
|
||||
|
||||
/// Encodes PCM into WebRTC Opus frames using native libopus.
|
||||
pub fn encode_pcm_48k_mono(samples: &[i16]) -> Result<Vec<OpusFrame>, WebRtcError> {
|
||||
let encoder = Encoder::new(SampleRate::Hz48000, Channels::Mono, Application::Voip)
|
||||
let mut encoder = Encoder::voip(SAMPLE_RATE, Channels::Mono)
|
||||
.map_err(|error| WebRtcError::Audio(error.to_string()))?;
|
||||
let mut padded = samples.to_vec();
|
||||
let remainder = padded.len() % FRAME_SAMPLES;
|
||||
@@ -783,8 +782,8 @@ async fn run_client(
|
||||
) {
|
||||
let mut buffer = vec![0_u8; 65_536];
|
||||
let mut playback: Option<Playback> = None;
|
||||
let mut decoder = Decoder::new(SampleRate::Hz48000, Channels::Mono).ok();
|
||||
let encoder = Encoder::new(SampleRate::Hz48000, Channels::Mono, Application::Voip).ok();
|
||||
let mut decoder = Decoder::new(SAMPLE_RATE, Channels::Mono).ok();
|
||||
let mut encoder = Encoder::voip(SAMPLE_RATE, Channels::Mono).ok();
|
||||
let mut captured_elapsed = Duration::ZERO;
|
||||
let mut running = true;
|
||||
while running {
|
||||
@@ -833,7 +832,7 @@ async fn run_client(
|
||||
None => running = false,
|
||||
},
|
||||
captured = capture.recv() => {
|
||||
if let (Some(pcm), Some(codec)) = (captured, encoder.as_ref())
|
||||
if let (Some(pcm), Some(codec)) = (captured, encoder.as_mut())
|
||||
&& pcm.len() == FRAME_SAMPLES
|
||||
{
|
||||
let mut packet = vec![0_u8; 4_000];
|
||||
@@ -1731,7 +1730,7 @@ mod tests {
|
||||
fn wav_is_resampled_and_encoded_as_valid_opus() {
|
||||
let frames = encode_wav_bytes(&wav_fixture()).unwrap();
|
||||
assert_eq!(frames.len(), 5);
|
||||
let mut decoder = Decoder::new(SampleRate::Hz48000, Channels::Mono).unwrap();
|
||||
let mut decoder = Decoder::new(SAMPLE_RATE, Channels::Mono).unwrap();
|
||||
let mut samples = vec![0_i16; FRAME_SAMPLES * 6];
|
||||
assert_eq!(
|
||||
decoder
|
||||
|
||||
Reference in New Issue
Block a user