The compilation warnings below are not so clear to me, appart from the deprecation warhing, but the signature of the method in the valadoc :
http://valadoc.org/#!api=gstreamer-1.0/Gst
shows no other method signature.
the other warning are more obscure.
max@max-ubuntu:~/mdev/cr valac --pkg gstreamer-0.10 gstpipe.vala /home/max/dev/main-sandbox/cr/gstpipe.vala.c: In function ‘application_message’: /home/max/dev/main-sandbox/cr/gstpipe.vala.c:64:2: warning: passing argument 1 of ‘_gst_structure_copy0’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/max/dev/main-sandbox/cr/gstpipe.vala.c:26:17: note: expected ‘gpointer’ but argument is of type ‘const struct GstStructure *’ /home/max/dev/main-sandbox/cr/gstpipe.vala.c:82:9: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] /home/max/dev/main-sandbox/cr/gstpipe.vala.c: In function ‘main’: /home/max/dev/main-sandbox/cr/gstpipe.vala.c:173:2: warning: ‘g_type_init’ is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]
using Gst; void application_message(Gst.Bus bus, Gst.Message msg) { var s = msg.get_structure(); if(s == null) return; string msgtype = s.get_name(); if(msgtype != "level") return; GLib.Value rms = s.get_value("rms"); //GLib.Value st = s.get_value("stream-time"); GLib.DateTime now = new GLib.DateTime.now_local(); var sec = now.to_unix(); var msec = (sec * 1000) + now.get_microsecond(); var z = rms.strdup_contents(); //z = z.replace("{", "[").replace("}", "]"); stdout.printf("%ld, %s \n", (long) msec, z); } void main (string[] args) { Gst.init (ref args); try { var pipeline = Gst.parse_launch( "pulsesrc device=\"alsa_input.usb-046d_08c9_674634A4-02-U0x46d0x8c9.analog-mono\" ! " + "level name=wavelevel interval=10000000 ! " + "wavenc ! filesink location=audioz.wav" ); var bus = pipeline.get_bus(); bus.add_signal_watch(); bus.message.connect(application_message); // Set pipeline state to PLAYING pipeline.set_state (State.PLAYING); // Creating and starting a GLib main loop new MainLoop ().run (); } catch(Error e) { print("%s\n", e.message); } }