mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-03 02:03:48 +00:00
onvifmetadataextractor: fix missing pts/dts in metadata buffer
Segments coming from the onvifmetadataextractor-plugin's meta_src do not inherit pts/dts from the input. This leads to strange bugs when trying to send the metadata using rtp. Fix this by appending the pts/dts of the incoming buffers to the outgoing metadata buffers Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/655 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2086>
This commit is contained in:
parent
c0b801ce46
commit
514cf57c56
1 changed files with 11 additions and 1 deletions
|
@ -206,6 +206,9 @@ impl OnvifMetadataExtractor {
|
|||
|
||||
let remove = self.settings.lock().unwrap().remove_metadata;
|
||||
|
||||
let pts = buffer.pts();
|
||||
let dts = buffer.dts();
|
||||
|
||||
if let Ok(metas) =
|
||||
gst::meta::CustomMeta::from_mut_buffer(buffer.make_mut(), "OnvifXMLFrameMeta")
|
||||
{
|
||||
|
@ -213,7 +216,14 @@ impl OnvifMetadataExtractor {
|
|||
|
||||
if let Ok(frames) = s.get::<gst::BufferList>("frames") {
|
||||
frames.foreach(|meta_buf, _idx| {
|
||||
let res = self.meta_src_pad.push(meta_buf.clone());
|
||||
let mut buffer = meta_buf.clone();
|
||||
{
|
||||
let buffer = buffer.make_mut();
|
||||
buffer.set_dts(dts);
|
||||
buffer.set_pts(pts);
|
||||
}
|
||||
|
||||
let res = self.meta_src_pad.push(buffer);
|
||||
let _ = self
|
||||
.flow_combiner
|
||||
.lock()
|
||||
|
|
Loading…
Reference in a new issue