[farsight2/master] Add a new fs-private.h header, move the debug category to there and make a function to init the debug category so it can be initialized by the fs-plugin so that unit tests can work without a Conference
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:20:46 PST 2008
---
docs/libs/Makefile.am | 2 +-
gst-libs/gst/farsight/fs-base-conference.c | 11 +++++-
gst-libs/gst/farsight/fs-codec.c | 2 +-
gst-libs/gst/farsight/fs-conference-iface.h | 2 -
gst-libs/gst/farsight/fs-plugin.c | 3 ++
gst-libs/gst/farsight/fs-private.h | 40 +++++++++++++++++++++++++
gst-libs/gst/farsight/fs-session.c | 2 +
gst-libs/gst/farsight/fs-stream-transmitter.c | 1 +
gst-libs/gst/farsight/fs-stream.c | 1 +
9 files changed, 58 insertions(+), 6 deletions(-)
create mode 100644 gst-libs/gst/farsight/fs-private.h
diff --git a/docs/libs/Makefile.am b/docs/libs/Makefile.am
index 9cf08b7..0816f27 100644
--- a/docs/libs/Makefile.am
+++ b/docs/libs/Makefile.am
@@ -49,7 +49,7 @@ SCANOBJ_DEPS = \
$(top_builddir)/gst-libs/gst/farsight/libgstfarsight- at GST_MAJORMINOR@.la
# Header files to ignore when scanning.
-IGNORE_HFILES = fs-marshal.h fs-enum-types.h
+IGNORE_HFILES = fs-marshal.h fs-enum-types.h fs-private.h
# Images to copy into HTML directory.
HTML_IMAGES =
diff --git a/gst-libs/gst/farsight/fs-base-conference.c b/gst-libs/gst/farsight/fs-base-conference.c
index c049c16..d9f1e6b 100644
--- a/gst-libs/gst/farsight/fs-base-conference.c
+++ b/gst-libs/gst/farsight/fs-base-conference.c
@@ -83,11 +83,18 @@ void fs_base_conference_error (GObject *signal_src, GObject *error_src,
gint error_no, gchar *error_msg,
gchar *debug_msg, FsBaseConference *conf);
+void
+fs_base_conference_init_debug (void)
+{
+ if (!fs_base_conference_debug)
+ GST_DEBUG_CATEGORY_INIT (fs_base_conference_debug, "fsbaseconference", 0,
+ "farsight base conference library");
+}
+
static void
fs_base_conference_base_init (gpointer g_class)
{
- GST_DEBUG_CATEGORY_INIT (fs_base_conference_debug, "fsbaseconference", 0,
- "farsight base conference library");
+ fs_base_conference_init_debug ();
}
static void
diff --git a/gst-libs/gst/farsight/fs-codec.c b/gst-libs/gst/farsight/fs-codec.c
index 70af6be..a822dd2 100644
--- a/gst-libs/gst/farsight/fs-codec.c
+++ b/gst-libs/gst/farsight/fs-codec.c
@@ -27,7 +27,7 @@
#include "fs-codec.h"
-#include "fs-conference-iface.h"
+#include "fs-private.h"
#include <string.h>
diff --git a/gst-libs/gst/farsight/fs-conference-iface.h b/gst-libs/gst/farsight/fs-conference-iface.h
index 7ed692d..38fd53d 100644
--- a/gst-libs/gst/farsight/fs-conference-iface.h
+++ b/gst-libs/gst/farsight/fs-conference-iface.h
@@ -116,8 +116,6 @@ typedef enum {
GQuark fs_error_quark (void);
-GST_DEBUG_CATEGORY_EXTERN (fs_base_conference_debug);
-
/* virtual class function wrappers */
FsSession *fs_conference_new_session (FsConference *conference,
FsMediaType media_type,
diff --git a/gst-libs/gst/farsight/fs-plugin.c b/gst-libs/gst/farsight/fs-plugin.c
index f56f32e..de9796f 100644
--- a/gst-libs/gst/farsight/fs-plugin.c
+++ b/gst-libs/gst/farsight/fs-plugin.c
@@ -32,6 +32,7 @@
#include "fs-plugin.h"
#include "fs-conference-iface.h"
+#include "fs-private.h"
#include <string.h>
@@ -279,6 +280,8 @@ fs_plugin_create_valist (const gchar *name, const gchar *type_suffix,
GObject *object;
FsPlugin *plugin;
+ fs_base_conference_init_debug ();
+
if (name == NULL) {
g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
"You need to pass a name");
diff --git a/gst-libs/gst/farsight/fs-private.h b/gst-libs/gst/farsight/fs-private.h
new file mode 100644
index 0000000..7fced68
--- /dev/null
+++ b/gst-libs/gst/farsight/fs-private.h
@@ -0,0 +1,40 @@
+/*
+ * Farsight2 - Private declarations
+ *
+ * Copyright 2008 Collabora Ltd.
+ * @author: Olivier Crete <olivier.crete at collabora.co.uk>
+ * Copyright 2008 Nokia Corp.
+ *
+ * fs-conference-iface.h - Header file for gstreamer interface to be
+ * implemented by farsight conference elements
+ *
+ * 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.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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __FS_PRIVATE_H__
+#define __FS_PRIVATE_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+void fs_base_conference_init_debug (void);
+
+GST_DEBUG_CATEGORY_EXTERN (fs_base_conference_debug);
+
+G_END_DECLS
+
+#endif /* __FS_PRIVATE_H__ */
+
diff --git a/gst-libs/gst/farsight/fs-session.c b/gst-libs/gst/farsight/fs-session.c
index 0d82479..81d3e49 100644
--- a/gst-libs/gst/farsight/fs-session.c
+++ b/gst-libs/gst/farsight/fs-session.c
@@ -47,6 +47,8 @@
#include "fs-codec.h"
#include "fs-marshal.h"
#include "fs-enum-types.h"
+#include "fs-private.h"
+
#include <gst/gst.h>
#define GST_CAT_DEFAULT fs_base_conference_debug
diff --git a/gst-libs/gst/farsight/fs-stream-transmitter.c b/gst-libs/gst/farsight/fs-stream-transmitter.c
index 7611f2c..0b8a701 100644
--- a/gst-libs/gst/farsight/fs-stream-transmitter.c
+++ b/gst-libs/gst/farsight/fs-stream-transmitter.c
@@ -42,6 +42,7 @@
#include "fs-stream-transmitter.h"
#include "fs-conference-iface.h"
+#include "fs-private.h"
#include <gst/gst.h>
diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c
index 3163e49..d147d92 100644
--- a/gst-libs/gst/farsight/fs-stream.c
+++ b/gst-libs/gst/farsight/fs-stream.c
@@ -47,6 +47,7 @@
#include "fs-stream-transmitter.h"
#include "fs-conference-iface.h"
#include "fs-enum-types.h"
+#include "fs-private.h"
#include <gst/gst.h>
--
1.5.6.5
More information about the farsight-commits
mailing list