forked from mirrors/gstreamer-rs
video/videoinfo: Use a proper error type in the TryFrom<VideoMultiviewMode> impl for VideoMultiviewFramePacking
This commit is contained in:
parent
d417656707
commit
5eb1dbd93e
1 changed files with 3 additions and 5 deletions
|
@ -195,17 +195,15 @@ impl From<::VideoMultiviewFramePacking> for ::VideoMultiviewMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::convert::TryFrom<::VideoMultiviewMode> for ::VideoMultiviewFramePacking {
|
impl std::convert::TryFrom<::VideoMultiviewMode> for ::VideoMultiviewFramePacking {
|
||||||
type Error = ::VideoMultiviewMode;
|
type Error = glib::BoolError;
|
||||||
|
|
||||||
fn try_from(
|
fn try_from(v: ::VideoMultiviewMode) -> Result<::VideoMultiviewFramePacking, glib::BoolError> {
|
||||||
v: ::VideoMultiviewMode,
|
|
||||||
) -> Result<::VideoMultiviewFramePacking, ::VideoMultiviewMode> {
|
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
|
|
||||||
let v2 = from_glib(v.to_glib());
|
let v2 = from_glib(v.to_glib());
|
||||||
|
|
||||||
if let ::VideoMultiviewFramePacking::__Unknown(_) = v2 {
|
if let ::VideoMultiviewFramePacking::__Unknown(_) = v2 {
|
||||||
Err(v)
|
Err(glib_bool_error!("Invalid frame packing mode"))
|
||||||
} else {
|
} else {
|
||||||
Ok(v2)
|
Ok(v2)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue