Reading and Modifying Buffers in a Pipeline

Hassan Muhammad hassanmuhammad221 at gmail.com
Tue Nov 10 07:24:54 UTC 2020


Hi. I am new to gstreamer and trying to figure out a way to read buffers
from a video source, modifying the buffers in some way (e.g. draw overlay
information) and output the buffers to a video or filesink. I am using the
gstreamer-rust bindings and have not been able to find a solution to this
problem. Reading on the forums, I tried to add a pad probe at the source
element of the following pipeline as a test by getting the static pad:

"videotestsrc ! autovideosink"

I am able to read the buffer from "probe_info.data" :

*src_pad.add_probe(gst::PadProbeType::BUFFER, |_, probe_info| {*
*___READ BUFFER___*
*}*

However, if I try to map the buffer as writable by using
*gst::buffer::BufferRef::map_writeable()*

it doesn't allow me to do so with the error "cannot borrow as mutable". At
this point I am completely lost and unable to find an alternative to read
and modify a buffer element through a pad probe. Any help or
suggestion would be appreciated to help me overcome this.

Thanks,
Muhammad Hassan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201110/54dc5b33/attachment.htm>


More information about the gstreamer-devel mailing list