]> sigrok.org Git - libsigrokflow.git/commitdiff
Factor out legacy_output.hpp.
authorUwe Hermann <redacted>
Fri, 11 Jan 2019 00:30:07 +0000 (01:30 +0100)
committerUwe Hermann <redacted>
Fri, 11 Jan 2019 01:44:15 +0000 (02:44 +0100)
Makefile.am
include/libsigrokflow/legacy_output.hpp [new file with mode: 0644]
include/libsigrokflow/libsigrokflow.hpp
src/legacy_output.cpp

index a1318508d0cfc0c3cacdc238983e0a2560d4a47b..85a0f95c12c5ecdfd143ed02b9ec47b6a0cb8914 100644 (file)
@@ -44,7 +44,8 @@ library_include_HEADERS = \
        include/libsigrokflow/main.hpp \
        include/libsigrokflow/init.hpp \
        include/libsigrokflow/legacy_capture_device.hpp \
-       include/libsigrokflow/legacy_input.hpp
+       include/libsigrokflow/legacy_input.hpp \
+       include/libsigrokflow/legacy_output.hpp
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libsigrokflow.pc
diff --git a/include/libsigrokflow/legacy_output.hpp b/include/libsigrokflow/legacy_output.hpp
new file mode 100644 (file)
index 0000000..7e78bda
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * This file is part of the libsigrokflow project.
+ *
+ * Copyright (C) 2018 Martin Ling <martin-sigrok@earth.li>
+ * Copyright (C) 2018 Uwe Hermann <uwe@hermann-uwe.de>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LIBSIGROKFLOW_LEGACY_OUTPUT_HPP
+#define LIBSIGROKFLOW_LEGACY_OUTPUT_HPP
+
+/* Temporary workaround, will be dropped later. */
+#define HAVE_LIBSIGROKCXX 1
+
+#include <gstreamermm.h>
+#ifdef HAVE_LIBSIGROKCXX
+#include <libsigrokcxx/libsigrokcxx.hpp>
+#endif
+#include <libsigrokflow/main.hpp>
+
+namespace Srf
+{
+
+using namespace std;
+
+#ifdef HAVE_LIBSIGROKCXX
+class LegacyOutput :
+       public Sink
+{
+public:
+       /* Create from libsigrok output object. */
+       static Glib::RefPtr<LegacyOutput> create(
+               shared_ptr<sigrok::OutputFormat> libsigrok_output_format,
+               map<string, Glib::VariantBase> options = map<string, Glib::VariantBase>());
+
+       /* Override start. */
+       bool start_vfunc() override;
+
+       /* Override render. */
+       Gst::FlowReturn render_vfunc(const Glib::RefPtr<Gst::Buffer> &buffer) override;
+
+       /* Override stop. */
+       bool stop_vfunc() override;
+
+       /* Gst class init. */
+       static void class_init(Gst::ElementClass<LegacyOutput> *klass);
+
+       /* Register class with plugin. */
+       static bool register_element(Glib::RefPtr<Gst::Plugin> plugin);
+
+       /* Constructor used by element factory. */
+       explicit LegacyOutput(GstBaseSink *gobj);
+
+private:
+       shared_ptr<sigrok::OutputFormat> libsigrok_output_format_;
+       shared_ptr<sigrok::UserDevice> libsigrok_device_;
+       shared_ptr<sigrok::Output> libsigrok_output_;
+       map<string, Glib::VariantBase> options_;
+};
+#endif
+
+}
+#endif
index 50c5eea1ef578cc14726dd566f720cd433ac7269..f7b52740bee0e196978f3358294c1fe96b87883e 100644 (file)
 #include <libsigrokflow/init.hpp>
 #include <libsigrokflow/legacy_capture_device.hpp>
 #include <libsigrokflow/legacy_input.hpp>
+#include <libsigrokflow/legacy_output.hpp>
 
 namespace Srf
 {
 
 using namespace std;
 
-#ifdef HAVE_LIBSIGROKCXX
-class LegacyOutput :
-       public Sink
-{
-public:
-       /* Create from libsigrok output object. */
-       static Glib::RefPtr<LegacyOutput> create(
-               shared_ptr<sigrok::OutputFormat> libsigrok_output_format,
-               map<string, Glib::VariantBase> options = map<string, Glib::VariantBase>());
-
-       /* Override start. */
-       bool start_vfunc() override;
-
-       /* Override render. */
-       Gst::FlowReturn render_vfunc(const Glib::RefPtr<Gst::Buffer> &buffer) override;
-
-       /* Override stop. */
-       bool stop_vfunc() override;
-
-       /* Gst class init. */
-       static void class_init(Gst::ElementClass<LegacyOutput> *klass);
-
-       /* Register class with plugin. */
-       static bool register_element(Glib::RefPtr<Gst::Plugin> plugin);
-
-       /* Constructor used by element factory. */
-       explicit LegacyOutput(GstBaseSink *gobj);
-
-private:
-       shared_ptr<sigrok::OutputFormat> libsigrok_output_format_;
-       shared_ptr<sigrok::UserDevice> libsigrok_device_;
-       shared_ptr<sigrok::Output> libsigrok_output_;
-       map<string, Glib::VariantBase> options_;
-};
-#endif
-
 #ifdef HAVE_LIBSIGROKDECODE
 class LegacyDecoder :
        public Sink
index 21d8c2fd6989b01ec548cb102a5daea173007508..fc83c8c04a6b4a17944035c96e961fb8dd17a2bc 100644 (file)
@@ -20,7 +20,8 @@
 
 #include <config.h>
 #include <iostream>
-#include <libsigrokflow/libsigrokflow.hpp>
+#include <libsigrokflow/legacy_output.hpp>
+#include <gstreamermm/private/basesink_p.h>
 
 namespace Srf
 {