X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fdecoder.h;h=264920a723422c9bf51f5e1fb6947e9f5e03f759;hb=e92cd4e4cddac2639c1a5e278124b5bb22ace10f;hp=dcf12fe1d4b5d2b8c6696442682bc9f5217ea2e6;hpb=640d69ce065e5c5a30e83395b259a63f7e03c779;p=pulseview.git diff --git a/pv/data/decoder.h b/pv/data/decoder.h index dcf12fe1..264920a7 100644 --- a/pv/data/decoder.h +++ b/pv/data/decoder.h @@ -28,47 +28,81 @@ #include #include +#include + +#include + struct srd_decoder; struct srd_decoder_inst; struct srd_probe; +struct srd_proto_data; +struct srd_session; namespace pv { namespace view { class Signal; + +namespace decode { +class Annotation; +} + } namespace data { class Logic; -class Decoder : public SignalData +class Decoder : public QObject, public SignalData { + Q_OBJECT + +private: + static const double DecodeMargin; + static const double DecodeThreshold; + static const int64_t DecodeChunkLength; + public: Decoder(const srd_decoder *const decoder, std::map > probes); + boost::shared_ptr > probes, + GHashTable *options); virtual ~Decoder(); const srd_decoder* get_decoder() const; - void begin_decode(); + const std::vector< boost::shared_ptr > + annotations() const; void clear_snapshots(); private: - void init_decoder(); + void begin_decode(); + + bool init_decoder(); void decode_proc(boost::shared_ptr data); + static void annotation_callback(srd_proto_data *pdata, + void *decoder); + +signals: + void new_decode_data(); + private: const srd_decoder *const _decoder; std::map > _probes; + GHashTable *_options; + srd_session *_session; srd_decoder_inst *_decoder_inst; + mutable boost::mutex _annotations_mutex; + std::vector< boost::shared_ptr > + _annotations; + boost::thread _decode_thread; };