1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
From f24595e9d7952e1e957c0973de62e6c3df031c08 Mon Sep 17 00:00:00 2001
From: Jose Quaresma <quaresma.jose@gmail.com>
Date: Sun, 20 Feb 2022 23:26:10 +0000
Subject: [PATCH 1/3] gstreamer: tests: make the gstbin pop message more clear
Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
tests/check/gst/gstbin.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/check/gst/gstbin.c b/tests/check/gst/gstbin.c
index e366d5fe20f..06be4c75fbb 100644
--- a/tests/check/gst/gstbin.c
+++ b/tests/check/gst/gstbin.c
@@ -38,7 +38,7 @@ pop_async_done (GstBus * bus)
== GST_MESSAGE_ASYNC_DONE, "did not get GST_MESSAGE_ASYNC_DONE");
gst_message_unref (message);
- GST_DEBUG ("popped message");
+ GST_DEBUG ("popped async-done message");
}
static void
@@ -46,14 +46,14 @@ pop_latency (GstBus * bus)
{
GstMessage *message;
- GST_DEBUG ("popping async-done message");
+ GST_DEBUG ("popping latency message");
message = gst_bus_poll (bus, GST_MESSAGE_LATENCY, -1);
fail_unless (message && GST_MESSAGE_TYPE (message)
== GST_MESSAGE_LATENCY, "did not get GST_MESSAGE_LATENCY");
gst_message_unref (message);
- GST_DEBUG ("popped message");
+ GST_DEBUG ("popped latency message");
}
static void
@@ -63,7 +63,7 @@ pop_state_changed (GstBus * bus, int count)
int i;
- GST_DEBUG ("popping %d messages", count);
+ GST_DEBUG ("popping %d state-changed message", count);
for (i = 0; i < count; ++i) {
message = gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1);
@@ -72,7 +72,7 @@ pop_state_changed (GstBus * bus, int count)
gst_message_unref (message);
}
- GST_DEBUG ("popped %d messages", count);
+ GST_DEBUG ("popped %d state-changed messages", count);
}
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
--
GitLab
From 2c47f61c69702572bf666ad9ecaf59710f4a342c Mon Sep 17 00:00:00 2001
From: Jose Quaresma <quaresma.jose@gmail.com>
Date: Sun, 20 Feb 2022 23:28:00 +0000
Subject: [PATCH 2/3] gstreamer: tests: add a timeout in gstbin pop functions
instaed of wait forever
Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
tests/check/gst/gstbin.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/check/gst/gstbin.c b/tests/check/gst/gstbin.c
index 06be4c75fbb..c837d0e7e8a 100644
--- a/tests/check/gst/gstbin.c
+++ b/tests/check/gst/gstbin.c
@@ -32,7 +32,7 @@ pop_async_done (GstBus * bus)
GstMessage *message;
GST_DEBUG ("popping async-done message");
- message = gst_bus_poll (bus, GST_MESSAGE_ASYNC_DONE, -1);
+ message = gst_bus_poll (bus, GST_MESSAGE_ASYNC_DONE, GST_SECOND);
fail_unless (message && GST_MESSAGE_TYPE (message)
== GST_MESSAGE_ASYNC_DONE, "did not get GST_MESSAGE_ASYNC_DONE");
@@ -47,7 +47,7 @@ pop_latency (GstBus * bus)
GstMessage *message;
GST_DEBUG ("popping latency message");
- message = gst_bus_poll (bus, GST_MESSAGE_LATENCY, -1);
+ message = gst_bus_poll (bus, GST_MESSAGE_LATENCY, GST_SECOND);
fail_unless (message && GST_MESSAGE_TYPE (message)
== GST_MESSAGE_LATENCY, "did not get GST_MESSAGE_LATENCY");
@@ -65,7 +65,7 @@ pop_state_changed (GstBus * bus, int count)
GST_DEBUG ("popping %d state-changed message", count);
for (i = 0; i < count; ++i) {
- message = gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1);
+ message = gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, GST_SECOND);
fail_unless (message && GST_MESSAGE_TYPE (message)
== GST_MESSAGE_STATE_CHANGED, "did not get GST_MESSAGE_STATE_CHANGED");
--
GitLab
From 686add28e21ae0031f9e3b07f9fb5cd4d5d19bc5 Mon Sep 17 00:00:00 2001
From: Jose Quaresma <quaresma.jose@gmail.com>
Date: Mon, 21 Feb 2022 23:06:07 +0000
Subject: [PATCH 3/3] gstreamer: tests: fix gstbin deadlock
this is a bit ugly but if the latency message is lost
the pop_latency will hang forever.
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/778
Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
tests/check/gst/gstbin.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/check/gst/gstbin.c b/tests/check/gst/gstbin.c
index c837d0e7e8a..5d9a09171aa 100644
--- a/tests/check/gst/gstbin.c
+++ b/tests/check/gst/gstbin.c
@@ -741,7 +741,8 @@ GST_START_TEST (test_watch_for_state_change)
pop_state_changed (bus, 3);
if (ret == GST_STATE_CHANGE_ASYNC) {
pop_async_done (bus);
- pop_latency (bus);
+ if (gst_bus_have_pending (bus))
+ pop_latency (bus);
}
fail_unless (gst_bus_have_pending (bus) == FALSE,
--
GitLab
|