+ 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())
+ row_iter = d->_rows.find((*r).second);
+ else
+ {
+ // Failing that, use the decoder as a key
+ row_iter = d->_rows.find(Row(decc));
+ }
+
+ assert(row_iter != d->_rows.end());
+ if (row_iter == d->_rows.end()) {
+ qDebug() << "Unexpected annotation: decoder = " << decc <<
+ ", format = " << a.format();
+ assert(0);
+ return;
+ }
+
+ // Add the annotation
+ (*row_iter).second.push_annotation(a);
+}
+
+void DecoderStack::on_new_frame()
+{
+ begin_decode();
+}
+
+void DecoderStack::on_data_received()
+{
+ {
+ unique_lock<mutex> lock(_input_mutex);
+ if (_snapshot)
+ _sample_count = _snapshot->get_sample_count();
+ }
+ _input_cond.notify_one();
+}
+
+void DecoderStack::on_frame_ended()
+{
+ {
+ unique_lock<mutex> lock(_input_mutex);
+ if (_snapshot)
+ _frame_complete = true;
+ }
+ _input_cond.notify_one();