[longomatch] Add a plugin to enable the uri capture



commit aa8428273659b0b4756e38bb913b16264335c333
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Jan 31 20:07:54 2013 +0100

    Add a plugin to enable the uri capture

 LongoMatch.Plugins/LongoMatch.Plugins.mdp |    1 +
 LongoMatch.Plugins/Makefile.am            |    4 +++
 LongoMatch.Plugins/URICaptureEnabler.cs   |   34 +++++++++++++++++++++++++++++
 configure.ac                              |    4 +++
 4 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.Plugins/LongoMatch.Plugins.mdp b/LongoMatch.Plugins/LongoMatch.Plugins.mdp
index 4708654..e3f7cc3 100644
--- a/LongoMatch.Plugins/LongoMatch.Plugins.mdp
+++ b/LongoMatch.Plugins/LongoMatch.Plugins.mdp
@@ -16,6 +16,7 @@
   <Contents>
     <File subtype="Code" buildaction="Compile" name="Assembly.cs" />
     <File subtype="Code" buildaction="Compile" name="CSVExporter.cs" />
+    <File subtype="Code" buildaction="Compile" name="URICaptureEnabler.cs" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
diff --git a/LongoMatch.Plugins/Makefile.am b/LongoMatch.Plugins/Makefile.am
index 6a4ed87..67224da 100644
--- a/LongoMatch.Plugins/Makefile.am
+++ b/LongoMatch.Plugins/Makefile.am
@@ -8,6 +8,10 @@ SOURCES = \
 	Assembly.cs \
 	CSVExporter.cs
 
+if ENABLE_URI_CAPTURE
+SOURCES += URICaptureEnabler.cs
+endif
+
 RESOURCES =
 
 include $(top_srcdir)/build/build.mk
diff --git a/LongoMatch.Plugins/URICaptureEnabler.cs b/LongoMatch.Plugins/URICaptureEnabler.cs
new file mode 100644
index 0000000..1308c7c
--- /dev/null
+++ b/LongoMatch.Plugins/URICaptureEnabler.cs
@@ -0,0 +1,34 @@
+// 
+//  Copyright (C) 2011 Andoni Morales Alastruey
+// 
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+// 
+//  This program 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 General Public License for more details.
+//  
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+// 
+using System;
+using Mono.Addins;
+
+using LongoMatch;
+using LongoMatch.Addins.ExtensionPoints;
+
+
+[Extension]
+public class URICaptureEnabler: IConfigModifier
+{
+	public void ModifyConfig() {
+		LongoMatch.Config.useUriCapture = true;
+		Log.Information("Loading URICaptureEnabler addin");
+		Log.Information("'useUriCapture' modified to " + LongoMatch.Config.useUriCapture);
+	}
+}
+
diff --git a/configure.ac b/configure.ac
index 1493959..d6057a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,6 +111,10 @@ AC_MSG_RESULT($ostype)
 
 AM_CONDITIONAL(ENABLE_TESTS, test x = y)
 
+AC_ARG_ENABLE([uri-capture],
+              AS_HELP_STRING([--enable-uri-capture], [Enables uri capture for IP cameras]))
+AM_CONDITIONAL(ENABLE_URI_CAPTURE, test x$enable_uri_capture == xyes)
+
 dnl package checks, per config
 
 AC_CONFIG_FILES([env], [chmod +x env])



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