MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / execute_decode_stack

Method execute_decode_stack

DSView/pv/data/decoderstack.cpp:689–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687}
688
689void DecoderStack::execute_decode_stack()
690{
691 srd_session *session = NULL;
692 srd_decoder_inst *prev_di = NULL;
693 uint64_t decode_start = 0;
694 uint64_t decode_end = 0;
695
696 assert(_snapshot);
697
698 // Create the session
699 // one decoderstatck onwer one session
700 // all decoderstatck execute in sequence
701 srd_session_new(&session);
702
703 if (session == NULL){
704 dsv_err("Failed to call srd_session_new()");
705 assert(false);
706 }
707
708 // Get the intial sample count
709 _sample_count = _snapshot->get_ring_sample_count();
710
711 // Create the decoders
712 for(auto dec : _stack)
713 {
714 srd_decoder_inst *const di = dec->create_decoder_inst(session);
715
716 if (!di)
717 {
718 _error_message =L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DECODERSTACK_DECODE_STACK_ERROR),
719 "Failed to create decoder instance");
720 srd_session_destroy(session);
721 return;
722 }
723
724 if (prev_di)
725 srd_inst_stack (session, prev_di, di);
726
727 prev_di = di;
728 decode_start = dec->decode_start();
729
730 if (_session->is_realtime_refresh() == false)
731 decode_end = min(dec->decode_end(), _sample_count-1);
732 else
733 decode_end = max(dec->decode_end(), decode_end);
734 }
735
736 dsv_info("decoder start sample:%llu, end sample:%llu, count:%llu",
737 (u64_t)decode_start, (u64_t)decode_end, (u64_t)(decode_end - decode_start + 1));
738
739 // Start the session
740 srd_session_metadata_set(session, SRD_CONF_SAMPLERATE,
741 g_variant_new_uint64((uint64_t)_samplerate));
742
743 srd_pd_output_callback_add(
744 session,
745 SRD_OUTPUT_ANN,
746 DecoderStack::annotation_callback,

Callers

nothing calls this directly

Calls 11

srd_session_newFunction · 0.85
srd_session_destroyFunction · 0.85
srd_inst_stackFunction · 0.85
srd_session_metadata_setFunction · 0.85
srd_session_startFunction · 0.85
create_decoder_instMethod · 0.80
decode_startMethod · 0.80
is_realtime_refreshMethod · 0.80
get_ring_sample_countMethod · 0.45
decode_endMethod · 0.45

Tested by

no test coverage detected