static char *
parse_result (const char *result)
{
        GUPnPDIDLLiteParser *parser;
        GError *error;
        const char *import_uri;

        parser = gupnp_didl_lite_parser_new ();

        g_signal_connect (parser,
                          "item-available",
                          G_CALLBACK (didl_item_available_cb),
                          &import_uri);

        import_uri = NULL;
        error = NULL;
        if (!gupnp_didl_lite_parser_parse_didl (parser, result, &error)) {
                g_critical ("Failed to parse result DIDL from MediaServer: %s",
                            error->message);

                g_error_free (error);
        }

        g_object_unref (parser);

        return g_strdup (import_uri);
}
Beispiel #2
0
static char *
parse_result (const char *result)
{
        GUPnPDIDLLiteParser *parser;
        char *container_id;
        GError *error;

        parser = gupnp_didl_lite_parser_new ();
        g_signal_connect (parser,
                          "container-available",
                          G_CALLBACK (didl_container_available_cb),
                          &container_id);

        container_id = NULL;
        error = NULL;
        if (!gupnp_didl_lite_parser_parse_didl (parser, result, &error)) {
                g_critical ("Failed to parse result DIDL from MediaServer: %s",
                            error->message);

                g_error_free (error);
        }

        g_object_unref (parser);

        return container_id;
}
Beispiel #3
0
DIDLLiteParserPrivate::DIDLLiteParserPrivate(DIDLLiteParser *parent)
    : QObject(parent)
    , m_parser(wrap(gupnp_didl_lite_parser_new()))
    , m_objects()
    , m_lastError(0)
    , q_ptr(parent)
{
    g_signal_connect(m_parser.data(), "object-available", G_CALLBACK(on_didl_lite_object_available), &m_objects);
}
Beispiel #4
0
END_TEST

START_TEST(test_didl_container)
{
	GUPnPDIDLLiteParser* parser;

        g_type_init();
	g_thread_init(NULL);

	parser = gupnp_didl_lite_parser_new();
	g_signal_connect(parser, "object-available", (GCallback)test_didl_container_cb,
					NULL);
	gupnp_didl_lite_parser_parse_didl(parser, DIDL_CONTAINER, NULL);
	g_object_unref(parser);

}