]> sigrok.org Git - libsigrokflow.git/blame - include/libsigrokflow/libsigrokflow.hpp
Factor out legacy_output.hpp.
[libsigrokflow.git] / include / libsigrokflow / libsigrokflow.hpp
CommitLineData
572e76fe
UH
1/*
2 * This file is part of the libsigrokflow project.
3 *
f1eaad84 4 * Copyright (C) 2018 Martin Ling <martin-sigrok@earth.li>
572e76fe
UH
5 * Copyright (C) 2018 Uwe Hermann <uwe@hermann-uwe.de>
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef LIBSIGROKFLOW_LIBSIGROKFLOW_HPP
22#define LIBSIGROKFLOW_LIBSIGROKFLOW_HPP
23
15c57e97
UH
24/* Temporary workaround, will be dropped later. */
25#define HAVE_LIBSIGROKCXX 1
26#define HAVE_LIBSIGROKDECODE 1
27
f7363af1 28#include <gstreamermm.h>
37469b3d 29#include <gstreamermm/private/element_p.h>
e2cfc0ef 30#include <gstreamermm/private/basesink_p.h>
1060e9b5 31#ifdef HAVE_LIBSIGROKCXX
f7363af1 32#include <libsigrokcxx/libsigrokcxx.hpp>
1060e9b5 33#endif
45e6e688 34#ifdef HAVE_LIBSIGROKDECODE
b1322000 35#include <libsigrokdecode/libsigrokdecode.h>
45e6e688 36#endif
f7363af1 37
3f86037d 38#include <libsigrokflow/main.hpp>
8ab86460 39#include <libsigrokflow/init.hpp>
a43e2005 40#include <libsigrokflow/legacy_capture_device.hpp>
3d1f327f 41#include <libsigrokflow/legacy_input.hpp>
bf71e84f 42#include <libsigrokflow/legacy_output.hpp>
8ab86460 43
b903bb0a
UH
44namespace Srf
45{
46
f7363af1
ML
47using namespace std;
48
45e6e688 49#ifdef HAVE_LIBSIGROKDECODE
b1322000 50class LegacyDecoder :
31b3babd 51 public Sink
b1322000
UH
52{
53public:
31b3babd
UH
54 static Glib::RefPtr<LegacyDecoder> create(
55 struct srd_session *libsigrokdecode_session, uint64_t unitsize);
56
57 /* Retrieve libsigrokdecode session. */
58 struct srd_session *libsigrokdecode_session();
b1322000 59
31b3babd 60 /* Override start. */
8ddc0b74 61 bool start_vfunc() override;
b1322000 62
31b3babd 63 /* Override render. */
8ddc0b74 64 Gst::FlowReturn render_vfunc(const Glib::RefPtr<Gst::Buffer> &buffer) override;
b1322000 65
31b3babd 66 /* Override stop. */
8ddc0b74 67 bool stop_vfunc() override;
b1322000 68
31b3babd
UH
69 /* Gst class init. */
70 static void class_init(Gst::ElementClass<LegacyDecoder> *klass);
b1322000 71
31b3babd
UH
72 /* Register class with plugin. */
73 static bool register_element(Glib::RefPtr<Gst::Plugin> plugin);
b1322000 74
31b3babd
UH
75 /* Constructor used by element factory. */
76 explicit LegacyDecoder(GstBaseSink *gobj);
b1322000 77
b1322000 78private:
b37c14d6
UH
79 struct srd_session *session_;
80 uint64_t abs_ss_;
81 uint64_t unitsite_;
b1322000 82};
45e6e688 83#endif
f7363af1
ML
84
85}
572e76fe 86#endif