+ const Row* row = ann_class->row;
+
+ if (!row)
+ row = dec->get_row_by_id(0);
+
+ RowData& row_data = ds->segments_[ds->current_segment_id_].annotation_rows.at(row);
+
+ // Add the annotation to the row
+ const Annotation* ann = row_data.emplace_annotation(pdata);
+
+ // Add the annotation to the global annotation list
+ deque<const Annotation*>& all_annotations =
+ ds->segments_[ds->current_segment_id_].all_annotations;
+ all_annotations.emplace_back(ann);
+}
+
+void DecodeSignal::binary_callback(srd_proto_data *pdata, void *decode_signal)
+{
+ assert(pdata);
+ assert(decode_signal);
+
+ DecodeSignal *const ds = (DecodeSignal*)decode_signal;
+ assert(ds);
+
+ if (ds->decode_interrupt_)
+ return;
+
+ // Get the decoder and the binary data
+ assert(pdata->pdo);
+ assert(pdata->pdo->di);
+ const srd_decoder *const srd_dec = pdata->pdo->di->decoder;
+ assert(srd_dec);
+
+ const srd_proto_data_binary *const pdb = (const srd_proto_data_binary*)pdata->data;
+ assert(pdb);
+
+ // Find the matching DecodeBinaryClass
+ DecodeSegment* segment = &(ds->segments_.at(ds->current_segment_id_));
+
+ DecodeBinaryClass* bin_class = nullptr;
+ for (DecodeBinaryClass& bc : segment->binary_classes)
+ if ((bc.decoder->get_srd_decoder() == srd_dec) &&
+ (bc.info->bin_class_id == (uint32_t)pdb->bin_class))
+ bin_class = &bc;
+
+ if (!bin_class) {
+ qWarning() << "Could not find valid DecodeBinaryClass in segment" <<
+ ds->current_segment_id_ << "for binary class ID" << pdb->bin_class <<
+ ", segment only knows" << segment->binary_classes.size() << "classes";