[gstreamermm/makolny/remove-plugins-interface] Remove plugins wrappers



commit e590d4894331647c169323ae25f2118566c27b5c
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Tue Jul 12 21:48:39 2016 +0200

    Remove plugins wrappers
    
    https://bugzilla.gnome.org/show_bug.cgi?id=755395

 build/gstreamermm.m4                         |   48 --------------
 configure.ac                                 |   89 --------------------------
 examples/all_media_player/main.cc            |    6 +-
 examples/audio_video_muxer/main.cc           |   12 ++--
 examples/hello_world/main.cc                 |    7 +-
 examples/media_player_gtkmm/main.cc          |    2 +-
 examples/media_player_gtkmm/player_window.cc |   31 +++++++--
 examples/media_player_gtkmm/player_window.h  |    6 +-
 examples/ogg_player_gtkmm/main.cc            |   20 ++----
 examples/ogg_player_gtkmm/player_window.cc   |    6 +-
 examples/ogg_player_gtkmm/player_window.h    |    5 +-
 examples/ogg_rewriter/main.cc                |    8 +-
 examples/typefind/main.cc                    |   63 +++++++++++++++++--
 gstreamer/gstreamermm.h                      |   35 ----------
 gstreamer/src/Makefile.am                    |   28 --------
 gstreamer/src/filelist.am                    |   16 +----
 16 files changed, 116 insertions(+), 266 deletions(-)
---
diff --git a/build/gstreamermm.m4 b/build/gstreamermm.m4
index 9a28084..ec97ad7 100644
--- a/build/gstreamermm.m4
+++ b/build/gstreamermm.m4
@@ -53,51 +53,3 @@ AC_DEFUN([ADD_MODULE_CONDITIONALLY],
   ])
 ])
 
-## Arguments:
-##  * $1 - output file
-##  * $2 - plugins list
-## Generates list of plug-ins. If USE_MAINTAINER_MODE defined, macro also
-## checks for the existence of the plug-ins. Note that this check doesn't
-## work when cross-compiling.  That isn't much of a problem though since
-## it only applies in maintainer-mode.
-AC_DEFUN([GENERATE_PLUGINS_LIST_FILE],
-[
-  # clear plugins file once per file
-  m4_ifndef([$1], [
-    printf "plugins_hg = \n" > $1
-    m4_define([$1], [yes])
-  ])
-
-  printf "plugins_hg += " >> $1
-
-  AS_IF([test "x$USE_MAINTAINER_MODE" != xno],
-  [
-    gstmm_toolsdir=`$PKG_CONFIG --variable=toolsdir gstreamer-1.0 2>&AS_MESSAGE_LOG_FD`
-    AC_PATH_PROGS([GST_INSPECT], [gst-inspect-1.0],,
-                  [$gstmm_toolsdir$PATH_SEPARATOR$PATH])
-
-    AC_MSG_CHECKING([the existance of required plug-ins.])
-  ])
-  for gstmm_plugin_def in $2
-  do
-    gstmm_hg_name=`[expr "X$gstmm_plugin_def" : 'X\(.*\)|.*|.*$' 2>&]AS_MESSAGE_LOG_FD`
-    printf "$gstmm_hg_name.hg " >> $1
-    AS_IF([test "x$USE_MAINTAINER_MODE" != xno],
-    [
-      # Extract plugin name and run gst-inspect to check whether the plugin
-      # is installed on the build system.
-      gstmm_plugin_name=`[expr "X$gstmm_plugin_def" : 'X.*|\(.*\)|.*$' 2>&]AS_MESSAGE_LOG_FD`
-      AS_IF([$GST_INSPECT "$gstmm_plugin_name" >/dev/null 2>&AS_MESSAGE_LOG_FD],,
-            [AC_MSG_FAILURE([[The gstreamer plug-in '$gstmm_plugin_name' does not exist.
-If you built gst-plugins-base from source code then you might need to
-install the appropriate -dev or -devel packages or enable experimental
-plugins before rebuilding gst-plugins-base.]])])
-    ])
-  done
-  AS_IF([test "x$USE_MAINTAINER_MODE" != xno],
-  [
-    AC_MSG_RESULT([All required plug-ins found.])
-  ])
-  printf "\n" >> $1
-])
-
diff --git a/configure.ac b/configure.ac
index e897cf7..65bcdff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,95 +119,6 @@ if test "x$enable_unittests" = xyes; then
 fi
 
 #########################################################################
-#  Plug-in processing
-#########################################################################
-
-# To add a plugin, add the plugin definition, in the form of
-# "hgfilebasename|plugin|CppClassName" to the space-separated list of
-# definitions below.  (Where "hgfilebasename" is the basename of the .hg file,
-# "plugin" is the plugin name as recognized by gst-inspect and "CppClassName"
-# is the desired name of the C++ class.)
-#
-# Also add the target .hg file name to the plugins_hg variable in the
-# gstreamer/src/fileslist.am.  (That must be the same as "CppClassName" - all
-# in lowercase with a .hg extension).
-AC_SUBST([GSTREAMERMM_CORE_PLUGIN_DEFS], ["\
-capsfilter|capsfilter|CapsFilter \
-concat|concat|Concat \
-downloadbuffer|downloadbuffer|DownloadBuffer \
-fakesink|fakesink|FakeSink \
-fakesrc|fakesrc|FakeSrc \
-fdsink|fdsink|FdSink \
-fdsrc|fdsrc|FdSrc \
-filesink|filesink|FileSink \
-filesrc|filesrc|FileSrc \
-funnel|funnel|Funnel \
-identity|identity|Identity \
-inputselector|input-selector|InputSelector \
-multiqueue|multiqueue|MultiQueue \
-outputselector|output-selector|OutputSelector \
-streamiddemux|streamiddemux|StreamidDemux \
-queue|queue|Queue \
-queue2|queue2|Queue2 \
-tee|tee|Tee \
-typefindelement|typefind|TypeFindElement \
-valve|valve|Valve
-"])
-#audioresample|audioresample|AudioResample 
-AC_SUBST([GSTREAMERMM_BASE_PLUGIN_DEFS], ["\
-adder|adder|Adder \
-alsasink|alsasink|AlsaSink \
-alsasrc|alsasrc|AlsaSrc \
-appsink|appsink|AppSink \
-appsrc|appsrc|AppSrc \
-audioconvert|audioconvert|AudioConvert \
-audiorate|audiorate|AudioRate \
-audiotestsrc|audiotestsrc|AudioTestSrc \
-cdparanoiasrc|cdparanoiasrc|CdParanoiaSrc \
-clockoverlay|clockoverlay|ClockOverlay \
-decodebin|decodebin|DecodeBin \
-encodebin|encodebin|EncodeBin \
-giosink|giosink|GioSink \
-giosrc|giosrc|GioSrc \
-giostreamsink|giostreamsink|GioStreamSink \
-giostreamsrc|giostreamsrc|GioStreamSrc \
-multifdsink|multifdsink|MultiFdSink \
-multisocketsink|multisocketsink|MultiSocketSink \
-oggdemux|oggdemux|OggDemux \
-oggmux|oggmux|OggMux \
-playbin|playbin|PlayBin \
-playsink|playsink|PlaySink \
-socketsrc|socketsrc|SocketSrc \
-streamsynchronizer|streamsynchronizer|StreamSynchronizer \
-subtitleoverlay|subtitleoverlay|SubtitleOverlay \
-tcpclientsink|tcpclientsink|TCPClientSink \
-tcpclientsrc|tcpclientsrc|TCPClientSrc \
-tcpserversink|tcpserversink|TCPServerSink \
-tcpserversrc|tcpserversrc|TCPServerSrc \
-textoverlay|textoverlay|TextOverlay \
-textrender|textrender|TextRender \
-theoradec|theoradec|TheoraDec \
-theoraenc|theoraenc|TheoraEnc \
-theoraparse|theoraparse|TheoraParse \
-timeoverlay|timeoverlay|TimeOverlay \
-uridecodebin|uridecodebin|UriDecodeBin \
-videoconvert|videoconvert|VideoConvert \
-videorate|videorate|VideoRate \
-videoscale|videoscale|VideoScale \
-videotestsrc|videotestsrc|VideoTestSrc \
-volume|volume|Volume \
-vorbisdec|vorbisdec|VorbisDec \
-vorbisenc|vorbisenc|VorbisEnc \
-vorbisparse|vorbisparse|VorbisParse \
-vorbistag|vorbistag|VorbisTag \
-ximagesink|ximagesink|XImageSink \
-xvimagesink|xvimagesink|XvImageSink
-"])
-
-GENERATE_PLUGINS_LIST_FILE([gstreamer/src/plugin_filelist.am], $GSTREAMERMM_CORE_PLUGIN_DEFS)
-GENERATE_PLUGINS_LIST_FILE([gstreamer/src/plugin_filelist.am], $GSTREAMERMM_BASE_PLUGIN_DEFS)
-
-#########################################################################
 
 AC_LANG([C++])
 MM_ARG_ENABLE_WARNINGS([GSTREAMERMM_WXXFLAGS],
diff --git a/examples/all_media_player/main.cc b/examples/all_media_player/main.cc
index 6f0b95d..1a5c60b 100644
--- a/examples/all_media_player/main.cc
+++ b/examples/all_media_player/main.cc
@@ -18,7 +18,7 @@ class AllMediaPlayer
 private:
   RefPtr<Glib::MainLoop> main_loop;
   RefPtr<Pipeline> pipeline;
-  RefPtr<FileSrc> source;
+  RefPtr<Element> source;
   RefPtr<Element> decoder;
 
   bool on_bus_message(const RefPtr<Bus>&, const RefPtr<Message>& message);
@@ -26,7 +26,7 @@ private:
 
   void init()
   {
-    source = FileSrc::create();
+    source = ElementFactory::create_element("filesrc");
     decoder = ElementFactory::create_element("decodebin");
 
     if (!decoder || !source)
@@ -51,7 +51,7 @@ public:
   void play_until_eos(const std::string& filename)
   {
     init();
-    source->property_location() = filename;
+    source->set_property("location", filename);
     pipeline->set_state(STATE_PLAYING);
     main_loop->run();
     pipeline->set_state(STATE_NULL);
diff --git a/examples/audio_video_muxer/main.cc b/examples/audio_video_muxer/main.cc
index 4c6e912..adb4dbc 100644
--- a/examples/audio_video_muxer/main.cc
+++ b/examples/audio_video_muxer/main.cc
@@ -68,8 +68,8 @@ int main(int argc, char** argv)
   RefPtr<Bus> bus = pipeline->get_bus();
   bus->add_watch(sigc::ptr_fun(&on_bus_message));
 
-  RefPtr<FileSrc> video_source = FileSrc::create(),
-    audio_source = FileSrc::create();
+  RefPtr<Element> video_source = ElementFactory::create_element("filesrc"),
+    audio_source = ElementFactory::create_element("filesrc");
 
   RefPtr<Element> ogg_demuxer = ElementFactory::create_element("oggdemux");
   audio_parser = ElementFactory::create_element("mad");
@@ -78,7 +78,7 @@ int main(int argc, char** argv)
     videosink = ElementFactory::create_element("autovideosink");
 
   RefPtr<Element> muxer = ElementFactory::create_element("matroskamux");
-  RefPtr<FileSink> filesink = FileSink::create();
+  RefPtr<Element> filesink = ElementFactory::create_element("filesink");
 
   video_parser = ElementFactory::create_element("theoraparse");
 
@@ -88,9 +88,9 @@ int main(int argc, char** argv)
     return 1;
   }
 
-  video_source->property_location() = argv[1];
-  audio_source->property_location() = argv[2];
-  filesink->property_location() = argv[3];
+  video_source->set_property("location", argv[1]);
+  audio_source->set_property("location", argv[2]);
+  filesink->set_property("location", argv[3]);
 
   pipeline->add(video_source)->
             add(ogg_demuxer)->
diff --git a/examples/hello_world/main.cc b/examples/hello_world/main.cc
index eae4b9f..d7eec0d 100644
--- a/examples/hello_world/main.cc
+++ b/examples/hello_world/main.cc
@@ -20,7 +20,6 @@
 #include <glibmm.h>
 #include <iostream>
 #include <stdlib.h>
-#include <gstreamermm/playbin.h>
 
 namespace
 {
@@ -75,11 +74,11 @@ int main(int argc, char** argv)
   }
 
   // Create a playbin2 element.
-  Glib::RefPtr<Gst::PlayBin> playbin = Gst::PlayBin::create();
+  Glib::RefPtr<Gst::Element> playbin = Gst::ElementFactory::create_element("playbin");
 
   if(!playbin)
   {
-    std::cerr << "The playbin2 element could not be created." << std::endl;
+    std::cerr << "The playbin element could not be created." << std::endl;
     return EXIT_FAILURE;
   }
 
@@ -92,7 +91,7 @@ int main(int argc, char** argv)
     uri = Glib::filename_to_uri(argv[1]);
 
   // Set the playbyin2's uri property.
-  playbin->property_uri() = uri;
+  playbin->set_property("uri", uri);
 
   // Create the main loop.
   mainloop = Glib::MainLoop::create();
diff --git a/examples/media_player_gtkmm/main.cc b/examples/media_player_gtkmm/main.cc
index 92134c2..3b8fd4f 100644
--- a/examples/media_player_gtkmm/main.cc
+++ b/examples/media_player_gtkmm/main.cc
@@ -30,7 +30,7 @@ int main (int argc, char **argv)
 
   // playbin plays any media type, choosing an appropriate set of elements
   // and linking them together.
-  Glib::RefPtr<Gst::PlayBin> playbin = Gst::PlayBin::create("playbin");
+  Glib::RefPtr<Gst::Element> playbin = Gst::ElementFactory::create_element("playbin", "playbin");
 
   if(!playbin)
   {
diff --git a/examples/media_player_gtkmm/player_window.cc b/examples/media_player_gtkmm/player_window.cc
index bf29dfd..ee79298 100644
--- a/examples/media_player_gtkmm/player_window.cc
+++ b/examples/media_player_gtkmm/player_window.cc
@@ -19,7 +19,6 @@
 #include "player_window.h"
 
 #include <gstreamermm.h>
-#include <gstreamermm/xvimagesink.h>
 
 #if defined (GDK_WINDOWING_X11)
 #include <gdk/gdkx.h>
@@ -30,7 +29,20 @@
 #include <iostream>
 #include <iomanip>
 
-PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::PlayBin>& playbin)
+
+static const Glib::SignalProxyInfo PlayBin_signal_video_changed_info =
+{
+  "video-changed",
+  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
+  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
+};
+
+Glib::SignalProxy0< void > signal_video_changed(const Glib::RefPtr<Gst::Element>& playbin)
+{
+  return Glib::SignalProxy0< void >(playbin.operator->(), &PlayBin_signal_video_changed_info);
+}
+
+PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::Element>& playbin)
 : m_vbox(false, 6),
   m_progress_label("000:00:00.000000000 / 000:00:00.000000000"),
   m_play_button("Play"),
@@ -102,8 +114,9 @@ PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::PlayBin>& playbin)
   m_forward_button.set_sensitive(false);
 
   m_playbin = playbin;
-  m_playbin->property_video_sink() = Gst::XvImageSink::create();
-  m_playbin->signal_video_changed().connect(
+  m_playbin->set_property("video-sink", Gst::ElementFactory::create_element("xvimagesink"));
+
+  signal_video_changed(m_playbin).connect(
     sigc::mem_fun(*this, &PlayerWindow::on_video_changed) );
 
   show_all_children();
@@ -186,7 +199,7 @@ bool PlayerWindow::on_bus_message(const Glib::RefPtr<Gst::Bus>& /* bus */,
       Glib::RefPtr<Gst::MessageError> msg_error = Glib::RefPtr<Gst::MessageError>::cast_static(message);
       if(msg_error)
       {
-        Glib::Error err = msg_error->parse();
+        Glib::Error err = msg_error->parse_error();
         std::cerr << "Error: " << err.what() << std::endl;
       }
       else
@@ -206,7 +219,11 @@ bool PlayerWindow::on_bus_message(const Glib::RefPtr<Gst::Bus>& /* bus */,
 
 void PlayerWindow::on_video_changed()
 {
-  Glib::RefPtr<Gst::Pad> pad = m_playbin->get_video_pad(0);
+  // TODO wrap it
+  GstPad* result;
+  g_signal_emit_by_name(m_playbin->gobj(), "get-video-pad", 0, &result, static_cast<void*>(0));
+  Glib::RefPtr<Gst::Pad> pad = Glib::wrap(result);
+
   if(pad)
   {
     // Add a buffer probe to the video sink pad which will be removed after
@@ -385,7 +402,7 @@ void PlayerWindow::on_button_open()
     working_dir = chooser.get_current_folder();
 
     // Set uri property on the playbin.
-    m_playbin->property_uri() = chooser.get_uri();
+    m_playbin->set_property("uri", chooser.get_uri());
 
     // Resize m_video_area and window to minimum when opening a file
     m_video_area.set_size_request(0, 0);
diff --git a/examples/media_player_gtkmm/player_window.h b/examples/media_player_gtkmm/player_window.h
index d029ebc..772bdd3 100644
--- a/examples/media_player_gtkmm/player_window.h
+++ b/examples/media_player_gtkmm/player_window.h
@@ -20,12 +20,12 @@
 #define PLAYER_WINDOW_H_
 
 #include <gtkmm.h>
-#include <gstreamermm/playbin.h>
+#include <gstreamermm.h>
 
 class PlayerWindow : public Gtk::Window
 {
 public:
-  PlayerWindow(const Glib::RefPtr<Gst::PlayBin>& playbin);
+  PlayerWindow(const Glib::RefPtr<Gst::Element>& playbin);
   virtual ~PlayerWindow();
 
 protected:
@@ -61,7 +61,7 @@ protected:
   Gtk::Button m_forward_button;
   Gtk::Button m_open_button;
 
-  Glib::RefPtr<Gst::PlayBin> m_playbin;
+  Glib::RefPtr<Gst::Element> m_playbin;
   sigc::connection m_timeout_connection;
   guint m_watch_id;
   gint64 m_duration;
diff --git a/examples/ogg_player_gtkmm/main.cc b/examples/ogg_player_gtkmm/main.cc
index 90a91fa..8fc7714 100644
--- a/examples/ogg_player_gtkmm/main.cc
+++ b/examples/ogg_player_gtkmm/main.cc
@@ -21,19 +21,13 @@
 #include <gstreamermm/element.h>
 #include <gstreamermm/pad.h>
 #include <gstreamermm/pipeline.h>
-
-// Plug-ins
-#include <gstreamermm/alsasink.h>
-#include <gstreamermm/audioconvert.h>
-#include <gstreamermm/filesrc.h>
-#include <gstreamermm/oggdemux.h>
-#include <gstreamermm/vorbisdec.h>
+#include <gstreamermm/elementfactory.h>
 
 #include <iostream>
 #include "player_window.h"
 
 Glib::RefPtr<Gst::Pipeline> pipeline;
-Glib::RefPtr<Gst::VorbisDec> decoder;
+Glib::RefPtr<Gst::Element> decoder;
 
 void on_parser_pad_added(const Glib::RefPtr<Gst::Pad>& newPad)
 {
@@ -58,7 +52,7 @@ int main(int argc, char** argv)
 
   // Create the elements
   // Reads file from disk
-  Glib::RefPtr<Gst::FileSrc> source = Gst::FileSrc::create();
+  Glib::RefPtr<Gst::Element> source = Gst::ElementFactory::create_element("filesrc");
   if(!source)
   {
     std::cerr << "filesrc element could not be created" << std::endl;
@@ -67,7 +61,7 @@ int main(int argc, char** argv)
 
   // Parses the ogg streams into elementary streams (note that an ogg file may
   // contain a video stream too)
-  Glib::RefPtr<Gst::OggDemux> parser = Gst::OggDemux::create();
+  Glib::RefPtr<Gst::Element> parser = Gst::ElementFactory::create_element("oggdemux");
   if(!parser)
   {
     std::cerr << "oggdemux element could not be created" << std::endl;
@@ -75,7 +69,7 @@ int main(int argc, char** argv)
   }
 
   // Decodes a vorbis stream
-  decoder = Gst::VorbisDec::create();
+  decoder = Gst::ElementFactory::create_element("vorbisdec");
   if(!decoder)
   {
     std::cerr << "vorbisdec element could not be created" << std::endl;
@@ -83,7 +77,7 @@ int main(int argc, char** argv)
   }
 
   // Converts audio to a format which can be used by the next element
-  Glib::RefPtr<Gst::AudioConvert> conv = Gst::AudioConvert::create();
+  Glib::RefPtr<Gst::Element> conv = Gst::ElementFactory::create_element("audioconvert");
   if(!conv)
   {
     std::cerr << "audioconvert element could not be created" << std::endl;
@@ -91,7 +85,7 @@ int main(int argc, char** argv)
   }
 
   // Outputs sound to an ALSA audio device
-  Glib::RefPtr<Gst::AlsaSink> sink = Gst::AlsaSink::create();
+  Glib::RefPtr<Gst::Element> sink = Gst::ElementFactory::create_element("alsasink");
   if(!sink)
   {
     std::cerr << "sink element could not be created" << std::endl;
diff --git a/examples/ogg_player_gtkmm/player_window.cc b/examples/ogg_player_gtkmm/player_window.cc
index d413042..91ca4e6 100644
--- a/examples/ogg_player_gtkmm/player_window.cc
+++ b/examples/ogg_player_gtkmm/player_window.cc
@@ -30,7 +30,7 @@
 #include <iomanip>
 #include "player_window.h"
 
-PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::FileSrc>& source_element,
+PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::Element>& source_element,
   const Glib::RefPtr<Gst::Pipeline>& main_pipeline)
 : m_vbox(false, 5),
   m_progress_label("000:00:00.000000000 / 000:00:00.000000000"),
@@ -115,7 +115,7 @@ bool PlayerWindow::on_bus_message(const Glib::RefPtr<Gst::Bus>& /* bus */, const
       if(error_message)
       {
         Glib::Error err;
-        err = error_message->parse();
+        err = error_message->parse_error();
         std::cerr << "Error: " << err.what() << std::endl;
       }
       else
@@ -290,7 +290,7 @@ void PlayerWindow::on_button_open()
 
     // Set uri on the file source. 
     const std::string uri = chooser.get_uri();
-    m_source_element->set_uri(uri);
+    m_source_element->set_property("uri", uri);
     set_title(uri);
 
     m_play_button.set_sensitive();
diff --git a/examples/ogg_player_gtkmm/player_window.h b/examples/ogg_player_gtkmm/player_window.h
index 740f9e1..71fff4d 100644
--- a/examples/ogg_player_gtkmm/player_window.h
+++ b/examples/ogg_player_gtkmm/player_window.h
@@ -27,12 +27,11 @@
 #include <gtkmm/scale.h>
 #include <gstreamermm/element.h>
 #include <gstreamermm/pipeline.h>
-#include <gstreamermm/filesrc.h>
 
 class PlayerWindow : public Gtk::Window
 {
 public:
-  PlayerWindow(const Glib::RefPtr<Gst::FileSrc>& sourceElement,
+  PlayerWindow(const Glib::RefPtr<Gst::Element>& sourceElement,
     const Glib::RefPtr<Gst::Pipeline>& mainPipeline);
 
   virtual ~PlayerWindow();
@@ -65,7 +64,7 @@ protected:
   Gtk::Button m_forward_button;
   Gtk::Button m_open_button;
 
-  Glib::RefPtr<Gst::FileSrc> m_source_element;
+  Glib::RefPtr<Gst::Element> m_source_element;
   Glib::RefPtr<Gst::Pipeline> m_main_pipeline;
   sigc::connection m_progress_connection;
   unsigned int m_watch_id;
diff --git a/examples/ogg_rewriter/main.cc b/examples/ogg_rewriter/main.cc
index 138031a..e9f1bd1 100644
--- a/examples/ogg_rewriter/main.cc
+++ b/examples/ogg_rewriter/main.cc
@@ -37,7 +37,7 @@ int main(int argc, char** argv)
     return EXIT_FAILURE;
   }
 
-  Glib::RefPtr<Gst::FileSrc> filesrc = Gst::FileSrc::create();
+  Glib::RefPtr<Gst::Element> filesrc = Gst::ElementFactory::create_element("filesrc");
 
   if(!filesrc)
   {
@@ -45,12 +45,12 @@ int main(int argc, char** argv)
     return EXIT_FAILURE;
   }
 
-  filesrc->property_location() = argv[1];
+  filesrc->set_property("location", argv[1]);
 
   mainloop = Glib::MainLoop::create();
   pipeline = Gst::Pipeline::create("rewriter");
-  Glib::RefPtr<Gst::FileSink> filesink = Gst::FileSink::create();
-  filesink->property_location() = argv[2];
+  Glib::RefPtr<Gst::Element> filesink = Gst::ElementFactory::create_element("filesink");
+  filesink->set_property("location", argv[2]);
 
   Glib::RefPtr<Gst::Bus> bus = pipeline->get_bus();
   bus->add_watch(sigc::ptr_fun(&on_bus_message));
diff --git a/examples/typefind/main.cc b/examples/typefind/main.cc
index 73c04b7..2596d02 100644
--- a/examples/typefind/main.cc
+++ b/examples/typefind/main.cc
@@ -19,6 +19,9 @@
 #include <gstreamermm.h>
 #include <glibmm.h>
 #include <iostream>
+#include <type_traits>
+
+typedef struct _GstTypeFindElement GstTypeFindElement;
 
 Glib::RefPtr<Glib::MainLoop> mainloop;
 bool have_type = false;
@@ -33,6 +36,56 @@ static bool on_structure_foreach(const Glib::QueryQuark& id, const Glib::ValueBa
   return true;
 }
 
+namespace Glib{
+template <typename T>
+constexpr T wrap (const T& v, bool=true)
+{
+  return v;
+}
+
+template <typename T>
+constexpr T unwrap (const T& v, bool=true)
+{
+  return v;
+}
+}
+
+template<typename ...T>
+static void signal_callback(void* self, T ...v)
+{
+  using namespace Gst;
+  typedef sigc::slot< void, decltype(Glib::wrap(v))... > SlotType;
+
+  void* data = std::get<sizeof...(T)-1>(std::tuple<T...>(v...));
+
+  try
+  {
+    if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
+    {
+      (*static_cast<SlotType*>(slot))(Glib::wrap(std::forward<T>(v), true)...);
+    }
+  }
+  catch(...)
+  {
+     Glib::exception_handlers_invoke();
+  }
+}
+
+
+template<typename ...T>
+Glib::SignalProxy< void, T... > signal_have_type(const Glib::RefPtr<Glib::Object>& obj)
+{
+
+  static const Glib::SignalProxyInfo signal_info =
+  {
+    "have-type",
+    (GCallback) &signal_callback<decltype(Glib::unwrap(*((typename 
std::remove_reference<T>::type*)nullptr)))..., void*>,
+    (GCallback) &signal_callback<decltype(Glib::unwrap(*((typename 
std::remove_reference<T>::type*)nullptr)))..., void*>
+  };
+
+  return Glib::SignalProxy< void, T... >(obj.operator->(), &signal_info);
+}
+
 static void on_typefind_have_type(guint probability, const Glib::RefPtr<Gst::Caps>& caps)
 {
   have_type = true;
@@ -81,17 +134,17 @@ int main(int argc, char** argv)
   Glib::RefPtr<Gst::Pipeline> pipeline = Gst::Pipeline::create("my-pipeline");
 
   // Create elements:
-  Glib::RefPtr<Gst::FileSrc> element_source = Gst::FileSrc::create();
-  element_source->property_location() = filename;
+  Glib::RefPtr<Gst::Element> element_source = Gst::ElementFactory::create_element("filesrc");
+  element_source->set_property("location", filename);
 
   //If using an MP3 file, this should provide more Caps information from typefind.
   //Glib::RefPtr<Gst::Element> element_id3demux = Gst::ElementFactory::create_element("id3demux");
   //g_assert(element_id3demux);
 
-  Glib::RefPtr<Gst::TypeFindElement> element_typefind = Gst::TypeFindElement::create();
-  element_typefind->signal_have_type().connect(
+  Glib::RefPtr<Gst::Element> element_typefind = Gst::ElementFactory::create_element("typefind");
+  signal_have_type<guint, const Glib::RefPtr<Gst::Caps>&>(element_typefind).connect(
     sigc::ptr_fun(&on_typefind_have_type) );
-  Glib::RefPtr<Gst::Element> element_sink = Gst::FakeSink::create();
+  Glib::RefPtr<Gst::Element> element_sink = Gst::ElementFactory::create_element("fakesink");
 
   // We must add the elements to the pipeline before linking them:
   try
diff --git a/gstreamer/gstreamermm.h b/gstreamer/gstreamermm.h
index 03819b8..1459b77 100644
--- a/gstreamer/gstreamermm.h
+++ b/gstreamer/gstreamermm.h
@@ -129,41 +129,6 @@
 #include <gstreamermm/navigation.h>
 #include <gstreamermm/videoorientation.h>
 
-// Plug-in core includes
-#include <gstreamermm/capsfilter.h>
-#include <gstreamermm/fakesrc.h>
-#include <gstreamermm/fakesink.h>
-#include <gstreamermm/fdsink.h>
-#include <gstreamermm/fdsrc.h>
-#include <gstreamermm/filesrc.h>
-#include <gstreamermm/filesink.h>
-#include <gstreamermm/funnel.h>
-#include <gstreamermm/identity.h>
-#include <gstreamermm/multiqueue.h>
-#include <gstreamermm/queue.h>
-#include <gstreamermm/queue2.h>
-
-// Plug-in base includes
-#include <gstreamermm/adder.h>
-#include <gstreamermm/alsasink.h>
-#include <gstreamermm/alsasrc.h>
-#include <gstreamermm/audioconvert.h>
-#include <gstreamermm/audiorate.h>
-//#include <gstreamermm/audioresample.h>
-#include <gstreamermm/audiotestsrc.h>
-#include <gstreamermm/cdparanoiasrc.h>
-#include <gstreamermm/clockoverlay.h>
-#include <gstreamermm/decodebin.h>
-#include <gstreamermm/giosink.h>
-#include <gstreamermm/giosrc.h>
-#include <gstreamermm/giostreamsink.h>
-#include <gstreamermm/giostreamsrc.h>
-//TODO? (Add plug-in first): #include <gstreamermm/gnomevfssink.h>
-//TODO? (Add plug-in first): #include <gstreamermm/gnomevfssrc.h>
-#include <gstreamermm/oggdemux.h>
-#include <gstreamermm/oggmux.h>
-#include <gstreamermm/subtitleoverlay.h>
-#include <gstreamermm/typefindelement.h>
 #include <gstreamermm/videooverlay.h>
 
 
diff --git a/gstreamer/src/Makefile.am b/gstreamer/src/Makefile.am
index 4b11668..c2ddfe6 100644
--- a/gstreamer/src/Makefile.am
+++ b/gstreamer/src/Makefile.am
@@ -17,9 +17,6 @@ binding_name    = gstreamermm
 wrap_init_flags = --namespace=Gst --parent_dir=gstreamermm
 codegen_srcdir  = $(top_srcdir)/tools
 
-include $(srcdir)/plugin_filelist.am
-plugins_ccg = $(plugins_hg:.hg=.ccg)
-
 include $(srcdir)/filelist.am
 include $(top_srcdir)/tools/m4/filelist.am
 include $(top_srcdir)/build/generate-binding.am
@@ -29,28 +26,3 @@ MAINTAINERCLEANFILES += $(addprefix $(srcdir)/,$(plugins_ccg) $(plugins_hg))
 
 generate_gst_wrap_init = $(codegen_srcdir)/generate_gst_wrap_init.pl
 
-generate_plugin_gmmproc_file = \
-       $(top_builddir)/tools/extra_defs_gen/generate_plugin_gmmproc_file$(EXEEXT) \
-       --namespace=Gst --main-defs=gst --target=gstreamermm
-generate_plugin_dependencies = \
-       $(codegen_srcdir)/extra_defs_gen/generate_plugin_gmmproc_file.cc \
-       $(addprefix $(codegen_m4_srcdir)/,$(files_plugin_m4))
-
-target_hg_basename = $(basename $(notdir $@))
-plugin_list = $(GSTREAMERMM_CORE_PLUGIN_DEFS) $(GSTREAMERMM_BASE_PLUGIN_DEFS)
-target_plugin_and_classname = $(wordlist 2,3,$(subst |, ,$(filter $(target_hg_basename)|%,$(plugin_list))))
- 
-# This is to generate plugin .ccg files.  The generated .ccg file is piped
-# through m4 using the macros in tools/m4/ctocpp_base.m4 which then produces
-# the final .ccg file.
-$(addprefix $(srcdir)/,$(plugins_ccg)): $(generate_plugin_dependencies)
-       $(AM_V_GEN)$(generate_plugin_gmmproc_file) --ccg \
-         $(target_plugin_and_classname) | $(M4) -I $(codegen_m4_srcdir) >$@
-
-# This is to generate plugin .hg files.  The generated .hg file is piped
-# through m4 using the macros in tools/m4/ctocpp_base.m4 which then produces
-# the final .hg file.
-$(addprefix $(srcdir)/,$(plugins_hg)): %.hg: %.ccg $(generate_plugin_dependencies)
-       $(AM_V_GEN)$(generate_plugin_gmmproc_file) \
-         --hg $(target_plugin_and_classname) | $(M4) -I $(codegen_m4_srcdir) \
-         >$@
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index 5868546..257f961 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -11,18 +11,7 @@ files_defs =                    \
         gst_docs.xml            \
         gst_docs_override.xml
 
-# To add a plugin, add the plugin definition, in the form of
-# "hgfilebasename|plugin|CppClassName" to the GSTREAMERMM_PLUGIN_DEFS variable
-# of the configure.ac file.  (Where "hgfilebasename" is the basename of the .hg
-# file (ie. without the .hg extension), "plugin" is the plugin name as
-# recognized by gst-inspect and "CppClassName" is the desired name of the C++
-# class.)
-#
-# Also add the target .hg file name to the the variable below.  (That must be
-# the same as "CppClassName" - all in lowercase with a .hg extension).  Make
-# sure that the order of both lists correspond.
-
-# TODO: enable audioresample.hg       
+# TODO: enable audioresample.hg
 
 files_hg  =                     \
         allocator.hg            \
@@ -99,7 +88,6 @@ files_hg  =                     \
         videoinfo.hg            \
         videoorientation.hg     \
         videosink.hg            \
-        videooverlay.hg         \
-        $(plugins_hg)           
+        videooverlay.hg
 
 files_ccg = $(files_hg:.hg=.ccg)


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