]> sigrok.org Git - libsigrokflow.git/blobdiff - include/libsigrokflow/libsigrokflow.hpp
WIP on plugin registration.
[libsigrokflow.git] / include / libsigrokflow / libsigrokflow.hpp
index e800be0d45cc38248fc55fd8a0ae92d3195b096a..2c13cb4be875b77e6d1ef78624c258143589d3c2 100644 (file)
@@ -39,36 +39,50 @@ class GstBlock :
         public Gst::Element
 {
         /* Operations specific to sigrok GStreamer blocks go here. */
+protected:
+        explicit GstBlock(GstElement *gobj);
 };
 
 class Device :
         public GstBlock
 {
         /* Operations specific to hardware devices go here */
+protected:
+        explicit Device(GstElement *gobj);
 };
 
 class CaptureDevice :
         public Device
 {
         /* Operations specific to capture (source) devices go here */
-protected :
-        CaptureDevice();
+protected:
+        explicit CaptureDevice(GstElement *gobj);
 };
 
 class LegacyCaptureDevice :
         public CaptureDevice
 {
 public:
-        /* Construct from libsigrok device object */
-        LegacyCaptureDevice(shared_ptr<sigrok::HardwareDevice>);
+        /* Create from libsigrok device object */
+        static Glib::RefPtr<LegacyCaptureDevice> create(
+                shared_ptr<sigrok::HardwareDevice> libsigrok_device);
 
         /* Retrieve libsigrok device object */
         shared_ptr<sigrok::HardwareDevice> libsigrok_device();
 
         /* Override state change */
         Gst::StateChangeReturn change_state_vfunc(Gst::StateChange transition);
+
+        /* Gst class init */
+        static void class_init(Gst::ElementClass<LegacyCaptureDevice> *klass);
+
+        /* Register class with plugin */
+        static bool register_element(Glib::RefPtr<Gst::Plugin> plugin);
+
+        /* Construcor used by element factory */
+        explicit LegacyCaptureDevice(GstElement *gobj);
 private:
-        shared_ptr<sigrok::HardwareDevice> _device;
+        shared_ptr<sigrok::HardwareDevice> _libsigrok_device;
         Glib::RefPtr<Gst::Pad> _src_pad;
         Glib::Threads::RecMutex _mutex;
         Glib::RefPtr<Gst::Task> _task;