Update to version 1.0.1

This commit is contained in:
Wim Taymans 2024-01-19 12:56:23 +01:00 committed by root
parent 08eabea80a
commit 1574bf964f
6 changed files with 143 additions and 102 deletions

1
.gitignore vendored
View File

@ -49,3 +49,4 @@
/pipewire-0.3.47.tar.gz
/pipewire-0.3.67.tar.gz
/pipewire-1.0.0.tar.gz
/pipewire-1.0.1.tar.gz

1
.pipewire.metadata Normal file
View File

@ -0,0 +1 @@
e76e7187f90ecbb6b60ecea05a6b1b813832434c pipewire-1.0.1.tar.gz

View File

@ -0,0 +1,132 @@
From 18bd53043435f3d32d6eee871dcd23017239ef70 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Fri, 19 Jan 2024 12:53:39 +0100
Subject: [PATCH] Revert "gst/pipewiresrc: Let GstBaseSrc handle pseudo-live
calculations"
This reverts commit 004206db370f4244411ffc16135d51d021809df8.
---
src/gst/gstpipewiresrc.c | 66 +++++++++++++++-------------------------
1 file changed, 24 insertions(+), 42 deletions(-)
diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c
index d95e99620..753bf760a 100644
--- a/src/gst/gstpipewiresrc.c
+++ b/src/gst/gstpipewiresrc.c
@@ -91,8 +91,6 @@ static gboolean gst_pipewire_src_start (GstBaseSrc * basesrc);
static gboolean gst_pipewire_src_stop (GstBaseSrc * basesrc);
static gboolean gst_pipewire_src_event (GstBaseSrc * src, GstEvent * event);
static gboolean gst_pipewire_src_query (GstBaseSrc * src, GstQuery * query);
-static void gst_pipewire_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
- GstClockTime * start, GstClockTime * end);
static void
gst_pipewire_src_set_property (GObject * object, guint prop_id,
@@ -415,7 +413,6 @@ gst_pipewire_src_class_init (GstPipeWireSrcClass * klass)
gstbasesrc_class->stop = gst_pipewire_src_stop;
gstbasesrc_class->event = gst_pipewire_src_event;
gstbasesrc_class->query = gst_pipewire_src_query;
- gstbasesrc_class->get_times = gst_pipewire_src_get_times;
gstpushsrc_class->create = gst_pipewire_src_create;
GST_DEBUG_CATEGORY_INIT (pipewire_src_debug, "pipewiresrc", 0,
@@ -581,7 +578,7 @@ static GstBuffer *dequeue_buffer(GstPipeWireSrc *pwsrc)
GST_LOG_OBJECT (pwsrc, "pts %" G_GUINT64_FORMAT ", dts_offset %" G_GUINT64_FORMAT, h->pts, h->dts_offset);
if (GST_CLOCK_TIME_IS_VALID (h->pts)) {
- GST_BUFFER_PTS (buf) = h->pts;
+ GST_BUFFER_PTS (buf) = h->pts + GST_PIPEWIRE_CLOCK (pwsrc->clock)->time_offset;
if (GST_BUFFER_PTS (buf) + h->dts_offset > 0)
GST_BUFFER_DTS (buf) = GST_BUFFER_PTS (buf) + h->dts_offset;
}
@@ -1136,39 +1133,11 @@ gst_pipewire_src_query (GstBaseSrc * src, GstQuery * query)
return res;
}
-static void
-gst_pipewire_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
- GstClockTime * start, GstClockTime * end)
-{
- GstPipeWireSrc *pwsrc = GST_PIPEWIRE_SRC (basesrc);
-
- /* for live sources, sync on the timestamp of the buffer */
- if (gst_base_src_is_live (basesrc)) {
- GstClockTime timestamp = GST_BUFFER_PTS (buffer);
-
- if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
- /* get duration to calculate end time */
- GstClockTime duration = GST_BUFFER_DURATION (buffer);
-
- if (GST_CLOCK_TIME_IS_VALID (duration)) {
- *end = timestamp + duration;
- }
- *start = timestamp;
- }
- } else {
- *start = GST_CLOCK_TIME_NONE;
- *end = GST_CLOCK_TIME_NONE;
- }
-
- GST_LOG_OBJECT (pwsrc, "start %" GST_TIME_FORMAT " (%" G_GUINT64_FORMAT
- "), end %" GST_TIME_FORMAT " (%" G_GUINT64_FORMAT ")",
- GST_TIME_ARGS (*start), *start, GST_TIME_ARGS (*end), *end);
-}
-
static GstFlowReturn
gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
{
GstPipeWireSrc *pwsrc;
+ GstClockTime pts, dts, base_time;
const char *error = NULL;
GstBuffer *buf;
gboolean update_time = FALSE, timeout = FALSE;
@@ -1247,24 +1216,37 @@ gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
*buffer = buf;
- if (update_time) {
- GstClock *clock;
- GstClockTime pts, dts;
+ if (pwsrc->is_live)
+ base_time = GST_ELEMENT_CAST (psrc)->base_time;
+ else
+ base_time = 0;
- clock = gst_element_get_clock (GST_ELEMENT_CAST (pwsrc));
+ if (update_time) {
+ GstClock *clock = gst_element_get_clock (GST_ELEMENT_CAST (pwsrc));
if (clock != NULL) {
pts = dts = gst_clock_get_time (clock);
gst_object_unref (clock);
} else {
pts = dts = GST_CLOCK_TIME_NONE;
}
+ } else {
+ pts = GST_BUFFER_PTS (*buffer);
+ dts = GST_BUFFER_DTS (*buffer);
+ }
- GST_BUFFER_PTS (*buffer) = pts;
- GST_BUFFER_DTS (*buffer) = dts;
+ if (GST_CLOCK_TIME_IS_VALID (pts))
+ pts = (pts >= base_time ? pts - base_time : 0);
+ if (GST_CLOCK_TIME_IS_VALID (dts))
+ dts = (dts >= base_time ? dts - base_time : 0);
- GST_LOG_OBJECT (pwsrc, "Sending keepalive buffer pts/dts: %" GST_TIME_FORMAT
- " (%" G_GUINT64_FORMAT ")", GST_TIME_ARGS (pts), pts);
- }
+ GST_LOG_OBJECT (pwsrc,
+ "pts %" G_GUINT64_FORMAT ", dts %" G_GUINT64_FORMAT
+ ", base-time %" GST_TIME_FORMAT " -> %" GST_TIME_FORMAT ", %" GST_TIME_FORMAT,
+ GST_BUFFER_PTS (*buffer), GST_BUFFER_DTS (*buffer), GST_TIME_ARGS (base_time),
+ GST_TIME_ARGS (pts), GST_TIME_ARGS (dts));
+
+ GST_BUFFER_PTS (*buffer) = pts;
+ GST_BUFFER_DTS (*buffer) = dts;
return GST_FLOW_OK;
--
2.43.0

View File

@ -1,98 +0,0 @@
From ecf4b071e5e474a362cde42dfdc8713da4a5b550 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Thu, 14 Dec 2023 13:00:00 +0100
Subject: [PATCH] gst: keep track of node ports
Keep a list of ports for the node. When the node goes away, clear the
port links to the node. Handle the case where the port no longer has a
node.
This avoids a crash when, for example, the node permission is removed
and the port points to the now freed node_data.
Fixes #3708
---
src/gst/gstpipewiredeviceprovider.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/gst/gstpipewiredeviceprovider.c b/src/gst/gstpipewiredeviceprovider.c
index 03d763f40..30c436e52 100644
--- a/src/gst/gstpipewiredeviceprovider.c
+++ b/src/gst/gstpipewiredeviceprovider.c
@@ -180,9 +180,11 @@ struct node_data {
struct pw_node_info *info;
GstCaps *caps;
GstDevice *dev;
+ struct spa_list ports;
};
struct port_data {
+ struct spa_list link;
struct node_data *node_data;
struct pw_port *proxy;
struct spa_hook proxy_listener;
@@ -353,6 +355,9 @@ static void port_event_info(void *data, const struct pw_port_info *info)
pw_log_debug("%p", port_data);
+ if (node_data == NULL)
+ return;
+
if (info->change_mask & PW_PORT_CHANGE_MASK_PARAMS) {
for (i = 0; i < info->n_params; i++) {
uint32_t id = info->params[i].id;
@@ -375,6 +380,9 @@ static void port_event_param(void *data, int seq, uint32_t id,
struct node_data *node_data = port_data->node_data;
GstCaps *c1;
+ if (node_data == NULL)
+ return;
+
c1 = gst_caps_from_format (param);
if (c1 && node_data->caps)
gst_caps_append (node_data->caps, c1);
@@ -438,11 +446,17 @@ static void
destroy_node (void *data)
{
struct node_data *nd = data;
+ struct port_data *pd;
GstPipeWireDeviceProvider *self = nd->self;
GstDeviceProvider *provider = GST_DEVICE_PROVIDER (self);
pw_log_debug("destroy %p", nd);
+ spa_list_consume(pd, &nd->ports, link) {
+ spa_list_remove(&pd->link);
+ pd->node_data = NULL;
+ }
+
if (nd->dev != NULL) {
gst_device_provider_device_remove (provider, GST_DEVICE (nd->dev));
}
@@ -472,6 +486,7 @@ destroy_port (void *data)
{
struct port_data *pd = data;
pw_log_debug("destroy %p", pd);
+ spa_list_remove(&pd->link);
}
static const struct pw_proxy_events proxy_port_events = {
@@ -515,6 +530,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
nd->id = id;
if (!props || !spa_atou64(spa_dict_lookup(props, PW_KEY_OBJECT_SERIAL), &nd->serial, 0))
nd->serial = SPA_ID_INVALID;
+ spa_list_init(&nd->ports);
spa_list_append(&self->nodes, &nd->link);
pw_node_add_listener(node, &nd->node_listener, &node_events, nd);
pw_proxy_add_listener((struct pw_proxy*)node, &nd->proxy_listener, &proxy_node_events, nd);
@@ -541,6 +557,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
pd->id = id;
if (!props || !spa_atou64(spa_dict_lookup(props, PW_KEY_OBJECT_SERIAL), &pd->serial, 0))
pd->serial = SPA_ID_INVALID;
+ spa_list_append(&nd->ports, &pd->link);
pw_port_add_listener(port, &pd->port_listener, &port_events, pd);
pw_proxy_add_listener((struct pw_proxy*)port, &pd->proxy_listener, &proxy_port_events, pd);
resync(self);
--
2.43.0

View File

@ -1,6 +1,6 @@
%global majorversion 1
%global minorversion 0
%global microversion 0
%global microversion 1
%global apiversion 0.3
%global spaversion 0.2
@ -9,7 +9,7 @@
%global ms_version 0.4.2
# For rpmdev-bumpspec and releng automation
%global baserelease 2
%global baserelease 1
#global snapdate 20210107
#global gitcommit b17db2cebc1a5ab2c01851d29c05f79cd2f262bb
@ -79,7 +79,7 @@ Source0: https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/%{ver
Source1: pipewire.sysusers
## upstream patches
Patch0001: 0001-gst-keep-track-of-node-ports.patch
Patch0001: 0001-Revert-gst-pipewiresrc-Let-GstBaseSrc-handle-pseudo-.patch
## upstreamable patches
@ -811,6 +811,11 @@ systemctl --no-reload preset --global pipewire.socket >/dev/null 2>&1 || :
%endif
%changelog
* Tue Jan 19 2024 Wim Taymans <wtaymans@redhat.com> - 1.0.1-1
- Update to version 1.0.1
- Add patch to revert timestamps
- Resolves: RHEL-17641, RHEL-21900
* Tue Jan 09 2024 Wim Taymans <wtaymans@redhat.com> - 1.0.0-2
- Fix install conflict with older versions.
- Resolves: RHEL-17641

View File

@ -1 +1 @@
SHA512 (pipewire-1.0.0.tar.gz) = a6bafce94fb059c07200ee8228d470fd403c25426aa0c274a0e1675ff3fe6569cbd7722718937eaf4781e3183c86f41b4cc9c2a212be7423a3197e5b43045235
SHA512 (pipewire-1.0.1.tar.gz) = b768fb5a6d82ad66c07e61dc98d08d8f1fc4e95533125a66499a4a854168ba8c89c6b6cc06b4f0d30a1aac7dcc3672a5ce116f9b8ad6c41bdfa6f51c940a57e4