how can I get the physical address of a gstsample?

Nicolas Dufresne nicolas at ndufresne.ca
Fri Dec 20 18:58:40 UTC 2019


Le jeudi 19 décembre 2019 à 06:18 -0600, mksafavi a écrit :
> Hi.
> 
> I make the pipe below:
> filesrc location=\"%s\" ! qtdemux name=demux demux.video_0 ! h264parse !
> queue ! omxh264dec ! appsink caps=\"%s\" name=testsink"
> then I pull a sample from appsink and map its buffer.
> I want to send the Appsink sample directly(zero-copy) to our DMA which I
> need a physical address to initialize it.

A physical address on Linux is only visible to drivers for security
reasons. You should instead pass/register DMABuf to your driver, and
let you driver resolve the physical addresses using appropriate in-
kernel API (could be one or more, depends if you are allocation
contiguously or not).

> 
> How can I get the physical address of VCU decoder(omxh264dec) output?
> Is there any better method to do this?
> (I'm working on a Xilinx Zynq ZCU104 board on petalinux)

Again, the decoder will give you a GstBuffer, which contains GstMemory
or type DMABuf (need to be checked with gst_is_dmabuf_memory()). You
can then extract the DMAbuf fd with gst_dmabuf_memory_get_fd(). The
physical addresse(s) should only be made visible to your kernel driver
for security reasons.

> 
> thanks
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20191220/6f47c29e/attachment.sig>


More information about the gstreamer-devel mailing list