Skip to content

GitLab

  • Menu
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 37
    • Issues 37
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gstreamer-rsgstreamer-rs
  • Issues
  • #249

Closed
Open
Created Apr 18, 2020 by Massimiliano Mantione@massimiliano.mantione

Support custom data in AppSink

I am trying to use cuda (the Nvidia API to use the GPU for computation) to do image analysis in real time on buffers coming from a camera.

I have abstracted the coda processing with a rust type (a struct) that contains everything that's needed. Let's call this CudaProcessor. The problem is, this struct is not Send, and AFAIK cannot be made Send because the underlying cuda machinery is not Send.

I already have the gst pipeline in place and working (it receives buffers from the camera) but the processing callback cannot capture the CudaProcessor because it is not Send.

I think that the idiomatic gstreamer solution to this would be to have the CudaProcessor instance belong to the AppSink instance, so that they are on the correct thread.

I see from the docs that in plain gstreamer (C API) AppSink supports that user pointer when using calbacks. However it is not exposed in the rust API, probably because making it type safe would be tricky.

Perhaps, more than an issue, this is a question: what is the proper way to support this scenario using the rust API?

Would subclassing AppSink (at the glib level) work? I mean putting the CudaProcessor as a property of a custom AppSink subclass.

The calbacks would need to downcast the AppSink bit it's not a big deal. Would it work? Are there examples of how to do it?

Thanks!

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