简体   繁体   中英

Custom allocator in GStreamer

To simplify things, let's say I have a very simple pipeline, like:

videotestsrc -> appsink

How do I configure it to use a custom allocator I've developed? (the GstAllocator-based implementation is already done, my question focuses on the pipeline configuration tu use it).

I'm developing a C++ application on Gstreamer 1.2.

Thanks, E.

Pads negotiate an allocator using GST_QUERY_ALLOCATION . The downstream sinkpad can suggest an allocator and the upstream sourcepad can either use it or use it's own allocator.

There is unfortunately no built in way (property to set or method to call) to configure a GstPipeline, GstBin, GstElement or GstPad to use a supplied allocator.

You could use a pad probe (preferably on the srcpad of videotestsrc in your example) to modify the GST_QUERY_ALLOCATION passing through there, modifying it to suggest your allocator to videotestsrc. Depending on the implementation of the source pad, in the best case your suggested allocator will be used for that link.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM