[gst-devel] Event not reaching pad
Steve Fink
sphink at gmail.com
Fri Sep 14 01:24:38 CEST 2007
I have an element that I am developing. I want to trigger something on
it externally. To test it, I modified gst-launch to read a command
file whenever it gets a SIGUSR1, and "execute" what it says. My one
and only command right now is to do gst_element_send_event() on the
pipeline with a custom event that my element (actually, my sink pad's
event handling function) responds to.
The pad never sees the event. Are unknown events propagated through
the pipeline by default? What is the right way of doing something like
this? I want it to work on any pipeline that has my element somewhere
within it. I could have the pipeline "pull" the event from some shared
location, but I thought this was what out of band events were for.
The code to create and send the event is:
GstStructure* data;
GstEvent* event;
data = gst_structure_empty_new("fire");
event = gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM_OOB, data);
gst_element_send_event(pipeline, event);
The output for GST_DEBUG='GST_EVENT:5' is:
Caught SIGUSR1 - Reading command link.
0:00:05.664070000 26942 0x95b2058 DEBUG GST_EVENT
gstevent.c:286:gst_event_new: creating new event 0xb7200768
custom-downstream-oob 514
0:00:05.664162000 26942 0x95b2058 LOG GST_EVENT
gstevent.c:245:gst_event_finalize: freeing event 0xb7200768 type
custom-downstream-oob
In my pad's event handler function, I print out the events I get. I
get a printout for a newsegment, a tag, and an eos, but nothing for my
custom event.
If I switch to
event = gst_event_new_custom(GST_EVENT_TAG, data);
it still doesn't make it to my pad. How can I trace the progress of an
event through a pipeline? Is what I am trying to do valid?
More information about the gstreamer-devel
mailing list