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 {
|
||||
type Error = ::VideoMultiviewMode;
|
||||
type Error = glib::BoolError;
|
||||
|
||||
fn try_from(
|
||||
v: ::VideoMultiviewMode,
|
||||
) -> Result<::VideoMultiviewFramePacking, ::VideoMultiviewMode> {
|
||||
fn try_from(v: ::VideoMultiviewMode) -> Result<::VideoMultiviewFramePacking, glib::BoolError> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
let v2 = from_glib(v.to_glib());
|
||||
|
||||
if let ::VideoMultiviewFramePacking::__Unknown(_) = v2 {
|
||||
Err(v)
|
||||
Err(glib_bool_error!("Invalid frame packing mode"))
|
||||
} else {
|
||||
Ok(v2)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue