Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generic/sodium/src/decrypter/imp.rs2
-rw-r--r--generic/sodium/src/encrypter/imp.rs2
-rw-r--r--generic/sodium/tests/decrypter.rs2
-rw-r--r--net/reqwest/tests/reqwesthttpsrc.rs26
-rw-r--r--video/cdg/src/cdgparse/imp.rs17
5 files changed, 25 insertions, 24 deletions
diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs
index b968c01d0..d53234cef 100644
--- a/generic/sodium/src/decrypter/imp.rs
+++ b/generic/sodium/src/decrypter/imp.rs
@@ -337,7 +337,7 @@ impl Decrypter {
let size = size - total_chunks * box_::MACBYTES as u64;
gst::debug!(CAT, obj: pad, "Setting duration bytes: {}", size);
- q.set(size * gst::format::Bytes::ONE);
+ q.set(gst::format::Bytes::from_u64(size));
true
}
diff --git a/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs
index af7961e81..9ba3a1f35 100644
--- a/generic/sodium/src/encrypter/imp.rs
+++ b/generic/sodium/src/encrypter/imp.rs
@@ -314,7 +314,7 @@ impl Encrypter {
let size = size + crate::HEADERS_SIZE as u64;
gst::debug!(CAT, obj: pad, "Setting duration bytes: {}", size);
- q.set(size * gst::format::Bytes::ONE);
+ q.set(gst::format::Bytes::from_u64(size));
true
}
diff --git a/generic/sodium/tests/decrypter.rs b/generic/sodium/tests/decrypter.rs
index 6b4a4881d..2005ade09 100644
--- a/generic/sodium/tests/decrypter.rs
+++ b/generic/sodium/tests/decrypter.rs
@@ -191,7 +191,7 @@ fn test_pull_range() {
let (seekable, start, stop) = q.result();
assert!(seekable);
assert_eq!(start, gst::format::Bytes::ZERO.into());
- assert_eq!(stop, (6043 * gst::format::Bytes::ONE).into());
+ assert_eq!(stop, gst::format::Bytes::from_u64(6043).into());
// do pulls
let expected_array_1 = [
diff --git a/net/reqwest/tests/reqwesthttpsrc.rs b/net/reqwest/tests/reqwesthttpsrc.rs
index 7a445fbdc..5c7c28257 100644
--- a/net/reqwest/tests/reqwesthttpsrc.rs
+++ b/net/reqwest/tests/reqwesthttpsrc.rs
@@ -376,7 +376,7 @@ fn test_basic_request() {
if cursor.position() == 0 {
assert_eq!(
h.src.query_duration::<gst::format::Bytes>(),
- Some(expected_output.len() as u64 * gst::format::Bytes::ONE)
+ Some(gst::format::Bytes::from_usize(expected_output.len()))
);
}
@@ -434,7 +434,7 @@ fn test_basic_request_inverted_defaults() {
if cursor.position() == 0 {
assert_eq!(
h.src.query_duration::<gst::format::Bytes>(),
- Some(expected_output.len() as u64 * gst::format::Bytes::ONE)
+ Some(gst::format::Bytes::from_usize(expected_output.len()))
);
}
@@ -511,7 +511,7 @@ fn test_extra_headers() {
if cursor.position() == 0 {
assert_eq!(
h.src.query_duration::<gst::format::Bytes>(),
- Some(expected_output.len() as u64 * gst::format::Bytes::ONE)
+ Some(gst::format::Bytes::from_usize(expected_output.len()))
);
}
@@ -570,7 +570,7 @@ fn test_cookies_property() {
if cursor.position() == 0 {
assert_eq!(
h.src.query_duration::<gst::format::Bytes>(),
- Some(expected_output.len() as u64 * gst::format::Bytes::ONE)
+ Some(gst::format::Bytes::from_usize(expected_output.len()))
);
}
@@ -630,7 +630,7 @@ fn test_iradio_mode() {
if cursor.position() == 0 {
assert_eq!(
h.src.query_duration::<gst::format::Bytes>(),
- Some(expected_output.len() as u64 * gst::format::Bytes::ONE)
+ Some(gst::format::Bytes::from_usize(expected_output.len()))
);
}
@@ -706,7 +706,7 @@ fn test_audio_l16() {
if cursor.position() == 0 {
assert_eq!(
h.src.query_duration::<gst::format::Bytes>(),
- Some(expected_output.len() as u64 * gst::format::Bytes::ONE)
+ Some(gst::format::Bytes::from_usize(expected_output.len()))
);
}
@@ -780,7 +780,7 @@ fn test_authorization() {
if cursor.position() == 0 {
assert_eq!(
h.src.query_duration::<gst::format::Bytes>(),
- Some(expected_output.len() as u64 * gst::format::Bytes::ONE)
+ Some(gst::format::Bytes::from_usize(expected_output.len()))
);
}
@@ -930,13 +930,13 @@ fn test_seek_after_ready() {
assert_eq!(current_state, gst::State::Ready);
h.run(|src| {
- src.seek_simple(gst::SeekFlags::FLUSH, 123 * gst::format::Bytes::ONE)
+ src.seek_simple(gst::SeekFlags::FLUSH, gst::format::Bytes::from_u64(123))
.unwrap();
src.set_state(gst::State::Playing).unwrap();
});
let segment = h.wait_for_segment(false);
- assert_eq!(segment.start(), Some(123 * gst::format::Bytes::ONE));
+ assert_eq!(segment.start(), Some(gst::format::Bytes::from_u64(123)));
let mut expected_output = vec![0; 8192 - 123];
for (i, d) in expected_output.iter_mut().enumerate() {
@@ -1009,12 +1009,12 @@ fn test_seek_after_buffer_received() {
//seek to a position after a buffer is Received
h.run(|src| {
- src.seek_simple(gst::SeekFlags::FLUSH, 123 * gst::format::Bytes::ONE)
+ src.seek_simple(gst::SeekFlags::FLUSH, gst::format::Bytes::from_u64(123))
.unwrap();
});
let segment = h.wait_for_segment(true);
- assert_eq!(segment.start(), Some(123 * gst::format::Bytes::ONE));
+ assert_eq!(segment.start(), Some(gst::format::Bytes::from_u64(123)));
let mut expected_output = vec![0; 8192 - 123];
for (i, d) in expected_output.iter_mut().enumerate() {
@@ -1086,8 +1086,8 @@ fn test_seek_with_stop_position() {
assert_eq!(buffer.offset(), 0);
//seek to a position after a buffer is Received
- let start = 123 * gst::format::Bytes::ONE;
- let stop = 131 * gst::format::Bytes::ONE;
+ let start = gst::format::Bytes::from_u64(123);
+ let stop = gst::format::Bytes::from_u64(131);
h.run(move |src| {
src.seek(
1.0,
diff --git a/video/cdg/src/cdgparse/imp.rs b/video/cdg/src/cdgparse/imp.rs
index 6bcd41581..12ea25524 100644
--- a/video/cdg/src/cdgparse/imp.rs
+++ b/video/cdg/src/cdgparse/imp.rs
@@ -100,13 +100,14 @@ fn bytes_to_time(bytes: Bytes) -> gst::ClockTime {
}
fn time_to_bytes(time: gst::ClockTime) -> Bytes {
- time.nseconds()
- .mul_div_round(
- CDG_PACKET_PERIOD * CDG_PACKET_SIZE as u64,
- *gst::ClockTime::SECOND,
- )
- .unwrap()
- * Bytes::ONE
+ Bytes::from_u64(
+ time.nseconds()
+ .mul_div_round(
+ CDG_PACKET_PERIOD * CDG_PACKET_SIZE as u64,
+ *gst::ClockTime::SECOND,
+ )
+ .unwrap(),
+ )
}
impl BaseParseImpl for CdgParse {
@@ -190,7 +191,7 @@ impl BaseParseImpl for CdgParse {
}
};
- let pts = bytes_to_time(frame.offset() * Bytes::ONE);
+ let pts = bytes_to_time(Bytes::from_u64(frame.offset()));
let buffer = frame.buffer_mut().unwrap();
buffer.set_pts(pts);