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:
authorSebastian Dröge <sebastian@centricular.com>2019-06-03 19:47:26 +0300
committerSebastian Dröge <sebastian@centricular.com>2019-06-03 19:47:26 +0300
commitea14f36a0d1dda10e465f149a1d8d0c2a3162694 (patch)
treee53f687eee650597a5a603d43a877a14f5c602e6
parent4eac148045934da97b6e9886c60f8563afe1906c (diff)
Update for the TryInto/TryFrom gstreamer API changes
-rw-r--r--gst-plugin-closedcaption/src/mcc_parse.rs7
-rw-r--r--gst-plugin-closedcaption/src/scc_parse.rs2
-rw-r--r--gst-plugin-closedcaption/tests/scc_parse.rs2
-rw-r--r--gst-plugin-sodium/src/decrypter.rs4
-rw-r--r--gst-plugin-sodium/src/encrypter.rs4
5 files changed, 14 insertions, 5 deletions
diff --git a/gst-plugin-closedcaption/src/mcc_parse.rs b/gst-plugin-closedcaption/src/mcc_parse.rs
index 298a55ce7..8b3403fb2 100644
--- a/gst-plugin-closedcaption/src/mcc_parse.rs
+++ b/gst-plugin-closedcaption/src/mcc_parse.rs
@@ -25,6 +25,7 @@ use gst::subclass::prelude::*;
use gst_video::{self, ValidVideoTimeCode};
use std::cmp;
+use std::convert::TryInto;
use std::sync::{Mutex, MutexGuard};
use crate::line_reader::LineReader;
@@ -735,7 +736,7 @@ impl MccParse {
));
}
- let size = match q.get_result().try_into_bytes().unwrap() {
+ let size = match q.get_result().try_into().unwrap() {
gst::format::Bytes(Some(size)) => size,
gst::format::Bytes(None) => {
return Err(gst_loggable_error!(
@@ -1037,7 +1038,7 @@ impl MccParse {
let (rate, flags, start_type, start, stop_type, stop) = event.get();
- let mut start = match start.try_into_time() {
+ let mut start = match start.try_into() {
Ok(start) => start,
Err(_) => {
gst_error!(CAT, obj: element, "seek has invalid format");
@@ -1045,7 +1046,7 @@ impl MccParse {
}
};
- let mut stop = match stop.try_into_time() {
+ let mut stop = match stop.try_into() {
Ok(stop) => stop,
Err(_) => {
gst_error!(CAT, obj: element, "seek has invalid format");
diff --git a/gst-plugin-closedcaption/src/scc_parse.rs b/gst-plugin-closedcaption/src/scc_parse.rs
index 866434a4b..379556e9a 100644
--- a/gst-plugin-closedcaption/src/scc_parse.rs
+++ b/gst-plugin-closedcaption/src/scc_parse.rs
@@ -97,6 +97,8 @@ impl State {
framerate: gst::Fraction,
element: &gst::Element,
) -> Result<gst_video::ValidVideoTimeCode, gst::FlowError> {
+ use std::convert::TryInto;
+
let timecode = gst_video::VideoTimeCode::new(
framerate,
None,
diff --git a/gst-plugin-closedcaption/tests/scc_parse.rs b/gst-plugin-closedcaption/tests/scc_parse.rs
index 1f16e3085..447f253d5 100644
--- a/gst-plugin-closedcaption/tests/scc_parse.rs
+++ b/gst-plugin-closedcaption/tests/scc_parse.rs
@@ -111,6 +111,8 @@ fn test_parse() {
/// Test that ensures timecode parsing is the expected one
#[test]
fn test_timecodes() {
+ use std::convert::TryInto;
+
init();
let data = include_bytes!("timecodes-cut-down-sample.scc").as_ref();
diff --git a/gst-plugin-sodium/src/decrypter.rs b/gst-plugin-sodium/src/decrypter.rs
index e11bca861..7bcd18c78 100644
--- a/gst-plugin-sodium/src/decrypter.rs
+++ b/gst-plugin-sodium/src/decrypter.rs
@@ -327,6 +327,8 @@ impl Decrypter {
true
}
QueryView::Duration(ref mut q) => {
+ use std::convert::TryInto;
+
if q.get_format() != gst::Format::Bytes {
return pad.query_default(Some(element), query);
}
@@ -339,7 +341,7 @@ impl Decrypter {
return false;
}
- let size = match peer_query.get_result().try_into_bytes().unwrap() {
+ let size = match peer_query.get_result().try_into().unwrap() {
gst::format::Bytes(Some(size)) => size,
gst::format::Bytes(None) => {
gst_error!(CAT, "Failed to query upstream duration");
diff --git a/gst-plugin-sodium/src/encrypter.rs b/gst-plugin-sodium/src/encrypter.rs
index 28d2a614a..21d08ac78 100644
--- a/gst-plugin-sodium/src/encrypter.rs
+++ b/gst-plugin-sodium/src/encrypter.rs
@@ -368,6 +368,8 @@ impl Encrypter {
true
}
QueryView::Duration(ref mut q) => {
+ use std::convert::TryInto;
+
if q.get_format() != gst::Format::Bytes {
return pad.query_default(Some(element), query);
}
@@ -380,7 +382,7 @@ impl Encrypter {
return false;
}
- let size = match peer_query.get_result().try_into_bytes().unwrap() {
+ let size = match peer_query.get_result().try_into().unwrap() {
gst::format::Bytes(Some(size)) => size,
gst::format::Bytes(None) => {
gst_error!(CAT, "Failed to query upstream duration");