* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
-const int64_t DecoderStack::DecodeChunkLength = 4096;
-const unsigned int DecoderStack::DecodeNotifyPeriod = 65536;
+const int64_t DecoderStack::DecodeChunkLength = 10 * 1024 * 1024;
+const unsigned int DecoderStack::DecodeNotifyPeriod = 1024;
DecoderStack::DecoderStack(pv::Session &session,
const srd_decoder *const dec) :
DecoderStack::DecoderStack(pv::Session &session,
const srd_decoder *const dec) :
connect(&session_, SIGNAL(frame_ended()),
this, SLOT(on_frame_ended()));
connect(&session_, SIGNAL(frame_ended()),
this, SLOT(on_frame_ended()));
const Row &row, uint64_t start_sample,
uint64_t end_sample) const
{
const Row &row, uint64_t start_sample,
uint64_t end_sample) const
{
// We get the logic data of the first channel in the list.
// This works because we are currently assuming all
// We get the logic data of the first channel in the list.
// This works because we are currently assuming all
- ((logic_signal = (*dec->channels().begin()).second)) &&
- ((data = logic_signal->logic_data())))
+ ((signalbase = (*dec->channels().begin()).second.get())) &&
+ ((data = signalbase->logic_data().get())))
- (samples_decoded_ < sample_count_ || !frame_complete_),
+ // and there's more work to do...
+ (samples_decoded_ < sample_count_ || !frame_complete_) &&
+ // and if the end of the data hasn't been reached yet
+ (!((samples_decoded_ >= sample_count_) && (session_.get_capture_state() == Session::Stopped))),
- const int64_t sample_count, const unsigned int unit_size,
+ const int64_t abs_start_samplenum, const int64_t sample_count, const unsigned int unit_size,
- for (int64_t i = 0; !interrupt_ && i < sample_count;
- i += chunk_sample_count)
- {
- lock_guard<mutex> decode_lock(global_decode_mutex_);
+ for (int64_t i = abs_start_samplenum; !interrupt_ && i < sample_count;
+ i += chunk_sample_count) {
const int64_t chunk_end = min(
i + chunk_sample_count, sample_count);
const int64_t chunk_end = min(
i + chunk_sample_count, sample_count);
if (srd_session_send(session, i, chunk_end, chunk,
(chunk_end - i) * unit_size, unit_size) != SRD_OK) {
error_message_ = tr("Decoder reported an error");
if (srd_session_send(session, i, chunk_end, chunk,
(chunk_end - i) * unit_size, unit_size) != SRD_OK) {
error_message_ = tr("Decoder reported an error");
- decode_data(*sample_count, unit_size, session);
+ decode_data(abs_start_samplenum, *sample_count, unit_size, session);
+ abs_start_samplenum = *sample_count;
const auto r = d->class_rows_.find(make_pair(decc, a.format()));
if (r != d->class_rows_.end())
row_iter = d->rows_.find((*r).second);
const auto r = d->class_rows_.find(make_pair(decc, a.format()));
if (r != d->class_rows_.end())
row_iter = d->rows_.find((*r).second);
}
assert(row_iter != d->rows_.end());
if (row_iter == d->rows_.end()) {
qDebug() << "Unexpected annotation: decoder = " << decc <<
", format = " << a.format();
}
assert(row_iter != d->rows_.end());
if (row_iter == d->rows_.end()) {
qDebug() << "Unexpected annotation: decoder = " << decc <<
", format = " << a.format();