[gst-devel] dynamic pipeline questions

René Stadler mail at renestadler.de
Sun Nov 26 02:22:43 CET 2006


Am Samstag, den 25.11.2006, 16:29 -0600 schrieb John Stritch:
> On Sat, 2006-11-25 at 18:47 +0100, René Stadler wrote: 
> > The cutter element from gst-plugins-good probably does what you want.
> > It analyzes raw audio data and posts messages on the bus if there is a
> > transition from silence to non-silence and vice-versa.
> > 
> > Regards,
> >   René Stadler
> > 
> I have played with the cutter. The properties advertised by
> gst-inspect are not behaving in a way that makes sense to me.  I can
> not determine if I am using it correctly.  I can not find any
> documentation about it.  Can anyone point me in the right direction to
> use cutter from C?
> Thanks,
> John 

The element is indeed not documented.  Parsing the message like this
should work (completely untested):

{
  const GstStructure *s = gst_message_get_structure (message);
  const gchar *name = gst_structure_get_name (s);

  if (g_str_equal (name, "cutter")) {
    gboolean above;
    GstClockTime timestamp;

    if (gst_structure_get_boolean (s, "above", &above)
        && gst_structure_get_clock_time (s, "timestamp", &timestamp)) {

      do_something (above, timestamp);
    }
  }
}

Where "message" is a GstMessage of type GST_MESSAGE_ELEMENT coming from
the bus.  Your application should already interact with the pipeline's
bus to implement error handling.  Refer to the application development
manual and the core reference for more information.

Regards,
  René Stadler






More information about the gstreamer-devel mailing list