From ec78606126bb104ebb04c56cd7f7734f8a30bfc2 Mon Sep 17 00:00:00 2001 From: Yannick Poirier Date: Mon, 18 Mar 2024 07:55:35 +0100 Subject: [PATCH] Move to Raptorq 2.0 WARNING: encoding packets generated with raptorq < 2.0 cannot be decoded by the new version and vice-versa. --- Cargo.toml | 2 +- src/fec/raptorq.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 88225ae..fb7da17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ flate2 = "1.0" md5 = "0.7" pyo3 = { version = "0.20", features = ["extension-module"], optional = true } pyo3-log = { version = "0.9", optional = true } -raptorq = "1.8" +raptorq = "2.0" raptor-code = "1.0.6" opentelemetry = { version = "0.22", optional = true } rand = "0.8" diff --git a/src/fec/raptorq.rs b/src/fec/raptorq.rs index 6f8b537..845d922 100644 --- a/src/fec/raptorq.rs +++ b/src/fec/raptorq.rs @@ -50,14 +50,14 @@ impl FecEncoder for RaptorQEncoder { fn encode(&self, data: &[u8]) -> crate::error::Result>> { let symbol_aligned = data.len() % self.config.symbol_size() as usize; let encoder = match data.len() % self.config.symbol_size() as usize { - 0 => raptorq::SourceBlockEncoder::new2(0, &self.config.clone(), data), + 0 => raptorq::SourceBlockEncoder::new(0, &self.config.clone(), data), _ => { let mut data = data.to_vec(); data.resize( data.len() + (self.config.symbol_size() as usize - symbol_aligned), 0, ); - raptorq::SourceBlockEncoder::new2(0, &self.config.clone(), &data) + raptorq::SourceBlockEncoder::new(0, &self.config.clone(), &data) } }; @@ -105,7 +105,7 @@ impl RaptorQDecoder { ); let block_length = nb_source_symbols as u64 * encoding_symbol_length as u64; - let decoder = raptorq::SourceBlockDecoder::new2(sbn as u8, &config, block_length); + let decoder = raptorq::SourceBlockDecoder::new(sbn as u8, &config, block_length); RaptorQDecoder { decoder, data: None,