#include #include "gmyth_upnp.h" static void _device_found_cb (GMythUPnP *upnp, GMythBackendInfo *info, gpointer data) { g_debug ("BACKEND FOUND: %s", info->hostname); } static void _device_lost_cb (GMythUPnP *upnp, GMythBackendInfo *info, gpointer data) { g_debug ("BACKEND LOST: %s", info->hostname); } int main (int argc, char** argv) { GMythUPnP *o; GMainLoop *loop; g_type_init (); g_thread_init (NULL); o = gmyth_upnp_get_instance (); g_signal_connect (o, "device-found", G_CALLBACK (_device_found_cb), NULL); g_signal_connect (o, "device-lost", G_CALLBACK (_device_lost_cb), NULL); gmyth_upnp_search (o); loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); g_object_unref (o); return 0; }