[gst-devel] Capturing EOS message from the bus.
Osmo Antero Maatta
osmoma at gmail.com
Mon Dec 20 11:43:16 CET 2010
I have created an audio-recorder application using the GStreamer
framework. My question is:
How to catch and react to the EOS (end of stream, end of recording)
When starting a recording the state change from NULL -> PLAYING works fine.
My program now updates the GUI (buttons, icons in the GUI) when the
recording changes state from NULL -> READY -> PLAYING. This works OK.
Also state change from PLAYING -> PAUSED works fine. My program captures
the PAUSED message and updates the GUI. This is OK.
But how to catch the STOP message (when the recording stops/ends) ?
Obviously Gstreamer has no STOP/STREAM END message. Are there
event-chain for PLAYING -> PAUSED -> STOP/NULL?
*I want to update the GUI solely via the Gstreamer's state-change
Why? Because the recording can be controlled from various places;
directly from the GUI using buttons, it can be controlled from DBus by
Media Players (like Amarok/RhythmBox/Banshee and there are threads
involved etc.). So I want to update the GUI solely via (event's) state
Here is how I setup the callback functions to receive events/messages
from the bus.
See: rec_state_changed_cb(...) function in
The message/event handlers are set up like this (in the
rec_create_pipeline(...) function) :
// Add a message handlers
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
// Detect state changes
// Monitor sound level/amplitude
// Catch error messages
g_signal_connect(bus, "message::eos", G_CALLBACK(rec_eos_msg_cb), NULL);
Osmo Antero (Moma)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gstreamer-devel