/* cc -o disco discoverer.c $(pkg-config --libs --cflags gstreamer-pbutils-1.0
 * gio-2.0 */
#include <gio/gio.h>
#include <gst/pbutils/pbutils.h>
#include <stdio.h>

int main (int argc, char *argv[]) {
    GstDiscoverer *disco;
    GFile *file;
    GFile *file2;
    gint32 i = 0;
    char *uri, *uri2;
    GTimer *timer;
    GstDiscovererInfo *info;
    GstSample *sample;

    g_type_init ();
    gst_init (&argc, &argv);

    for (i = 0; i < G_MAXINT32; i++) {

        printf ("Iteration: %d\n", i);

        file = g_file_new_for_commandline_arg (argv[1]);
        uri = g_file_get_uri (file);
        disco = gst_discoverer_new ((GstClockTime) 10 * GST_SECOND, NULL);

        info = gst_discoverer_discover_uri (disco, uri, NULL);

        g_object_unref (disco);
        g_free (uri);
        g_object_unref (file);
    }

    return 0;
}
