[PATCH 1/7] grl-inspect: Add grl-inspect utility



This utility is very similar to gst-inspect: it allows to inspect available
sources and their features.
---
 configure.ac                      |    1 +
 tools/Makefile.am                 |    4 +-
 tools/grilo-inspect/Makefile.am   |   30 +++++++++++++++++++++++
 tools/grilo-inspect/grl-inspect.c |   48 +++++++++++++++++++++++++++++++++++++
 4 files changed, 81 insertions(+), 2 deletions(-)
 create mode 100644 tools/grilo-inspect/Makefile.am
 create mode 100644 tools/grilo-inspect/grl-inspect.c

diff --git a/configure.ac b/configure.ac
index b28fca8..4080180 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,6 +182,7 @@ AC_CONFIG_FILES([
   src/tests/Makefile
   tools/Makefile
   tools/grilo-test-ui/Makefile
+  tools/grilo-inspect/Makefile
   tools/vala/Makefile
   bindings/Makefile
   bindings/vala/Makefile
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 9a9a528..f8a7842 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -5,7 +5,7 @@
 #
 # Copyright (C) 2010 Igalia S.L. All rights reserved.
 
-SUBDIRS =
+SUBDIRS = grilo-inspect
 
 if HAVE_GTK
 SUBDIRS += grilo-test-ui
@@ -16,7 +16,7 @@ SUBDIRS += vala
 endif
 
 
-DIST_SUBDIRS = grilo-test-ui vala
+DIST_SUBDIRS = grilo-test-ui grilo-inspect vala
 
 MAINTAINERCLEANFILES = \
         *.in \
diff --git a/tools/grilo-inspect/Makefile.am b/tools/grilo-inspect/Makefile.am
new file mode 100644
index 0000000..a2cb011
--- /dev/null
+++ b/tools/grilo-inspect/Makefile.am
@@ -0,0 +1,30 @@
+#
+# Makefile.am
+#
+# Author: Juan A. Suarez Romero <jasuarez igalia com>
+#
+# Copyright (C) 2010 Igalia S.L.
+
+INCLUDES = $(DEPS_CFLAGS)
+
+bin_PROGRAMS = grl-inspect
+
+grl_inspect_SOURCES =	\
+	grl-inspect.c
+
+grl_inspect_CFLAGS =		\
+	-DPREFIX=$(prefix)	\
+	-I$(top_srcdir)/src	\
+	-I$(top_srcdir)/src/data
+
+grl_inspect_LDADD =	\
+	-ldl -lpthread	\
+	$(DEPS_LIBS)	\
+	$(GTK_LIBS)	\
+	$(top_builddir)/src/lib GRL_NAME@.la
+
+MAINTAINERCLEANFILES =	\
+	*.in		\
+	*~
+
+DISTCLEANFILES = $(MAINTAINERCLEANFILES)
diff --git a/tools/grilo-inspect/grl-inspect.c b/tools/grilo-inspect/grl-inspect.c
new file mode 100644
index 0000000..9cd6d25
--- /dev/null
+++ b/tools/grilo-inspect/grl-inspect.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * Contact: Iago Toral Quiroga <itoral igalia com>
+ *
+ * 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; version 2.1 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <grilo.h>
+#include <glib.h>
+
+int
+main (int argc, char *argv[])
+{
+  GrlMediaPlugin **plugin;
+  GrlMediaPlugin **plugins;
+  GrlPluginRegistry *registry;
+
+  grl_init (&argc, &argv);
+  grl_log_init ("*:-");
+
+  registry = grl_plugin_registry_get_instance ();
+
+  grl_plugin_registry_load_all (registry);
+
+  plugins = grl_plugin_registry_get_sources (registry, FALSE);
+  for (plugin = plugins; *plugin; plugin++) {
+    g_print ("%s\n", grl_media_plugin_get_id (*plugin));
+  }
+
+  g_free (plugins);
+
+  return 0;
+}
-- 
1.7.0.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]