X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fdecoder.h;fp=pv%2Fdata%2Fdecoder.h;h=4cae427ea95813e842be6aaa25fb93641ee0de1d;hp=dcf12fe1d4b5d2b8c6696442682bc9f5217ea2e6;hb=e0fc58100fbcd6c3bfd5aecb213d7541a3436622;hpb=3195aeb6a867b6ab54b4a410182467f63f9b79f2 diff --git a/pv/data/decoder.h b/pv/data/decoder.h index dcf12fe1..4cae427e 100644 --- a/pv/data/decoder.h +++ b/pv/data/decoder.h @@ -28,6 +28,8 @@ #include #include +#include + struct srd_decoder; struct srd_decoder_inst; struct srd_probe; @@ -36,14 +38,26 @@ 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 > + annotations() const; void clear_snapshots(); private: + void begin_decode(); + void init_decoder(); void decode_proc(boost::shared_ptr data); + static void annotation_callback(srd_proto_data *pdata, + void *decoder); + private: const srd_decoder *const _decoder; std::map > @@ -69,6 +89,10 @@ private: srd_decoder_inst *_decoder_inst; + mutable boost::mutex _annotations_mutex; + std::vector< boost::shared_ptr > + _annotations; + boost::thread _decode_thread; };