# HG changeset patch # User renatofilho # Date 1203947399 0 # Node ID 5bf73f56521b51e63678d7db06b77051d35598dc # Parent e3e434d3ed83004bfa29291d77971ad78ecedb30 [svn r930] removed upnp dependency diff -r e3e434d3ed83 -r 5bf73f56521b gmyth/AUTHORS --- a/gmyth/AUTHORS Thu Feb 21 22:49:45 2008 +0000 +++ b/gmyth/AUTHORS Mon Feb 25 13:49:59 2008 +0000 @@ -2,3 +2,4 @@ Hallyson Luiz de Morais Melo Leonardo Sobral Cunha Rosfran Lins Borges +Renato Araujo Oliveira Filho diff -r e3e434d3ed83 -r 5bf73f56521b gmyth/configure.ac --- a/gmyth/configure.ac Thu Feb 21 22:49:45 2008 +0000 +++ b/gmyth/configure.ac Mon Feb 25 13:49:59 2008 +0000 @@ -144,20 +144,6 @@ CFLAGS="$CFLAGS -pg" fi -AC_ARG_ENABLE(upnp, - AS_HELP_STRING([--enable-upnp], - [enable clinkc's UPnP library (default = no)]), - [ - if test $enableval = no; then - USE_UPNP=no; - else - USE_UPNP=yes; - fi - ],[ - USE_UPNP=no; - ] -) - # Check for pkgconfig AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) # Give error and exit if we don't have pkgconfig @@ -227,17 +213,6 @@ AC_SUBST(LIBCURL_CFLAGS) AC_SUBST(LIBCURL_LIBS) -if [ test $USE_UPNP = yes ]; then - # checks if the gmyth-upnp library can be found - PKG_CHECK_MODULES(UPNP, gmyth-upnp, HAVE_UPNP=yes, HAVE_UPNP=no) - if test "x$HAVE_UPNP" = "xyes"; then - AC_DEFINE(HAVE_UPNP, 1, [GMyth UPnP library found!]) - CFLAGS="$CFLAGS -DHAVE_UPNP" - fi -fi - -AM_CONDITIONAL(HAVE_UPNP, test "x$HAVE_UPNP" = "xyes") - # # mysql libraries # diff -r e3e434d3ed83 -r 5bf73f56521b gmyth/samples/Makefile.am --- a/gmyth/samples/Makefile.am Thu Feb 21 22:49:45 2008 +0000 +++ b/gmyth/samples/Makefile.am Mon Feb 25 13:49:59 2008 +0000 @@ -1,20 +1,11 @@ bin_PROGRAMS = gmyth-cat gmyth-ls -if HAVE_UPNP -bin_PROGRAMS += gmyth-upnp-search -endif - gmyth_cat_SOURCES = \ gmyth_cat.c gmyth_ls_SOURCES = \ gmyth_ls.c -if HAVE_UPNP -gmyth_upnp_search_SOURCES = \ - gmyth_upnp_search.c -endif - LDADD = \ $(top_builddir)/src/libgmyth.la @@ -28,12 +19,3 @@ -I$(top_srcdir)/src \ $(GLIB_CFLAGS) \ $(GOBJECT_CFLAGS) - -if HAVE_UPNP -INCLUDES += \ - $(UPNP_CFLAGS) - -AM_LDFLAGS += \ - $(UPNP_LIBS) -endif - diff -r e3e434d3ed83 -r 5bf73f56521b gmyth/samples/gmyth_upnp_search.c --- a/gmyth/samples/gmyth_upnp_search.c Thu Feb 21 22:49:45 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include - -#include "gmyth_backendinfo.h" -#include "gmyth_file_transfer.h" -#include "gmyth_livetv.h" -#include "gmyth_util.h" -#include "gmyth_common.h" - -typedef struct { - GMythBackendInfo *b_info; - gchar *mythtv_id; -} gupnp_options_t; - -static gupnp_options_t * -_gupnp_options_new() -{ - gupnp_options_t *options = g_new0(gupnp_options_t, 1); - options->b_info = gmyth_backend_info_new(); - - return options; -} - -static void -_gupnp_options_free(gupnp_options_t * options) -{ - g_return_if_fail(options != NULL); - - if (options->b_info) - g_object_unref(options->b_info); - g_free(options->mythtv_id); -} - -static gboolean -_parse_args(int argc, char *argv[], gupnp_options_t * options) -{ - GError *error = NULL; - GOptionContext *context; - - gchar *mythtv_id = NULL; - - GOptionEntry entries[] = { - {"mythtvid", 'm', 0, G_OPTION_ARG_STRING, &mythtv_id, - "MythTV UPnP service " "identifigupnpion", "UPNP_ID"}, - - {NULL} - }; - - g_return_val_if_fail(options != NULL, FALSE); - - context = - g_option_context_new - ("- searches for a list of connected mythtv backend recorded " - "file and prints it on the standard output\n"); - g_option_context_add_main_entries(context, entries, NULL); - g_option_context_parse(context, &argc, &argv, &error); - g_option_context_set_help_enabled(context, TRUE); - - g_option_context_free(context); - - g_free(mythtv_id); - - return TRUE; -} - - -static void -_got_upnp_device(GMythUPnP * gupnp, GMythUPnPDeviceStatus status, - gchar * udn) -{ - g_debug("Got Device !!! [%s, %s]", - gmyth_upnp_device_status_to_string(status), udn); -} - -static gboolean -_gupnp_search_devices(gupnp_options_t * options) -{ - GList *upnp_servers = NULL; - GMythUPnP *gupnp; - GMythBackendInfo *backend_info = gmyth_backend_info_new(); - - g_return_val_if_fail(options != NULL, FALSE); - g_return_val_if_fail(options->b_info != NULL, FALSE); - - gupnp = gmyth_upnp_new(backend_info, _got_upnp_device); - upnp_servers = gmyth_upnp_do_search_sync(gupnp); - - g_list_free(upnp_servers); - g_object_unref(gupnp); - - return TRUE; -} - -int -main(int argc, char *argv[]) -{ - gboolean res = FALSE; - gupnp_options_t *options; - - g_type_init(); - if (!g_thread_supported()) - g_thread_init(NULL); - - options = _gupnp_options_new(); - res = _parse_args(argc, argv, options); - if (!res) { - g_printerr("Argument invalid. Type --help\n"); - return 1; - } - - res = _gupnp_search_devices(options); - - _gupnp_options_free(options); - - return 0; -}