GstBuffer metadata across shmsink/shmsrc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GstBuffer metadata across shmsink/shmsrc

Crane, Matthew

Hi,

 

I'm currently working on a project where we are passing data between GStreamer pipelines in separate processes using shmsink/shmsrc.  Our current pipelines looks something like the following:

 

Process 1 pipeline:

rtspsrc ! rtph264depay ! h264parse ! custom_ts_element ! gdppay ! shmsink

 

Process 2 pipeline:

shmsrc ! gdpdepay ! appsink

 

The custom_ts_element attaches a reference timestamp metadata item to the buffers that pass through (based on UTC time). We need to be able to get the reference timestamp for the buffers in Process 2.  In preliminary testing we have discovered that our buffer metadata is not making it across the shm interface to the pipeline in Process 2. Here is the buffer logging output of a test run with shmsrc ! gdpdepay ! fakesink that shows "meta: none":

 

/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (16756 bytes, dts: 0:01:10.277195667, pts: 0:01:07.872940835, duration: 0:00:00.100000000, offset: 11793417, offset_end: -1, flags: 00002000 delta-unit , meta: none) 0x5648824925a0

 

I examined some of the shmsink code and saw a spot where the element iterates through the GstMeta objects attached to the buffer and copies them in preparation for copying the buffer to shared memory and expected the metadata to be available in the buffers from shmsrc.  I also ran a test where I removed the gdppay / gdpdepay elements to see if that serialization was removing the metadata, but that didn't change anything.

 

Is this a bug in shmsink/shmsrc? Or is it functioning as designed?

 

-Matt


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: GstBuffer metadata across shmsink/shmsrc

Sebastian Dröge-3
On Thu, 2021-03-11 at 16:09 +0000, Crane, Matthew wrote:


Is this a bug in shmsink/shmsrc? Or is it functioning as designed?


GstMeta unfortunately doesn't provide an API for serializing/deserializing it, and for many GstMeta that also wouldn't be possible (there are quite a few that contain pointers).

A first step for making this all work in shmsrc/sink or gdp would be to add an optional interface on GstMeta for serialization/deserialization, and then implement that in the GstMetas you care about.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel