can gst_buffer_map also map the timestamp and metadata?

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

can gst_buffer_map also map the timestamp and metadata?

Ling Wang
Hi All,

I am looking into shmsink/shmsrc, the buffer passthrough does not contain any metadata such as pts, dts. I wonder if gst_buffer_map() actually is supposed to contain that data or it only contains the memory the buffer wrapped?

Is there any plugin that actually passes the buffer with timestamp to another process? Is there any muxer that allows me to wrap the buffer with its metadata into another buffer so I can actually demux it out with the correct timestamp after received by shmsrc?

Thanks,

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

Re: can gst_buffer_map also map the timestamp and metadata?

gotsring
I'm not sure that I completely understand the question, but you should be
able to access the PTS and DTS from mapped buffers, example below. If
needed, you can write the values directly via a pad probe callback. See docs
for GstBuffer for other metadata.


// When contructing the pipeline, add the callback when a new buffer comes
in.
gst_pad_add_probe(shmsrc_pad, GST_PAD_PROBE_TYPE_BUFFER, read_timestamp_cb,
NULL, NULL);


// Read the PTS and DTS from the buffer
GstPadProbeReturn read_timestamp_cb(GstPad* pad, GstPadProbeInfo* info,
gpointer data) {
        GstBuffer* buffer = GST_PAD_PROBE_INFO_BUFFER(info);
        g_info("Buffer PTS:%I64d \t DTS:%d", buffer->pts, buffer->dts);

        //buffer = gst_buffer_make_writable(buffer); // Make buffer writable
        // ... write data ...
        //GST_PAD_PROBE_INFO_DATA(info) = buffer; // Save the changes

        return GST_PAD_PROBE_OK;
}





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

Re: can gst_buffer_map also map the timestamp and metadata?

Tom Bailey
In reply to this post by Ling Wang
Hi,

You may wish to take a look at ipcpipelinesrc / ipcpipelinesink if you want to pass buffers between processes.

Tom

------ Original message------
From: ^_^Sisyphus^_^
Date: Fri, 11 Sep 2020 20:24
Cc:
Subject:can gst_buffer_map also map the timestamp and metadata?

[External email]

Hi All,

I am looking into shmsink/shmsrc, the buffer passthrough does not contain any metadata such as pts, dts. I wonder if gst_buffer_map() actually is supposed to contain that data or it only contains the memory the buffer wrapped?

Is there any plugin that actually passes the buffer with timestamp to another process? Is there any muxer that allows me to wrap the buffer with its metadata into another buffer so I can actually demux it out with the correct timestamp after received by shmsrc?

Thanks,


[External email. Treat hyperlinks and attachments with caution]

This transmission contains information that may be confidential and contain personal views which are not necessarily those of YouView TV Ltd. YouView TV Ltd (Co No:7308805) is a limited liability company registered in England and Wales with its registered address at YouView TV Ltd, 3rd Floor, 10 Lower Thames Street, London, EC3R 6YT. For details see our web site at http://www.youview.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: can gst_buffer_map also map the timestamp and metadata?

Tim Müller
In reply to this post by Ling Wang
On Fri, 2020-09-11 at 21:24 +0200, ^_^Sisyphus^_^ wrote:

> I am looking into shmsink/shmsrc, the buffer passthrough does not
> contain any metadata such as pts, dts. I wonder if gst_buffer_map()
> actually is supposed to contain that data or it only contains the
> memory the buffer wrapped?
>
>
> Is there any plugin that actually passes the buffer with timestamp to
> another process? Is there any muxer that allows me to wrap the buffer
> with its metadata into another buffer so I can actually demux it out
> with the correct timestamp after received by shmsrc?

In addition to the other options already mentioned:

You can use gdppay to payload buffers plus metadata (caps, segment,
timestamps, events), and use gdpdepay on the other end.

Depending on what your data is you may be able to mux it into a
container and then retrieve the timestamping again by demuxing on the
other side.

It all depends on the details of your pipeline.

Cheers
 Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

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