mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-03 15:58:42 +00:00
Require Rust 1.39 on the CI and fix the build after gstreamer-rs changes
This commit is contained in:
parent
88cb29b455
commit
b89a0d18dc
5 changed files with 16 additions and 16 deletions
|
@ -55,10 +55,10 @@ stages:
|
||||||
- cargo build --color=always --all --examples --all-features
|
- cargo build --color=always --all --examples --all-features
|
||||||
- G_DEBUG=fatal_warnings cargo test --color=always --all --examples --all-features
|
- G_DEBUG=fatal_warnings cargo test --color=always --all --examples --all-features
|
||||||
|
|
||||||
test 1.36:
|
test 1.39:
|
||||||
# 1.36 img
|
# 1.39 img
|
||||||
# https://hub.docker.com/_/rust/
|
# https://hub.docker.com/_/rust/
|
||||||
image: "rust:1.36-slim-buster"
|
image: "rust:1.39-slim-buster"
|
||||||
extends: '.cargo test'
|
extends: '.cargo test'
|
||||||
|
|
||||||
test stable:
|
test stable:
|
||||||
|
|
|
@ -24,14 +24,14 @@ impl FileLocation {
|
||||||
match Url::parse(uri_str) {
|
match Url::parse(uri_str) {
|
||||||
Ok(url) => {
|
Ok(url) => {
|
||||||
if url.scheme() != "file" {
|
if url.scheme() != "file" {
|
||||||
return Err(gst::Error::new(
|
return Err(glib::Error::new(
|
||||||
gst::URIError::UnsupportedProtocol,
|
gst::URIError::UnsupportedProtocol,
|
||||||
format!("Unsupported URI {}", uri_str).as_str(),
|
format!("Unsupported URI {}", uri_str).as_str(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let path = url.to_file_path().or_else(|_| {
|
let path = url.to_file_path().or_else(|_| {
|
||||||
Err(gst::Error::new(
|
Err(glib::Error::new(
|
||||||
gst::URIError::BadUri,
|
gst::URIError::BadUri,
|
||||||
format!("Unsupported URI {}", uri_str).as_str(),
|
format!("Unsupported URI {}", uri_str).as_str(),
|
||||||
))
|
))
|
||||||
|
@ -39,7 +39,7 @@ impl FileLocation {
|
||||||
|
|
||||||
FileLocation::try_from(path)
|
FileLocation::try_from(path)
|
||||||
}
|
}
|
||||||
Err(err) => Err(gst::Error::new(
|
Err(err) => Err(glib::Error::new(
|
||||||
gst::URIError::BadUri,
|
gst::URIError::BadUri,
|
||||||
format!("Couldn't parse URI {}: {}", uri_str, err.to_string()).as_str(),
|
format!("Couldn't parse URI {}: {}", uri_str, err.to_string()).as_str(),
|
||||||
)),
|
)),
|
||||||
|
@ -48,14 +48,14 @@ impl FileLocation {
|
||||||
|
|
||||||
fn try_from(location: PathBuf) -> Result<Self, glib::Error> {
|
fn try_from(location: PathBuf) -> Result<Self, glib::Error> {
|
||||||
let location_str = location.to_str().ok_or_else(|| {
|
let location_str = location.to_str().ok_or_else(|| {
|
||||||
gst::Error::new(
|
glib::Error::new(
|
||||||
gst::URIError::BadReference,
|
gst::URIError::BadReference,
|
||||||
format!("Invalid path {:?}", location).as_str(),
|
format!("Invalid path {:?}", location).as_str(),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let file_name = location.file_name().ok_or_else(|| {
|
let file_name = location.file_name().ok_or_else(|| {
|
||||||
gst::Error::new(
|
glib::Error::new(
|
||||||
gst::URIError::BadReference,
|
gst::URIError::BadReference,
|
||||||
format!("Expected a path with a filename, got {}", location_str,).as_str(),
|
format!("Expected a path with a filename, got {}", location_str,).as_str(),
|
||||||
)
|
)
|
||||||
|
@ -74,7 +74,7 @@ impl FileLocation {
|
||||||
}
|
}
|
||||||
|
|
||||||
let parent_canonical = parent_dir.canonicalize().map_err(|err| {
|
let parent_canonical = parent_dir.canonicalize().map_err(|err| {
|
||||||
gst::Error::new(
|
glib::Error::new(
|
||||||
gst::URIError::BadReference,
|
gst::URIError::BadReference,
|
||||||
format!(
|
format!(
|
||||||
"Could not resolve path {}: {}",
|
"Could not resolve path {}: {}",
|
||||||
|
@ -105,7 +105,7 @@ impl FileLocation {
|
||||||
let location_canonical = parent_canonical.join(file_name);
|
let location_canonical = parent_canonical.join(file_name);
|
||||||
Url::from_file_path(&location_canonical)
|
Url::from_file_path(&location_canonical)
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
gst::Error::new(
|
glib::Error::new(
|
||||||
gst::URIError::BadReference,
|
gst::URIError::BadReference,
|
||||||
format!("Could not resolve path to URL {}", location_str).as_str(),
|
format!("Could not resolve path to URL {}", location_str).as_str(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -82,7 +82,7 @@ impl FileSink {
|
||||||
) -> Result<(), glib::Error> {
|
) -> Result<(), glib::Error> {
|
||||||
let state = self.state.lock().unwrap();
|
let state = self.state.lock().unwrap();
|
||||||
if let State::Started { .. } = *state {
|
if let State::Started { .. } = *state {
|
||||||
return Err(gst::Error::new(
|
return Err(glib::Error::new(
|
||||||
gst::URIError::BadState,
|
gst::URIError::BadState,
|
||||||
"Changing the `location` property on a started `filesink` is not supported",
|
"Changing the `location` property on a started `filesink` is not supported",
|
||||||
));
|
));
|
||||||
|
|
|
@ -82,7 +82,7 @@ impl FileSrc {
|
||||||
) -> Result<(), glib::Error> {
|
) -> Result<(), glib::Error> {
|
||||||
let state = self.state.lock().unwrap();
|
let state = self.state.lock().unwrap();
|
||||||
if let State::Started { .. } = *state {
|
if let State::Started { .. } = *state {
|
||||||
return Err(gst::Error::new(
|
return Err(glib::Error::new(
|
||||||
gst::URIError::BadState,
|
gst::URIError::BadState,
|
||||||
"Changing the `location` property on a started `filesrc` is not supported",
|
"Changing the `location` property on a started `filesrc` is not supported",
|
||||||
));
|
));
|
||||||
|
@ -92,14 +92,14 @@ impl FileSrc {
|
||||||
settings.location = match location {
|
settings.location = match location {
|
||||||
Some(location) => {
|
Some(location) => {
|
||||||
if !location.exists() {
|
if !location.exists() {
|
||||||
return Err(gst::Error::new(
|
return Err(glib::Error::new(
|
||||||
gst::URIError::BadReference,
|
gst::URIError::BadReference,
|
||||||
format!("{} doesn't exist", location).as_str(),
|
format!("{} doesn't exist", location).as_str(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !location.is_file() {
|
if !location.is_file() {
|
||||||
return Err(gst::Error::new(
|
return Err(glib::Error::new(
|
||||||
gst::URIError::BadReference,
|
gst::URIError::BadReference,
|
||||||
format!("{} is not a file", location).as_str(),
|
format!("{} is not a file", location).as_str(),
|
||||||
));
|
));
|
||||||
|
|
|
@ -85,7 +85,7 @@ impl S3Src {
|
||||||
let state = self.state.lock().unwrap();
|
let state = self.state.lock().unwrap();
|
||||||
|
|
||||||
if let StreamingState::Started { .. } = *state {
|
if let StreamingState::Started { .. } = *state {
|
||||||
return Err(gst::Error::new(
|
return Err(glib::Error::new(
|
||||||
gst::URIError::BadState,
|
gst::URIError::BadState,
|
||||||
"Cannot set URI on a started s3src",
|
"Cannot set URI on a started s3src",
|
||||||
));
|
));
|
||||||
|
@ -104,7 +104,7 @@ impl S3Src {
|
||||||
*url = Some(s3url);
|
*url = Some(s3url);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
Err(_) => Err(gst::Error::new(
|
Err(_) => Err(glib::Error::new(
|
||||||
gst::URIError::BadUri,
|
gst::URIError::BadUri,
|
||||||
"Could not parse URI",
|
"Could not parse URI",
|
||||||
)),
|
)),
|
||||||
|
|
Loading…
Reference in a new issue