can gst_buffer_map also map the timestamp and metadata?
gotsring
gotsring at live.com
Mon Sep 14 15:40:02 UTC 2020
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/
More information about the gstreamer-devel
mailing list