From: Uwe Hermann Date: Thu, 20 Aug 2015 17:51:15 +0000 (+0200) Subject: Pass unitsize to srd_session_send() directly. X-Git-Tag: pulseview-0.3.0~139 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c4dd1e4ee295c4fc6bc3db0feaf826df4807cc91;p=pulseview.git Pass unitsize to srd_session_send() directly. Follow an API change in libsigrokdecode where srd_inst_channel_set_all() no longer gets passed a unitsize, but rather srd_session_send() gets it. --- diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index f5fdd0c9..03f4f0eb 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -111,7 +111,7 @@ set< shared_ptr > Decoder::get_data() return data; } -srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session, int unit_size) const +srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session) const { GHashTable *const opt_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_variant_unref); @@ -144,7 +144,7 @@ srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session, int unit_si g_hash_table_insert(channels, (*i).first->id, gvar); } - srd_inst_channel_set_all(decoder_inst, channels, unit_size); + srd_inst_channel_set_all(decoder_inst, channels); return decoder_inst; } diff --git a/pv/data/decode/decoder.hpp b/pv/data/decode/decoder.hpp index 3f0f462b..121286f1 100644 --- a/pv/data/decode/decoder.hpp +++ b/pv/data/decode/decoder.hpp @@ -68,7 +68,7 @@ public: bool have_required_channels() const; srd_decoder_inst* create_decoder_inst( - srd_session *session, int unit_size) const; + srd_session *session) const; std::set< std::shared_ptr > get_data(); diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index 35480240..ef497f72 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -313,7 +313,7 @@ void DecoderStack::decode_data( segment_->get_samples(chunk, i, chunk_end); if (srd_session_send(session, i, chunk_end, chunk, - (chunk_end - i) * unit_size) != SRD_OK) { + (chunk_end - i) * unit_size, unit_size) != SRD_OK) { error_message_ = tr("Decoder reported an error"); break; } @@ -347,7 +347,7 @@ void DecoderStack::decode_proc() for (const shared_ptr &dec : stack_) { - srd_decoder_inst *const di = dec->create_decoder_inst(session, unit_size); + srd_decoder_inst *const di = dec->create_decoder_inst(session); if (!di) {