Renamed DecoderStack::_mutex to _output_mutex
[pulseview.git] / pv / data / decoderstack.h
index 80ad64cdfebf90398213d801ef184f128cc7d4bd..308dce6edde0ad8b480bf65beba7cc6b6ca7cac9 100644 (file)
@@ -38,6 +38,7 @@ struct srd_decoder;
 struct srd_decoder_annotation_row;
 struct srd_probe;
 struct srd_proto_data;
+struct srd_session;
 
 namespace DecoderStackTest {
 class TwoDecoderStack;
@@ -45,12 +46,16 @@ class TwoDecoderStack;
 
 namespace pv {
 
+class SigSession;
+
 namespace view {
 class LogicSignal;
 }
 
 namespace data {
 
+class LogicSnapshot;
+
 namespace decode {
 class Annotation;
 class Decoder;
@@ -68,7 +73,8 @@ private:
        static const int64_t DecodeChunkLength;
 
 public:
-       DecoderStack(const srd_decoder *const decoder);
+       DecoderStack(pv::SigSession &_session,
+               const srd_decoder *const decoder);
 
        virtual ~DecoderStack();
 
@@ -78,7 +84,7 @@ public:
 
        int64_t samples_decoded() const;
 
-       std::vector<decode::Row> get_rows() const;
+       std::vector<decode::Row> get_visible_rows() const;
 
        /**
         * Extracts sorted annotations between two period into a vector.
@@ -97,15 +103,23 @@ public:
        void begin_decode();
 
 private:
+       void decode_data(
+               const boost::shared_ptr<pv::data::LogicSnapshot> &snapshot,
+               srd_session *const session);
+
        void decode_proc(boost::shared_ptr<data::Logic> data);
 
        static void annotation_callback(srd_proto_data *pdata,
                void *decoder);
 
+private slots:
+       void on_new_frame();
+
 signals:
        void new_decode_data();
 
 private:
+       pv::SigSession &_session;
 
        /**
         * This mutex prevents more than one decode operation occuring
@@ -117,7 +131,7 @@ private:
 
        std::list< boost::shared_ptr<decode::Decoder> > _stack;
 
-       mutable boost::mutex _mutex;
+       mutable boost::mutex _output_mutex;
        int64_t _samples_decoded;
 
        std::map<const decode::Row, decode::RowData> _rows;