X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdata%2Fdecoderstack.cpp;h=bb2818bb79aab0d2c336a0045d5e0a0eb3c2a5a6;hb=99503171d4f32570829df171521b4b9cbccb0503;hp=5e30faa73c810e7d64e9bfb936e7cb6e8656daa8;hpb=2acdb232d6bb452cfdfaea3ef5218fb4da592329;p=pulseview.git diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index 5e30faa..bb2818b 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include using std::lock_guard; @@ -59,9 +59,11 @@ const unsigned int DecoderStack::DecodeNotifyPeriod = 65536; mutex DecoderStack::global_decode_mutex_; -DecoderStack::DecoderStack(pv::SigSession &session, +DecoderStack::DecoderStack(pv::Session &session, const srd_decoder *const dec) : session_(session), + start_time_(0), + samplerate_(0), sample_count_(0), frame_complete_(false), samples_decoded_(0) @@ -112,6 +114,16 @@ void DecoderStack::remove(int index) stack_.erase(iter); } +double DecoderStack::samplerate() const +{ + return samplerate_; +} + +double DecoderStack::start_time() const +{ + return start_time_; +} + int64_t DecoderStack::samples_decoded() const { lock_guard decode_lock(output_mutex_); @@ -245,7 +257,7 @@ void DecoderStack::begin_decode() // Check we have a snapshot of data const deque< shared_ptr > &snapshots = - data->get_snapshots(); + data->logic_snapshots(); if (snapshots.empty()) return; snapshot_ = snapshots.front(); @@ -392,7 +404,7 @@ void DecoderStack::annotation_callback(srd_proto_data *pdata, void *decoder) assert(decc); auto row_iter = d->rows_.end(); - + // Try looking up the sub-row of this class const auto r = d->class_rows_.find(make_pair(decc, a.format())); if (r != d->class_rows_.end())