Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env gjs
// run : gjs dbus-list-current-services.js 2>/dev/null | sort -t, -k2,3r | column -s, -t
const Lang = imports.lang;
const Gio = imports.gi.Gio;
const Format = imports.format;
const cmdline = "dbus-send --%s --dest=%s --type=method_call --print-reply %s org.freedesktop.DBus.Introspectable.Introspect";
const Subprocess = new Lang.Class({
Name: "Subprocess",
#!/usr/bin/env vala
[DBus (name = "org.testdbus.Server")]
interface TestDBus.Client : GLib.Object {
public signal void finalized();
public abstract string say(string sentence) throws Error;
public abstract void quit() throws Error;
}
[DBus (name = "org.testdbus.Server")]
#!/usr/bin/env gjs
const Lang = imports.lang;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Gst = imports.gi.Gst;
const Mainloop = imports.mainloop;
let TestAV = new Lang.Class({
Name: "Helloworld",
#!/usr/bin/env gjs
const Lang = imports.lang;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
let Helloworld = Lang.Class({
Name: "Helloworld",
Extends: GObject.Object,
_init: function() {
/*
* compile: gcc -O0 -g $(pkg-config --cflags --libs glib-2.0 gobject-2.0 gstreamer-1.0) -o gstextractor gstextractor.c
* pipeline: gnlcomposition. ( gnlsource. ( bin. ( filesrc ! decodebin ) ), gnlsource. ( bin. ( filesrc ! decodebin ) ) ... ) ! \
* audioconvert ! faac ! qtmux ! filesink
* gnlcomposition. ( gnlsource. ( bin. ( filesrc ! decodebin ) ), gnlsource. ( bin. ( filesrc ! decodebin ) ) ... ) ! \
* videoconvert ! x264enc ! qtmux0.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <glib-unix.h>
#include <gst/gst.h>
typedef struct {
GstElement *audioin;
GstElement *audiodecode;
GstElement *audiobin;
GstElement *audiosource;