2 * This file is part of the libsigrokflow project.
4 * Copyright (C) 2018 Uwe Hermann <uwe@hermann-uwe.de>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef LIBSIGROKFLOW_LIBSIGROKFLOW_HPP
21 #define LIBSIGROKFLOW_LIBSIGROKFLOW_HPP
23 #include <gstreamermm.h>
24 #include <libsigrokcxx/libsigrokcxx.hpp>
35 /* Config API etc goes here */
41 /* Operations specific to sigrok GStreamer blocks go here. */
47 /* Operations specific to hardware devices go here */
53 /* Operations specific to capture (source) devices go here */
56 class LegacyCaptureDevice :
60 /* Create from libsigrok device object */
61 static Glib::RefPtr<LegacyCaptureDevice> create(
62 shared_ptr<sigrok::HardwareDevice> libsigrok_device);
64 /* Retrieve libsigrok device object */
65 shared_ptr<sigrok::HardwareDevice> libsigrok_device();
67 /* Override state change */
68 Gst::StateChangeReturn change_state_vfunc(Gst::StateChange transition);
70 shared_ptr<sigrok::HardwareDevice> _libsigrok_device;
71 Glib::RefPtr<Gst::Pad> _src_pad;
72 Glib::Threads::RecMutex _mutex;
73 Glib::RefPtr<Gst::Task> _task;
74 shared_ptr<sigrok::Session> _session;
76 void _datafeed_callback(shared_ptr<sigrok::Device> device,
77 shared_ptr<sigrok::Packet> packet);