Skip to content

Commit

Permalink
misc: remove dmabuf code for now
Browse files Browse the repository at this point in the history
It is only useful in experimental codecs
  • Loading branch information
SeaDve committed Mar 6, 2024
1 parent a1ee2cb commit 7b690a8
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,9 @@ pub fn make_pipewiresrc_bin(
let videorate_capsfilter = gst::ElementFactory::make("capsfilter")
.property(
"caps",
&optional_dmabuf_feature_caps(
gst::Structure::builder("video/x-raw")
.field("framerate", gst::Fraction::from(framerate))
.build(),
),
gst::Caps::builder("video/x-raw")
.field("framerate", gst::Fraction::from(framerate))
.build(),
)
.build()?;
bin.add_many([&videorate, &videorate_capsfilter])?;
Expand All @@ -279,10 +277,7 @@ pub fn make_pipewiresrc_bin(
[stream] => {
let pipewiresrc = make_pipewiresrc(fd, &stream.node_id().to_string())?;
bin.add(&pipewiresrc)?;
pipewiresrc.link_filtered(
&videorate,
&optional_dmabuf_feature_caps(gst::Structure::builder("video/x-raw").build()),
)?;
pipewiresrc.link(&videorate)?;
}
streams => {
let compositor = gst::ElementFactory::make("compositor").build()?;
Expand Down Expand Up @@ -407,14 +402,6 @@ fn make_pulsesrc_bin<'a>(
Ok(bin)
}

/// Creates a caps with the given structure and adds the same structure but with `memory:DMABuf` feature.
fn optional_dmabuf_feature_caps(structure: gst::Structure) -> gst::Caps {
gst::Caps::builder_full()
.structure_with_features(structure.clone(), gst::CapsFeatures::new(["memory:DMABuf"]))
.structure(structure)
.build()
}

fn round_to_even(number: i32) -> i32 {
number / 2 * 2
}
Expand Down

0 comments on commit 7b690a8

Please sign in to comment.