X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fdecoder.h;h=93d8fa6a89fb8dae531e48d9f01e0f7c5d4526d7;hp=228aedabe1a03899b6adc5c1dccbe219cf678309;hb=b213ef0991a13af0c74ffe5c54382c5c455c5496;hpb=119aff65d8ad0c4cdaff32d9b68cee00d90a5f35 diff --git a/pv/data/decoder.h b/pv/data/decoder.h index 228aedab..93d8fa6a 100644 --- a/pv/data/decoder.h +++ b/pv/data/decoder.h @@ -23,22 +23,87 @@ #include "signaldata.h" +#include + +#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 Decoder : public SignalData +class Logic; + +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 dec); + Decoder(const srd_decoder *const decoder, + std::map > probes, + GHashTable *options); + + virtual ~Decoder(); const srd_decoder* get_decoder() const; + const std::vector< boost::shared_ptr > + 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); + +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; }; } // namespace data