]> sigrok.org Git - pulseview.git/commitdiff
Pass unitsize to srd_session_send() directly.
authorUwe Hermann <redacted>
Thu, 20 Aug 2015 17:51:15 +0000 (19:51 +0200)
committerUwe Hermann <redacted>
Thu, 20 Aug 2015 17:51:15 +0000 (19:51 +0200)
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.

pv/data/decode/decoder.cpp
pv/data/decode/decoder.hpp
pv/data/decoderstack.cpp

index f5fdd0c9a7361f830c6abdd9757be9b5cbe72e7b..03f4f0ebabdfc4cae68af572163d1b5345e49a98 100644 (file)
@@ -111,7 +111,7 @@ set< shared_ptr<pv::data::Logic> > 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;
 }
index 3f0f462ba4412b30f0ade603bbc5e160d07969e9..121286f17aeed8e748d90045d019f3ae63b8b0fa 100644 (file)
@@ -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<pv::data::Logic> > get_data();
 
index 354802407fa55487899e622bdc05ff2a176a40ce..ef497f72bb29e2e80eaba88676340c6d499949d7 100644 (file)
@@ -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<decode::Decoder> &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)
                {