mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
buffer: Don't copy reference timestamp meta if the destination buffer already has the same
GstRtpBaseDepayload and other places already had such de-duplication code, so it's probably better to solve this at the root. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7747>
This commit is contained in:
parent
39c770af90
commit
128dd3d82c
1 changed files with 18 additions and 2 deletions
|
@ -2804,12 +2804,28 @@ static gboolean
|
||||||
_gst_reference_timestamp_meta_transform (GstBuffer * dest, GstMeta * meta,
|
_gst_reference_timestamp_meta_transform (GstBuffer * dest, GstMeta * meta,
|
||||||
GstBuffer * buffer, GQuark type, gpointer data)
|
GstBuffer * buffer, GQuark type, gpointer data)
|
||||||
{
|
{
|
||||||
GstReferenceTimestampMeta *dmeta, *smeta;
|
const GstReferenceTimestampMeta *smeta, *ometa;
|
||||||
|
GstReferenceTimestampMeta *dmeta;
|
||||||
|
gpointer iter = NULL;
|
||||||
|
|
||||||
/* we copy over the reference timestamp meta, independent of transformation
|
/* we copy over the reference timestamp meta, independent of transformation
|
||||||
* that happens. If it applied to the original buffer, it still applies to
|
* that happens. If it applied to the original buffer, it still applies to
|
||||||
* the new buffer as it refers to the time when the media was captured */
|
* the new buffer as it refers to the time when the media was captured */
|
||||||
smeta = (GstReferenceTimestampMeta *) meta;
|
smeta = (const GstReferenceTimestampMeta *) meta;
|
||||||
|
|
||||||
|
while ((ometa = (const GstReferenceTimestampMeta *)
|
||||||
|
gst_buffer_iterate_meta_filtered (dest, &iter,
|
||||||
|
GST_REFERENCE_TIMESTAMP_META_API_TYPE))) {
|
||||||
|
if (ometa->timestamp == smeta->timestamp
|
||||||
|
&& ometa->duration == smeta->duration
|
||||||
|
&& gst_caps_is_equal (ometa->reference, smeta->reference)) {
|
||||||
|
GST_CAT_TRACE (gst_reference_timestamp_meta_debug,
|
||||||
|
"Not copying reference timestamp metadata from buffer %p to %p because equal meta already exists",
|
||||||
|
buffer, dest);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dmeta =
|
dmeta =
|
||||||
gst_buffer_add_reference_timestamp_meta (dest, smeta->reference,
|
gst_buffer_add_reference_timestamp_meta (dest, smeta->reference,
|
||||||
smeta->timestamp, smeta->duration);
|
smeta->timestamp, smeta->duration);
|
||||||
|
|
Loading…
Reference in a new issue