[gst-devel] GstMessage gets lost on the bus
Mathis Hofer
mathis.hofer at dreamlab.net
Mon Oct 22 10:06:34 CEST 2007
Hi folks
I'm writing a "trigger" plugin, that I use together with a GstController
to send messages at certain times to the bus.
My problem is that from time to time, some messages -- although they've
been successfully sent to the bus -- don't reach the application.
From the plugin the messages are sent like this:
structure = gst_structure_new ("trigger",
"state",
G_TYPE_INT,
g_value_get_int (value), NULL);
message = gst_message_new_element (GST_OBJECT (this), structure);
res = gst_element_post_message (GST_ELEMENT (this), message);
...and in the application's event loop I'm polling the bus like this:
while (1) {
message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);
switch (message->type) {
case GST_MESSAGE_ELEMENT: {
const GstStructure *s = gst_message_get_structure (message);
const gchar *name = gst_structure_get_name (s);
if (strcmp (name, "trigger") == 0) {
int state = g_value_get_int (gst_structure_get_value (s,
"state"));
switch (state) {
// ...
}
}
}
}
Is it a problem the way I poll the bus or may it be even a GStreamer bug?
I'm using GStreamer 0.10.12 (Ubuntu Feisty).
Thank you for any hints.
Regards,
Mathis
--
DreamLab Technologies AG
Monbijoustrasse 36
3011 Bern
Switzerland
Tel: +41 31 398 66 66
Fax: +41 31 398 66 69
PGP Key ID: 2462240B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20071022/3abcc637/attachment.pgp>
More information about the gstreamer-devel
mailing list