Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gstreamer-rs gstreamer-rs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 38
    • Issues 38
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamerGStreamer
  • gstreamer-rsgstreamer-rs
  • Issues
  • #28
Closed
Open
Issue created Aug 16, 2017 by François Laignel@fengalinDeveloper

Add bindings for gst_element_class*() and similar class functions

I'm following this tutorial in order to implement a tee in my audio pipeline.

To get the src pads from the tee, the tutorial proposes using:

  tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%d");
  tee_audio_pad = gst_element_request_pad (tee, tee_src_pad_template, NULL, NULL);

ElementClass is not generated, but I found get_compatible_pad_template on Element. So I tried this in the connect_pad_added callback (my source is a uridecodebin):

    [...]
    let tee = gst::ElementFactory::make("tee", None).unwrap();
    pipeline.add(&tee).unwrap();

    let tee_sink = tee.get_static_pad("sink").unwrap();
    assert_eq!(src_pad.link(&tee_sink), gst::PadLinkReturn::Ok);

    let pad_tmpl = PadTemplate::new("src_%d",
        PadDirection::Src,
        PadPresence::Request,
        &Caps::new_any()
    );
    let tee_src_pad_tmpl = tee.get_compatible_pad_template(&pad_tmpl).unwrap();
    let tee_src_pad = tee.request_pad(&tee_src_pad_tmpl, None, None)
        .expect("Couldn't get src pad from gst tee");

Which fails on tee.request_pad() with the following message:

(.:8073): GStreamer-CRITICAL **: gst_element_request_pad: assertion 'templ->presence == GST_PAD_REQUEST' failed

I can continue investigating, but if you tell me that this isn't going to work, I'd implement the binding to ElementClass instead.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking