mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 00:26:31 +00:00
gstreamer-audio: Simplify audio clipping meta test a bit
This commit is contained in:
parent
d05f8cace8
commit
7c19318097
1 changed files with 10 additions and 8 deletions
|
@ -74,6 +74,8 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_add_get_meta() {
|
fn test_add_get_meta() {
|
||||||
|
use std::convert::TryInto;
|
||||||
|
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
|
|
||||||
let mut buffer = gst::Buffer::with_size(1024).unwrap();
|
let mut buffer = gst::Buffer::with_size(1024).unwrap();
|
||||||
|
@ -85,24 +87,24 @@ mod tests {
|
||||||
gst::format::Default(Some(2)),
|
gst::format::Default(Some(2)),
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
cmeta.get_start(),
|
cmeta.get_start().try_into(),
|
||||||
gst::GenericFormattedValue::Default(gst::format::Default(Some(1)))
|
Ok(gst::format::Default(Some(1)))
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
cmeta.get_end(),
|
cmeta.get_end().try_into(),
|
||||||
gst::GenericFormattedValue::Default(gst::format::Default(Some(2)))
|
Ok(gst::format::Default(Some(2)))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let cmeta = buffer.get_meta::<AudioClippingMeta>().unwrap();
|
let cmeta = buffer.get_meta::<AudioClippingMeta>().unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
cmeta.get_start(),
|
cmeta.get_start().try_into(),
|
||||||
gst::GenericFormattedValue::Default(gst::format::Default(Some(1)))
|
Ok(gst::format::Default(Some(1)))
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
cmeta.get_end(),
|
cmeta.get_end().try_into(),
|
||||||
gst::GenericFormattedValue::Default(gst::format::Default(Some(2)))
|
Ok(gst::format::Default(Some(2)))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue