const double DecoderStack::DecodeMargin = 1.0;
const double DecoderStack::DecodeThreshold = 0.2;
const int64_t DecoderStack::DecodeChunkLength = 4096;
+const unsigned int DecoderStack::DecodeNotifyPeriod = 65536;
mutex DecoderStack::_global_decode_mutex;
clear();
+ // Check that all decoders have the required probes
+ BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
+ if (!dec->have_required_probes()) {
+ _error_message = tr("One or more required probes "
+ "have not been specified");
+ return;
+ }
+
// Add classes
BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec, _stack)
{
lock_guard<mutex> lock(_output_mutex);
_samples_decoded = chunk_end;
}
+
+ if (i % DecodeNotifyPeriod == 0)
+ new_decode_data();
}
new_decode_data();
srd_session *session;
srd_decoder_inst *prev_di = NULL;
- assert(data);
assert(_snapshot);
- // Check that all decoders have the required probes
- BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
- if (!dec->have_required_probes()) {
- _error_message = tr("One or more required probes "
- "have not been specified");
- return;
- }
-
// Create the session
srd_session_new(&session);
assert(session);
{
{
unique_lock<mutex> lock(_input_mutex);
- _sample_count = _snapshot->get_sample_count();
+ if (_snapshot)
+ _sample_count = _snapshot->get_sample_count();
}
_input_cond.notify_one();
}
{
{
unique_lock<mutex> lock(_input_mutex);
- _frame_complete = true;
+ if (_snapshot)
+ _frame_complete = true;
}
_input_cond.notify_one();
}