mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-22 18:16:28 +00:00
Update various dependencies
This commit is contained in:
parent
a8a3a6ec3e
commit
4a870af19c
10 changed files with 65 additions and 27 deletions
|
@ -14,16 +14,16 @@ bytes = "1.0"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
|
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
|
||||||
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
|
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
|
||||||
rusoto_core = "0.46"
|
rusoto_core = "0.47"
|
||||||
rusoto_s3 = "0.46"
|
rusoto_s3 = "0.47"
|
||||||
rusoto_credential = "0.46"
|
rusoto_credential = "0.47"
|
||||||
rusoto_signature = "0.46"
|
rusoto_signature = "0.47"
|
||||||
url = "2"
|
url = "2"
|
||||||
percent-encoding = "2"
|
percent-encoding = "2"
|
||||||
tokio = { version = "1.0", features = [ "rt-multi-thread" ] }
|
tokio = { version = "1.0", features = [ "rt-multi-thread" ] }
|
||||||
async-tungstenite = { version = "0.13", features = ["tokio", "tokio-runtime", "tokio-native-tls"] }
|
async-tungstenite = { version = "0.14", features = ["tokio", "tokio-runtime", "tokio-native-tls"] }
|
||||||
nom = "6"
|
nom = "7"
|
||||||
crc = "1.8.1"
|
crc = "2"
|
||||||
byteorder = "1.3.4"
|
byteorder = "1.3.4"
|
||||||
once_cell = "1.0"
|
once_cell = "1.0"
|
||||||
serde = "1"
|
serde = "1"
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
// Boston, MA 02110-1335, USA.
|
// Boston, MA 02110-1335, USA.
|
||||||
|
|
||||||
use byteorder::{BigEndian, WriteBytesExt};
|
use byteorder::{BigEndian, WriteBytesExt};
|
||||||
use crc::crc32;
|
|
||||||
use nom::{
|
use nom::{
|
||||||
self, bytes::complete::take, combinator::map_res, multi::many0, number::complete::be_u16,
|
self, bytes::complete::take, combinator::map_res, multi::many0, number::complete::be_u16,
|
||||||
number::complete::be_u32, number::complete::be_u8, sequence::tuple, IResult,
|
number::complete::be_u32, number::complete::be_u8, sequence::tuple, IResult,
|
||||||
|
@ -24,6 +23,8 @@ use nom::{
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
|
|
||||||
|
const CRC: crc::Crc<u32> = crc::Crc::<u32>::new(&crc::CRC_32_BZIP2);
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Prelude {
|
struct Prelude {
|
||||||
total_bytes: u32,
|
total_bytes: u32,
|
||||||
|
@ -87,11 +88,11 @@ pub fn encode_packet(payload: &[u8], headers: &[Header]) -> Result<Vec<u8>, io::
|
||||||
(&mut res[0..4]).write_u32::<BigEndian>(total_length as u32)?;
|
(&mut res[0..4]).write_u32::<BigEndian>(total_length as u32)?;
|
||||||
|
|
||||||
// Rewrite the prelude crc since we replaced the lengths
|
// Rewrite the prelude crc since we replaced the lengths
|
||||||
let prelude_crc = crc32::checksum_ieee(&res[0..8]);
|
let prelude_crc = CRC.checksum(&res[0..8]);
|
||||||
(&mut res[8..12]).write_u32::<BigEndian>(prelude_crc)?;
|
(&mut res[8..12]).write_u32::<BigEndian>(prelude_crc)?;
|
||||||
|
|
||||||
// Message CRC
|
// Message CRC
|
||||||
let message_crc = crc32::checksum_ieee(&res);
|
let message_crc = CRC.checksum(&res);
|
||||||
res.write_u32::<BigEndian>(message_crc)?;
|
res.write_u32::<BigEndian>(message_crc)?;
|
||||||
|
|
||||||
Ok(res)
|
Ok(res)
|
||||||
|
@ -101,7 +102,7 @@ fn parse_prelude(input: &[u8]) -> IResult<&[u8], Prelude> {
|
||||||
map_res(
|
map_res(
|
||||||
tuple((be_u32, be_u32, be_u32)),
|
tuple((be_u32, be_u32, be_u32)),
|
||||||
|(total_bytes, header_bytes, prelude_crc)| {
|
|(total_bytes, header_bytes, prelude_crc)| {
|
||||||
let sum = crc32::checksum_ieee(&input[0..8]);
|
let sum = CRC.checksum(&input[0..8]);
|
||||||
if prelude_crc != sum {
|
if prelude_crc != sum {
|
||||||
return Err(nom::Err::Error((
|
return Err(nom::Err::Error((
|
||||||
"Prelude CRC doesn't match",
|
"Prelude CRC doesn't match",
|
||||||
|
@ -148,7 +149,7 @@ pub fn parse_packet(input: &[u8]) -> IResult<&[u8], Packet> {
|
||||||
let (remainder, prelude) = parse_prelude(input)?;
|
let (remainder, prelude) = parse_prelude(input)?;
|
||||||
|
|
||||||
// Check the crc of the whole input
|
// Check the crc of the whole input
|
||||||
let sum = crc32::checksum_ieee(&input[..input.len() - 4]);
|
let sum = CRC.checksum(&input[..input.len() - 4]);
|
||||||
let (_, msg_crc) = be_u32(&input[input.len() - 4..])?;
|
let (_, msg_crc) = be_u32(&input[input.len() - 4..])?;
|
||||||
|
|
||||||
if msg_crc != sum {
|
if msg_crc != sum {
|
||||||
|
|
|
@ -9,7 +9,7 @@ repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
once_cell = "1.0"
|
once_cell = "1.0"
|
||||||
regex = "1"
|
regex = "1.5"
|
||||||
|
|
||||||
[dependencies.gst]
|
[dependencies.gst]
|
||||||
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
||||||
|
|
|
@ -9,7 +9,7 @@ repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
once_cell = "1.0"
|
once_cell = "1.0"
|
||||||
textwrap = { version = "0.13.2", features = ["hyphenation"] }
|
textwrap = { version = "0.14", features = ["hyphenation"] }
|
||||||
hyphenation = "0.8"
|
hyphenation = "0.8"
|
||||||
|
|
||||||
[dependencies.gst]
|
[dependencies.gst]
|
||||||
|
|
|
@ -62,8 +62,36 @@ impl Default for Settings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: https://github.com/mgeisler/textwrap/issues/412
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct WrappedWordSplitter(Box<dyn textwrap::word_splitters::WordSplitter + Send>);
|
||||||
|
|
||||||
|
impl textwrap::word_splitters::WordSplitter for WrappedWordSplitter {
|
||||||
|
fn split_points(&self, word: &str) -> Vec<usize> {
|
||||||
|
self.0.split_points(word)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Clone for WrappedWordSplitter {
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
WrappedWordSplitter(unsafe {
|
||||||
|
std::mem::transmute::<
|
||||||
|
Box<dyn textwrap::word_splitters::WordSplitter + 'static>,
|
||||||
|
Box<dyn textwrap::word_splitters::WordSplitter + Send + 'static>,
|
||||||
|
>(self.0.clone_box())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct State {
|
struct State {
|
||||||
options: Option<textwrap::Options<'static, Box<dyn textwrap::WordSplitter + Send>>>,
|
options: Option<
|
||||||
|
textwrap::Options<
|
||||||
|
'static,
|
||||||
|
textwrap::wrap_algorithms::OptimalFit,
|
||||||
|
textwrap::word_separators::UnicodeBreakProperties,
|
||||||
|
WrappedWordSplitter,
|
||||||
|
>,
|
||||||
|
>,
|
||||||
|
|
||||||
current_text: String,
|
current_text: String,
|
||||||
start_ts: Option<gst::ClockTime>,
|
start_ts: Option<gst::ClockTime>,
|
||||||
|
@ -125,14 +153,14 @@ impl TextWrap {
|
||||||
Ok(standard) => standard,
|
Ok(standard) => standard,
|
||||||
};
|
};
|
||||||
|
|
||||||
Some(textwrap::Options::with_splitter(
|
Some(textwrap::Options::with_word_splitter(
|
||||||
settings.columns as usize,
|
settings.columns as usize,
|
||||||
Box::new(standard),
|
WrappedWordSplitter(Box::new(standard)),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
Some(textwrap::Options::with_splitter(
|
Some(textwrap::Options::with_word_splitter(
|
||||||
settings.columns as usize,
|
settings.columns as usize,
|
||||||
Box::new(textwrap::NoHyphenation),
|
WrappedWordSplitter(Box::new(textwrap::word_splitters::NoHyphenation)),
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -221,7 +249,7 @@ impl TextWrap {
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.expect("We should have a wrapper by now");
|
.expect("We should have a wrapper by now");
|
||||||
|
|
||||||
let lines = textwrap::wrap(¤t_text, options);
|
let lines = textwrap::wrap(¤t_text, &*options);
|
||||||
let mut chunks = lines.chunks(n_lines as usize).peekable();
|
let mut chunks = lines.chunks(n_lines as usize).peekable();
|
||||||
let mut trailing = "".to_string();
|
let mut trailing = "".to_string();
|
||||||
|
|
||||||
|
@ -287,7 +315,7 @@ impl TextWrap {
|
||||||
.options
|
.options
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.expect("We should have a wrapper by now");
|
.expect("We should have a wrapper by now");
|
||||||
textwrap::fill(data, options)
|
textwrap::fill(data, &*options)
|
||||||
};
|
};
|
||||||
|
|
||||||
// If the lines property was set, we want to split the result into buffers
|
// If the lines property was set, we want to split the result into buffers
|
||||||
|
|
|
@ -9,7 +9,7 @@ repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
nom = "6.0"
|
nom = "7.0"
|
||||||
either = "1"
|
either = "1"
|
||||||
uuid = { version = "0.8", features = ["v4"] }
|
uuid = { version = "0.8", features = ["v4"] }
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
|
|
|
@ -257,7 +257,7 @@ fn mcc_payload(s: &[u8]) -> IResult<&[u8], Vec<u8>> {
|
||||||
|
|
||||||
context(
|
context(
|
||||||
"invalid MCC payload",
|
"invalid MCC payload",
|
||||||
fold_many1(mcc_payload_item, Vec::new(), |mut acc: Vec<_>, item| {
|
fold_many1(mcc_payload_item, Vec::new, |mut acc: Vec<_>, item| {
|
||||||
match item {
|
match item {
|
||||||
Either::Left(val) => acc.push(val),
|
Either::Left(val) => acc.push(val),
|
||||||
Either::Right(vals) => acc.extend_from_slice(vals),
|
Either::Right(vals) => acc.extend_from_slice(vals),
|
||||||
|
|
|
@ -109,7 +109,7 @@ fn scc_payload(s: &[u8]) -> IResult<&[u8], Vec<u8>> {
|
||||||
|
|
||||||
context(
|
context(
|
||||||
"invalid SCC payload",
|
"invalid SCC payload",
|
||||||
fold_many1(parse_item, Vec::new(), |mut acc: Vec<_>, item| {
|
fold_many1(parse_item, Vec::new, |mut acc: Vec<_>, item| {
|
||||||
acc.push(item.0);
|
acc.push(item.0);
|
||||||
acc.push(item.1);
|
acc.push(item.1);
|
||||||
acc
|
acc
|
||||||
|
|
|
@ -10,7 +10,7 @@ description = "An PNG encoder/decoder written in pure Rust"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
|
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
|
||||||
gst_video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
|
gst_video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
|
||||||
png = "0.16.3"
|
png = "0.17"
|
||||||
once_cell = "1"
|
once_cell = "1"
|
||||||
parking_lot = "0.11"
|
parking_lot = "0.11"
|
||||||
atomic_refcell = "0.1"
|
atomic_refcell = "0.1"
|
||||||
|
|
|
@ -124,8 +124,8 @@ impl State {
|
||||||
gst_video::VideoFormat::Gray8 | gst_video::VideoFormat::Gray16Be => {
|
gst_video::VideoFormat::Gray8 | gst_video::VideoFormat::Gray16Be => {
|
||||||
png::ColorType::Grayscale
|
png::ColorType::Grayscale
|
||||||
}
|
}
|
||||||
gst_video::VideoFormat::Rgb => png::ColorType::RGB,
|
gst_video::VideoFormat::Rgb => png::ColorType::Rgb,
|
||||||
gst_video::VideoFormat::Rgba => png::ColorType::RGBA,
|
gst_video::VideoFormat::Rgba => png::ColorType::Rgba,
|
||||||
_ => {
|
_ => {
|
||||||
gst_error!(CAT, "format is not supported yet");
|
gst_error!(CAT, "format is not supported yet");
|
||||||
unreachable!()
|
unreachable!()
|
||||||
|
@ -333,6 +333,15 @@ impl VideoEncoderImpl for PngEncoder {
|
||||||
let mut state_guard = self.state.lock();
|
let mut state_guard = self.state.lock();
|
||||||
let state = state_guard.as_mut().ok_or(gst::FlowError::NotNegotiated)?;
|
let state = state_guard.as_mut().ok_or(gst::FlowError::NotNegotiated)?;
|
||||||
|
|
||||||
|
// FIXME: https://github.com/image-rs/image-png/issues/301
|
||||||
|
{
|
||||||
|
let settings = self.settings.lock();
|
||||||
|
state.reset(*settings).map_err(|err| {
|
||||||
|
err.log_with_object(element);
|
||||||
|
gst::FlowError::Error
|
||||||
|
})?;
|
||||||
|
}
|
||||||
|
|
||||||
gst_debug!(
|
gst_debug!(
|
||||||
CAT,
|
CAT,
|
||||||
obj: element,
|
obj: element,
|
||||||
|
|
Loading…
Reference in a new issue