diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile.am | 6 | ||||
-rw-r--r-- | tools/Makefile.in | 593 | ||||
-rw-r--r-- | tools/gupnp-dlna-info.c | 509 | ||||
-rw-r--r-- | tools/gupnp-dlna-ls-profiles.c | 141 |
4 files changed, 1249 insertions, 0 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am new file mode 100644 index 0000000..122be05 --- /dev/null +++ b/tools/Makefile.am @@ -0,0 +1,6 @@ +bin_PROGRAMS = gupnp-dlna-info gupnp-dlna-ls-profiles + +AM_CFLAGS = -I$(top_srcdir) $(GST_CFLAGS) $(GST_PBU_CFLAGS) +LIBS = $(GST_LIBS) \ + $(GST_PBU_LIBS) \ + $(top_builddir)/libgupnp-dlna/libgupnp-dlna-1.0.la diff --git a/tools/Makefile.in b/tools/Makefile.in new file mode 100644 index 0000000..2c431c1 --- /dev/null +++ b/tools/Makefile.in @@ -0,0 +1,593 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = gupnp-dlna-info$(EXEEXT) \ + gupnp-dlna-ls-profiles$(EXEEXT) +subdir = tools +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +gupnp_dlna_info_SOURCES = gupnp-dlna-info.c +gupnp_dlna_info_OBJECTS = gupnp-dlna-info.$(OBJEXT) +gupnp_dlna_info_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +gupnp_dlna_ls_profiles_SOURCES = gupnp-dlna-ls-profiles.c +gupnp_dlna_ls_profiles_OBJECTS = gupnp-dlna-ls-profiles.$(OBJEXT) +gupnp_dlna_ls_profiles_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = gupnp-dlna-info.c gupnp-dlna-ls-profiles.c +DIST_SOURCES = gupnp-dlna-info.c gupnp-dlna-ls-profiles.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GREP = @GREP@ +GST_CFLAGS = @GST_CFLAGS@ +GST_LIBS = @GST_LIBS@ +GST_MAJORMINOR = @GST_MAJORMINOR@ +GST_PBU_CFLAGS = @GST_PBU_CFLAGS@ +GST_PBU_LIBS = @GST_PBU_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUPNP_DLNA_VERSION_INFO = @GUPNP_DLNA_VERSION_INFO@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = $(GST_LIBS) \ + $(GST_PBU_LIBS) \ + $(top_builddir)/libgupnp-dlna/libgupnp-dlna-1.0.la + +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = -I$(top_srcdir) $(GST_CFLAGS) $(GST_PBU_CFLAGS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +gupnp-dlna-info$(EXEEXT): $(gupnp_dlna_info_OBJECTS) $(gupnp_dlna_info_DEPENDENCIES) $(EXTRA_gupnp_dlna_info_DEPENDENCIES) + @rm -f gupnp-dlna-info$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gupnp_dlna_info_OBJECTS) $(gupnp_dlna_info_LDADD) $(LIBS) +gupnp-dlna-ls-profiles$(EXEEXT): $(gupnp_dlna_ls_profiles_OBJECTS) $(gupnp_dlna_ls_profiles_DEPENDENCIES) $(EXTRA_gupnp_dlna_ls_profiles_DEPENDENCIES) + @rm -f gupnp-dlna-ls-profiles$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gupnp_dlna_ls_profiles_OBJECTS) $(gupnp_dlna_ls_profiles_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gupnp-dlna-info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gupnp-dlna-ls-profiles.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tools/gupnp-dlna-info.c b/tools/gupnp-dlna-info.c new file mode 100644 index 0000000..961cc76 --- /dev/null +++ b/tools/gupnp-dlna-info.c @@ -0,0 +1,509 @@ +/* GUPnPDLNA + * gupnp-dlna-info.c + * + * Copyright (C) 2010 Nokia Corporation + * Copyright (C) 2010 Collabora Multimedia + * + * Authors: Parthasarathi Susarla <partha.susarla@collabora.co.uk> + * + * Based on 'gst-discoverer.c' by + * Edward Hervey <edward.hervey@collabora.co.uk> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> + +#include <gst/gst.h> +#include <gst/pbutils/pbutils.h> + +#include <libgupnp-dlna/profile-loading.h> +#include <libgupnp-dlna/gupnp-dlna-profile.h> +#include <libgupnp-dlna/gupnp-dlna-discoverer.h> +#include <libgupnp-dlna/gupnp-dlna-information.h> + + +static gboolean async = FALSE; +static gboolean verbose = FALSE; +static gint timeout = 10; + + +typedef struct +{ + GUPnPDLNADiscoverer *dc; + int argc; + char **argv; +} PrivStruct; + +/* + * The following functions are from gst-discoverer.c (gst-convenience/tools) + */ +#define my_g_string_append_printf(str, format, ...) \ + g_string_append_printf (str, "%*s" format, 2*depth, " ", ##__VA_ARGS__) + +static gchar * +gst_stream_audio_information_to_string (GstDiscovererStreamInfo * info, + gint depth) +{ + GString *s; + gchar *tmp; + GstCaps *caps; + const GstStructure *misc; + const GstTagList *taglist; + const GstDiscovererAudioInfo *audio_info; + int len = 400; + + g_return_val_if_fail (info != NULL, NULL); + + audio_info = GST_DISCOVERER_AUDIO_INFO (info); + s = g_string_sized_new (len); + + my_g_string_append_printf (s, "Codec:\n"); + caps = gst_discoverer_stream_info_get_caps (info); + tmp = gst_caps_to_string (caps); + my_g_string_append_printf (s, " %s\n", tmp); + gst_caps_unref (caps); + g_free (tmp); + + my_g_string_append_printf (s, "Additional info:\n"); + misc = gst_discoverer_stream_info_get_misc (info); + if (misc) { + tmp = gst_structure_to_string (misc); + my_g_string_append_printf (s, " %s\n", tmp); + g_free (tmp); + } else { + my_g_string_append_printf (s, " None\n"); + } + + my_g_string_append_printf (s, "Channels: %u\n", + gst_discoverer_audio_info_get_channels (audio_info)); + my_g_string_append_printf (s, "Sample rate: %u\n", + gst_discoverer_audio_info_get_sample_rate (audio_info)); + my_g_string_append_printf (s, "Depth: %u\n", + gst_discoverer_audio_info_get_depth (audio_info)); + + my_g_string_append_printf (s, "Bitrate: %u\n", + gst_discoverer_audio_info_get_bitrate (audio_info)); + my_g_string_append_printf (s, "Max bitrate: %u\n", + gst_discoverer_audio_info_get_max_bitrate (audio_info)); + + my_g_string_append_printf (s, "Tags:\n"); + taglist = gst_discoverer_stream_info_get_tags (info); + if (taglist) { + tmp = gst_structure_to_string ((GstStructure *) taglist); + my_g_string_append_printf (s, " %s\n", tmp); + g_free (tmp); + } else { + my_g_string_append_printf (s, " None\n"); + } + + return g_string_free (s, FALSE); +} + +static gchar * +gst_stream_video_information_to_string (GstDiscovererStreamInfo * info, + gint depth) +{ + GString *s; + gchar *tmp; + const GstStructure *misc; + const GstTagList *taglist; + const GstDiscovererVideoInfo *video_info; + GstCaps *caps; + int len = 500; + + g_return_val_if_fail (info != NULL, NULL); + + video_info = GST_DISCOVERER_VIDEO_INFO (info); + + s = g_string_sized_new (len); + + my_g_string_append_printf (s, "Codec:\n"); + caps = gst_discoverer_stream_info_get_caps (info); + tmp = gst_caps_to_string (caps); + my_g_string_append_printf (s, " %s\n", tmp); + gst_caps_unref (caps); + g_free (tmp); + + my_g_string_append_printf (s, "Additional info:\n"); + misc = gst_discoverer_stream_info_get_misc (info); + if (misc) { + tmp = gst_structure_to_string (misc); + my_g_string_append_printf (s, " %s\n", tmp); + g_free (tmp); + } else { + my_g_string_append_printf (s, " None\n"); + } + + my_g_string_append_printf (s, "Width: %u\n", + gst_discoverer_video_info_get_width (video_info)); + my_g_string_append_printf (s, "Height: %u\n", + gst_discoverer_video_info_get_height (video_info)); + my_g_string_append_printf (s, "Depth: %u\n", + gst_discoverer_video_info_get_depth (video_info)); + + my_g_string_append_printf (s, "Frame rate: %u/%u\n", + gst_discoverer_video_info_get_framerate_num (video_info), + gst_discoverer_video_info_get_framerate_denom (video_info)); + + my_g_string_append_printf (s, "Pixel aspect ratio: %u/%u\n", + gst_discoverer_video_info_get_par_num (video_info), + gst_discoverer_video_info_get_par_denom (video_info)); + + my_g_string_append_printf (s, "Interlaced: %s\n", + gst_discoverer_video_info_is_interlaced (video_info) ? "true" : "false"); + + my_g_string_append_printf (s, "Bitrate: %u\n", + gst_discoverer_video_info_get_bitrate (video_info)); + + my_g_string_append_printf (s, "Max bitrate: %u\n", + gst_discoverer_video_info_get_max_bitrate (video_info)); + + my_g_string_append_printf (s, "Tags:\n"); + taglist = gst_discoverer_stream_info_get_tags (info); + if (taglist) { + tmp = gst_structure_to_string ((GstStructure *) taglist); + my_g_string_append_printf (s, " %s\n", tmp); + g_free (tmp); + } else { + my_g_string_append_printf (s, " None\n"); + } + + + return g_string_free (s, FALSE); +} + +static void +print_stream_info (GstDiscovererStreamInfo * info, void *depth) +{ + gchar *desc = NULL; + GstCaps *caps; + + caps = gst_discoverer_stream_info_get_caps (info); + if (caps) { + desc = gst_caps_to_string (caps); + } + + g_print ("%*s%s: %s\n", 2 * GPOINTER_TO_INT (depth), " ", + gst_discoverer_stream_info_get_stream_type_nick (info), + desc); + + if (desc) { + g_free (desc); + desc = NULL; + } + + if (GST_IS_DISCOVERER_AUDIO_INFO (info)) + desc = gst_stream_audio_information_to_string ( + info, + GPOINTER_TO_INT (depth) + 1); + else if (GST_IS_DISCOVERER_VIDEO_INFO (info)) + desc = gst_stream_video_information_to_string ( + info, + GPOINTER_TO_INT (depth) + 1); + + if (desc) { + g_print ("%s", desc); + g_free (desc); + } +} + +static void +print_topology (GstDiscovererStreamInfo * info, gint depth) +{ + GstDiscovererStreamInfo *next; + if (!info) + return; + + print_stream_info (info, GINT_TO_POINTER (depth)); + + next = gst_discoverer_stream_info_get_next (info); + if (next) { + print_topology (next, depth + 1); + gst_discoverer_stream_info_unref (next); + } else if (GST_IS_DISCOVERER_CONTAINER_INFO (info)) { + GList *tmp, *streams; + GstDiscovererContainerInfo *container = + GST_DISCOVERER_CONTAINER_INFO (info); + + streams = gst_discoverer_container_info_get_streams (container); + for (tmp = streams; tmp; tmp = tmp->next) { + GstDiscovererStreamInfo *tmpinf = + GST_DISCOVERER_STREAM_INFO (tmp->data); + print_topology (tmpinf, depth + 1); + } + } +} + +static void +print_duration (GstDiscovererInfo * info, gint tab) +{ + g_print ("%*s%" GST_TIME_FORMAT "\n", tab + 1, " ", + GST_TIME_ARGS (gst_discoverer_info_get_duration (info))); +} + +static void +print_gst_info (GstDiscovererInfo *info, GError *err) +{ + GstDiscovererResult result = gst_discoverer_info_get_result (info); + GstDiscovererStreamInfo *sinfo; + + switch (result) { + case GST_DISCOVERER_OK: + break; + case GST_DISCOVERER_URI_INVALID: + g_print ("URI is not valid\n"); + break; + case GST_DISCOVERER_ERROR: + g_print ("An error was encountered while discovering the file\n"); + g_print (" %s\n", err->message); + break; + case GST_DISCOVERER_TIMEOUT: + g_print ("Analyzing URI timed out\n"); + break; + case GST_DISCOVERER_BUSY: + g_print ("Discoverer was busy\n"); + break; + case GST_DISCOVERER_MISSING_PLUGINS: + g_print ("Missing plugins\n"); + if (verbose) { + gchar *tmp = + gst_structure_to_string (gst_discoverer_info_get_misc (info)); + g_print (" (%s)\n", tmp); + g_free (tmp); + } + break; + } + + if (verbose) { + if ((sinfo = gst_discoverer_info_get_stream_info (info))) { + g_print ("\nTopology:\n"); + print_topology (sinfo, 1); + g_print ("\nDuration:\n"); + print_duration (info, 1); + gst_discoverer_stream_info_unref (sinfo); + } + } + + g_print ("\n"); +} + +static void +print_dlna_info (GUPnPDLNAInformation *dlna, GError *err) +{ + GstDiscovererInfo *info; + + info = (GstDiscovererInfo *)gupnp_dlna_information_get_info (dlna); + + g_print ("\nURI: %s\n", gst_discoverer_info_get_uri (info)); + g_print ("Profile Name: %s\n", gupnp_dlna_information_get_name (dlna)); + g_print ("Profile MIME: %s\n", gupnp_dlna_information_get_mime (dlna)); + + print_gst_info ((GstDiscovererInfo *)info, err); + + g_print ("\n"); + return; +} + +static void +discoverer_done (GUPnPDLNADiscoverer *discover, + GUPnPDLNAInformation *dlna, + GError *err) +{ + print_dlna_info (dlna, err); + return; +} + +static void +discoverer_ready (GUPnPDLNADiscoverer *dc, GMainLoop *ml) +{ + g_main_loop_quit (ml); +} + +static void +process_file (GUPnPDLNADiscoverer *discover, const gchar *filename) +{ + GError *err = NULL; + GDir *dir; + gchar *uri, *path; + GUPnPDLNAInformation *dlna; + + if(!gst_uri_is_valid (filename)) { + if((dir = g_dir_open (filename, 0, NULL))) { + const gchar *entry; + + while ((entry = g_dir_read_name (dir))) { + gchar *path; + path = g_strconcat (filename, + G_DIR_SEPARATOR_S, + entry, + NULL); + process_file (discover, path); + g_free(path); + } + + g_dir_close (dir); + return; + } + + if (!g_path_is_absolute (filename)) { + gchar *cur_dir; + + cur_dir = g_get_current_dir (); + path = g_build_filename (cur_dir, filename, NULL); + g_free (cur_dir); + } else { + path = g_strdup (filename); + } + + uri = g_filename_to_uri (path, NULL, &err); + g_free (path); + path = NULL; + + if (err) { + g_warning ("Couldn't convert filename to URI: %s\n", + err->message); + g_error_free (err); + err = NULL; + return; + } + } else { + uri = g_strdup (filename); + } + + if (async == FALSE) { + dlna = gupnp_dlna_discoverer_discover_uri_sync (discover, + uri, + &err); + if (err) { + /* Report error to user, and free error */ + fprintf (stderr, + "Unable to read file: %s\n", + err->message); + g_error_free (err); + err = NULL; + } else { + print_dlna_info (dlna, err); + } + } else { + gupnp_dlna_discoverer_discover_uri (discover, uri); + } + + g_free (uri); +} + +static gboolean +async_idle_loop (PrivStruct * ps) +{ + gint i; + + for (i = 1; i < ps->argc; i++) + process_file (ps->dc, ps->argv[i]); + + return FALSE; +} + +/* Main */ +int +main (int argc, char **argv) +{ + gint i; + GUPnPDLNADiscoverer *discover; + gboolean relaxed_mode = FALSE; + gboolean extended_mode = FALSE; + GError *err = NULL; + + GOptionEntry options[] = { + {"timeout", 't', 0, G_OPTION_ARG_INT, &timeout, + "Specify timeout (in seconds, defaults to 10)", "T"}, + {"async", 'a', 0, G_OPTION_ARG_NONE, &async, + "Run asynchronously", NULL}, + {"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, + "Print lot more information", NULL}, + {"relaxed mode", 'r', 0, G_OPTION_ARG_NONE, &relaxed_mode, + "Enable Relaxed mode", NULL}, + {"extended mode", 'e', 0, G_OPTION_ARG_NONE, &extended_mode, + "Enable extended mode", NULL}, + {NULL} + }; + + GOptionContext *ctx; + + if (!g_thread_supported ()) + g_thread_init(NULL); + + ctx = g_option_context_new (" - program to extract DLNA and related metadata"); + g_option_context_add_main_entries (ctx, options, NULL); + g_option_context_add_group (ctx, gst_init_get_option_group ()); + + if (!g_option_context_parse (ctx, &argc, &argv, &err)) { + + g_print ("Error initializing: %s\n", err->message); + exit (1); + } + + g_option_context_free (ctx); + + if (argc < 2) { + g_print ("usage:%s <files>\n", argv[0]); + return -1; + } + + gst_init(&argc, &argv); + + discover = gupnp_dlna_discoverer_new ((GstClockTime) + (timeout * GST_SECOND), + relaxed_mode, + extended_mode); + + if (async == FALSE) { + for ( i = 1 ; i < argc ; i++ ) + process_file (discover, argv[i]); + } else { + PrivStruct *ps = g_new0 (PrivStruct, 1); + GMainLoop *ml = g_main_loop_new (NULL, FALSE); + + ps->dc = discover; + ps->argc = argc; + ps->argv = argv; + + g_idle_add ((GSourceFunc) async_idle_loop, ps); + + g_signal_connect (discover, "done", + (GCallback) discoverer_done, 0); + g_signal_connect (discover, "finished", + (GCallback) discoverer_ready, ml); + + gupnp_dlna_discoverer_start (discover); + + g_main_loop_run (ml); + + gupnp_dlna_discoverer_stop (discover); + + } + g_object_unref (discover); + return 0; +} diff --git a/tools/gupnp-dlna-ls-profiles.c b/tools/gupnp-dlna-ls-profiles.c new file mode 100644 index 0000000..567ef8d --- /dev/null +++ b/tools/gupnp-dlna-ls-profiles.c @@ -0,0 +1,141 @@ +/* GUPnPDLNA + * gupnp-dlna-ls-profiles.c + * + * Copyright (C) 2010 Nokia Corporation + * Copyright (C) 2010 Collabora Multimedia + * + * Authors: Parthasarathi Susarla <partha.susarla@collabora.co.uk> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdlib.h> +#include <string.h> + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> + +#include <libgupnp-dlna/gupnp-dlna-profile.h> +#include <libgupnp-dlna/gupnp-dlna-discoverer.h> + +#include <gst/pbutils/pbutils.h> + +static gboolean verbose = FALSE, relaxed = FALSE; + +static void print_caps (const GstCaps *caps) +{ + int i; + + for (i = 0; i < gst_caps_get_size (caps); i++) { + GstStructure *structure = gst_caps_get_structure (caps, i); + gchar *tmp = gst_structure_to_string (structure); + + g_print ("%s`- %s\n", i ? " " : "", tmp); + + g_free (tmp); + } +} + +static void +print_profile (GUPnPDLNAProfile *profile, gpointer unused) +{ + GstEncodingProfile *enc_profile; + const GList *tmp; + gchar *caps_str; + + enc_profile = gupnp_dlna_profile_get_encoding_profile (profile); + tmp = gst_encoding_container_profile_get_profiles + (GST_ENCODING_CONTAINER_PROFILE (enc_profile)); + + g_print ("%s %-30s%-35s", + gupnp_dlna_profile_get_extended (profile) ? "*" : " ", + gupnp_dlna_profile_get_name (profile), + gupnp_dlna_profile_get_mime (profile)); + + if (verbose) { + caps_str = gst_caps_to_string + (gst_encoding_profile_get_format (enc_profile)); + g_print ("\n`- container: %s\n", caps_str); + g_free (caps_str); + + while (tmp) { + print_caps (gst_encoding_profile_get_format + (GST_ENCODING_PROFILE (tmp->data))); + tmp = tmp->next; + } + } + + g_print ("\n"); + gst_encoding_profile_unref (enc_profile); +} + +int +main (int argc, char **argv) +{ + GError *err = NULL; + GList *profiles = NULL; + GUPnPDLNADiscoverer *discover; + + GOptionEntry options[] = { + {"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, + "Print (very) verbose output", NULL}, + {"relaxed", 'r', 0, G_OPTION_ARG_NONE, &relaxed, + "Read profiles in relaxed mode (only useful with -v)", NULL}, + {NULL} + }; + + GOptionContext *ctx; + + if (!g_thread_supported ()) + g_thread_init(NULL); + + ctx = g_option_context_new (" - program to list all the DLNA profiles supported by gupnp-dlna"); + g_option_context_add_main_entries (ctx, options, NULL); + g_option_context_add_group (ctx, gst_init_get_option_group ()); + + if (!g_option_context_parse (ctx, &argc, &argv, &err)) { + + g_print ("Error initializing: %s\n", err->message); + exit (1); + } + + g_option_context_free (ctx); + + gst_init (&argc, &argv); + + discover = gupnp_dlna_discoverer_new ((GstClockTime) GST_SECOND, + relaxed, + TRUE); + + profiles = (GList *) gupnp_dlna_discoverer_list_profiles (discover); + + if (!verbose) { + g_print (" %-30s%s\n", "Name", "MIME type"); + g_print ("---------------------------------------------------" + "---------------------\n"); + } + g_list_foreach (profiles, (GFunc) print_profile, NULL); + g_print ("\nProfiles with a '*' against their name are extended " + "(non-standard) profiles.\n\n"); + + g_object_unref (discover); + + return 0; +} |