X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdata%2Fdecoderstack.cpp;h=a764e452d3d82bc203f88e83cac34bf231fbb699;hb=ff008de665c7990d5f3408f918ff090d8e6c60b2;hp=da831e3be097fe6446bb688ae953860f9964ef10;hpb=2b81ae4682ade4109ffa442794de36ceb32045eb;p=pulseview.git diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index da831e3..a764e45 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; @@ -62,6 +62,8 @@ mutex DecoderStack::global_decode_mutex_; 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,14 +257,14 @@ 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(); // Get the samplerate and start time - start_time_ = data->get_start_time(); - samplerate_ = data->samplerate(); + start_time_ = snapshot_->start_time(); + samplerate_ = snapshot_->samplerate(); if (samplerate_ == 0.0) samplerate_ = 1.0; @@ -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())