centricular / gstcefsrc

A simple gstreamer wrapper around Chromium Embedded Framework
84 stars 45 forks source link

Gst Demux Audio Caps #25

Closed Townsheriff closed 3 years ago

Townsheriff commented 3 years ago

Hey,

I wanted to say big thank you for this project.

On the side note. I'was building pipeline with decklink video and audio sinks which are taken from the cefsrc plugin, but I found an issue with audio caps, in the plugin inspect and in the dot fiels I see format to be F32BE, but when I actually add it in the caps it shows me that it failed to negotiate.

Some code:

    cef_audio_filter.set_property("caps", &gst::Caps::builder("audio/x-raw")
        // here is a bug with invalid format, shows that it is F32BE, but when added in the caps fails to negotiate
        // .field("format", &"F32BE")
        .field("rate", &44100)
        .field("channels", &2)
        .field("layout", &"interleaved")
        .build()
    ).unwrap();

Some logs:

0:00:05.547767871 903835 0x561f142ca180 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<cefsrc0> error: Internal data stream error.
0:00:05.547796675 903835 0x561f142ca180 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<cefsrc0> error: streaming stopped, reason not-negotiated (-4)
Error received Some("/GstPipeline:pipeline0/GstCefSrc:cefsrc0"): Internal data stream error.

If I don't add the field, it works fine.

MathieuDuponchelle commented 3 years ago

Indeed, the advertised F32BE format in the template caps is wrong, and the final caps that got pushed were F32LE, leading to the negotiation problem. I just merged https://github.com/centricular/gstcefsrc/pull/18 , with that you can specify the correct format (F32LE) in the filter. Thanks for the report :)