X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdata%2Fdecoder.h;h=cdeb7e7a59adc0a449937a7df5ec51a02d73f601;hb=3045c869ada2e32bf55cbb68633b5213b9b11e28;hp=c4f7115254141dc5f565960708c54ce47535d0a9;hpb=e332f6d399ecba201389c1e048239a7fe0cc87d5;p=pulseview.git diff --git a/pv/data/decoder.h b/pv/data/decoder.h index c4f7115..cdeb7e7 100644 --- a/pv/data/decoder.h +++ b/pv/data/decoder.h @@ -26,39 +26,84 @@ #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; +class LogicSignal; + +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 decoder, std::map > probes); + boost::shared_ptr > probes, + GHashTable *options); + + virtual ~Decoder(); const srd_decoder* get_decoder() const; + 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 > + 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