mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-12-14 12:06:28 +00:00
PadInfo: add caps_compatible
Returns true if 2 caps described by a string can intersect.
This commit is contained in:
parent
3028bef267
commit
f545e1886a
1 changed files with 7 additions and 0 deletions
|
@ -12,6 +12,7 @@ use crate::gps::ElementInfo;
|
|||
use crate::graphmanager::{PortDirection, PortPresence};
|
||||
|
||||
use gst::prelude::*;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug, PartialOrd, PartialEq, Eq)]
|
||||
pub struct PadInfo {
|
||||
|
@ -50,6 +51,12 @@ impl PadInfo {
|
|||
self.caps.as_ref().unwrap()
|
||||
}
|
||||
|
||||
pub fn caps_compatible(caps1: &str, caps2: &str) -> bool {
|
||||
let caps1 = gst::Caps::from_str(caps1).unwrap();
|
||||
let caps2 = gst::Caps::from_str(caps2).unwrap();
|
||||
caps1.can_intersect(&caps2)
|
||||
}
|
||||
|
||||
pub fn pads(element_name: &str, include_on_request: bool) -> (Vec<PadInfo>, Vec<PadInfo>) {
|
||||
let mut input = vec![];
|
||||
let mut output = vec![];
|
||||
|
|
Loading…
Reference in a new issue