diff --git a/trunk-recorder/recorders/dmr_recorder_impl.cc b/trunk-recorder/recorders/dmr_recorder_impl.cc index b895a4cc2..9301afbbb 100644 --- a/trunk-recorder/recorders/dmr_recorder_impl.cc +++ b/trunk-recorder/recorders/dmr_recorder_impl.cc @@ -160,6 +160,12 @@ void dmr_recorder_impl::initialize(Source *src) { recording_count = 0; recording_duration = 0; + bool use_streaming = false; + + if (config != NULL) { + use_streaming = config->enable_audio_streaming; + } + state = INACTIVE; timestamp = time(NULL); @@ -221,7 +227,8 @@ void dmr_recorder_impl::initialize(Source *src) { framer = gr::op25_repeater::frame_assembler::make("file:///tmp/out1.raw", verbosity, 1, rx_queue); // op25_frame_assembler = gr::op25_repeater::p25_frame_assembler::make(0, silence_frames, udp_host, udp_port, verbosity, do_imbe, do_output, do_msgq, rx_queue, do_audio_output, do_tdma, do_nocrypt); levels = gr::blocks::multiply_const_ff::make(1); - plugin_sink = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2)); + plugin_sink_slot0 = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2)); + plugin_sink_slot1 = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2)); // Squelch DB // on a trunked network where you know you will have good signal, a carrier @@ -241,10 +248,15 @@ void dmr_recorder_impl::initialize(Source *src) { connect(slicer, 0, framer, 0); connect(framer, 0, wav_sink_slot0, 0); connect(framer, 1, wav_sink_slot1, 0); + + if (use_streaming) { + connect(framer, 0, plugin_sink_slot0, 0); + connect(framer, 1, plugin_sink_slot1, 0); + } } void dmr_recorder_impl::plugin_callback_handler(int16_t *samples, int sampleCount) { - // plugman_audio_callback(_recorder, samples, sampleCount); + plugman_audio_callback(call, this, samples, sampleCount); } void dmr_recorder_impl::switch_tdma(bool phase2) { diff --git a/trunk-recorder/recorders/dmr_recorder_impl.h b/trunk-recorder/recorders/dmr_recorder_impl.h index fbe336a28..c5b567c77 100644 --- a/trunk-recorder/recorders/dmr_recorder_impl.h +++ b/trunk-recorder/recorders/dmr_recorder_impl.h @@ -195,7 +195,8 @@ class dmr_recorder_impl : public dmr_recorder { gr::blocks::multiply_const_ff::sptr levels; gr::blocks::transmission_sink::sptr wav_sink_slot0; gr::blocks::transmission_sink::sptr wav_sink_slot1; - gr::blocks::plugin_wrapper::sptr plugin_sink; + gr::blocks::plugin_wrapper::sptr plugin_sink_slot0; + gr::blocks::plugin_wrapper::sptr plugin_sink_slot1; }; #endif // ifndef dmr_recorder_H