[ekiga] Turn the gstreamer code into a plugin (bug #586264)
- From: Julien Puydt <jpuydt src gnome org>
- To: svn-commits-list gnome org
- Subject: [ekiga] Turn the gstreamer code into a plugin (bug #586264)
- Date: Fri, 19 Jun 2009 07:46:59 -0400 (EDT)
commit 6da726cda7691692174f55d08a19b09190848632
Author: Julien Puydt <jpuydt gnome org>
Date: Fri Jun 19 13:46:11 2009 +0200
Turn the gstreamer code into a plugin (bug #586264)
lib/engine/components/gstreamer/Makefile.am | 7 ++-
lib/engine/components/gstreamer/gst-main.cpp | 84 ++++++++++++++++----------
2 files changed, 57 insertions(+), 34 deletions(-)
---
diff --git a/lib/engine/components/gstreamer/Makefile.am b/lib/engine/components/gstreamer/Makefile.am
index f208bad..4c403f1 100644
--- a/lib/engine/components/gstreamer/Makefile.am
+++ b/lib/engine/components/gstreamer/Makefile.am
@@ -1,4 +1,5 @@
-noinst_LTLIBRARIES = libgmgstreamer.la
+plugindir = $(PLUGINDIR)
+plugin_LTLIBRARIES = libgmgstreamer.la
gstreamer_dir = $(top_srcdir)/lib/engine/components/gstreamer/
@@ -23,4 +24,6 @@ libgmgstreamer_la_SOURCES = \
$(gstreamer_dir)/gst-audiooutput.h \
$(gstreamer_dir)/gst-audiooutput.cpp
-libgmgstreamer_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS) $(GSTREAMER_LIBS) $(PTLIB_LIBS)
+libgmgstreamer_la_LDFLAGS = $(PLUGINS_LIBTOOL_FLAGS)
+libgmgstreamer_la_LIBADD = \
+ $(SIGC_LIBS) $(GSTREAMER_LIBS) $(PTLIB_LIBS)
diff --git a/lib/engine/components/gstreamer/gst-main.cpp b/lib/engine/components/gstreamer/gst-main.cpp
index 1c0d7b2..aee7faf 100644
--- a/lib/engine/components/gstreamer/gst-main.cpp
+++ b/lib/engine/components/gstreamer/gst-main.cpp
@@ -37,6 +37,8 @@
#include "gst-main.h"
+#include "kickstart.h"
+
#include "videoinput-core.h"
#include "audioinput-core.h"
#include "audiooutput-core.h"
@@ -60,40 +62,58 @@ public:
{ return "\tGStreamer support"; }
};
-
-bool
-gstreamer_init (Ekiga::ServiceCore& core,
- int* argc,
- char** argv[])
+struct GSTSpark: public Ekiga::Spark
{
- bool result = false;
- gmref_ptr<Ekiga::AudioInputCore> audioinput_core
- = core.get ("audioinput-core");
- gmref_ptr<Ekiga::AudioOutputCore> audiooutput_core
- = core.get ("audiooutput-core");
- gmref_ptr<Ekiga::VideoInputCore> videoinput_core
- = core.get ("videoinput-core");
- Ekiga::ServicePtr service = core.get ("gstreamer");
-
- if (audioinput_core && audiooutput_core && videoinput_core && !service) {
-
- if (gst_init_check (argc, argv, NULL)) {
-
- GST::VideoInputManager* video = new GST::VideoInputManager ();
- GST::AudioInputManager* audioin = new GST::AudioInputManager ();
- GST::AudioOutputManager* audioout = new GST::AudioOutputManager ();
- service = Ekiga::ServicePtr (new GStreamerService);
-
- core.add (service);
- audioinput_core->add_manager (*audioin);
- audiooutput_core->add_manager (*audioout);
- videoinput_core->add_manager (*video);
- result = true;
- } else {
-
- std::cout << "gst_init_check failed" << std::endl; // FIXME: remove
+ GSTSpark (): result(false)
+ {}
+
+ bool try_initialize_more (Ekiga::ServiceCore& core,
+ int* argc,
+ char** argv[])
+ {
+ gmref_ptr<Ekiga::AudioInputCore> audioinput_core
+ = core.get ("audioinput-core");
+ gmref_ptr<Ekiga::AudioOutputCore> audiooutput_core
+ = core.get ("audiooutput-core");
+ gmref_ptr<Ekiga::VideoInputCore> videoinput_core
+ = core.get ("videoinput-core");
+ Ekiga::ServicePtr service = core.get ("gstreamer");
+
+ if (audioinput_core && audiooutput_core && videoinput_core && !service) {
+
+ if (gst_init_check (argc, argv, NULL)) {
+
+ GST::VideoInputManager* video = new GST::VideoInputManager ();
+ GST::AudioInputManager* audioin = new GST::AudioInputManager ();
+ GST::AudioOutputManager* audioout = new GST::AudioOutputManager ();
+ service = Ekiga::ServicePtr (new GStreamerService);
+
+ core.add (service);
+ audioinput_core->add_manager (*audioin);
+ audiooutput_core->add_manager (*audioout);
+ videoinput_core->add_manager (*video);
+ result = true;
+ } else {
+
+ std::cout << "gst_init_check failed" << std::endl; // FIXME: remove
+ }
}
+
+ return result;
}
- return result;
+ Ekiga::Spark::state get_state () const
+ { return result?FULL:BLANK; }
+
+ const std::string get_name () const
+ { return "GSTREAMER"; }
+
+ bool result;
+};
+
+extern "C" void
+ekiga_plugin_init (Ekiga::KickStart& kickstart)
+{
+ gmref_ptr<Ekiga::Spark> spark(new GSTSpark);
+ kickstart.add_spark (spark);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]