Skip to content

Commit 997ff24

Browse files
authored
fixes conventionalDMR plugin support (#828)
* fixed conventionalDMR plugin support * added a plugin sink for slot 1, when testing on a few different systems, encountered partial audio, system was using both slots for same TG
1 parent 53dfedd commit 997ff24

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

trunk-recorder/recorders/dmr_recorder_impl.cc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ void dmr_recorder_impl::initialize(Source *src) {
160160
recording_count = 0;
161161
recording_duration = 0;
162162

163+
bool use_streaming = false;
164+
165+
if (config != NULL) {
166+
use_streaming = config->enable_audio_streaming;
167+
}
168+
163169
state = INACTIVE;
164170

165171
timestamp = time(NULL);
@@ -221,7 +227,8 @@ void dmr_recorder_impl::initialize(Source *src) {
221227
framer = gr::op25_repeater::frame_assembler::make("file:///tmp/out1.raw", verbosity, 1, rx_queue);
222228
// 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);
223229
levels = gr::blocks::multiply_const_ff::make(1);
224-
plugin_sink = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2));
230+
plugin_sink_slot0 = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2));
231+
plugin_sink_slot1 = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2));
225232

226233
// Squelch DB
227234
// 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) {
241248
connect(slicer, 0, framer, 0);
242249
connect(framer, 0, wav_sink_slot0, 0);
243250
connect(framer, 1, wav_sink_slot1, 0);
251+
252+
if (use_streaming) {
253+
connect(framer, 0, plugin_sink_slot0, 0);
254+
connect(framer, 1, plugin_sink_slot1, 0);
255+
}
244256
}
245257

246258
void dmr_recorder_impl::plugin_callback_handler(int16_t *samples, int sampleCount) {
247-
// plugman_audio_callback(_recorder, samples, sampleCount);
259+
plugman_audio_callback(call, this, samples, sampleCount);
248260
}
249261

250262
void dmr_recorder_impl::switch_tdma(bool phase2) {

trunk-recorder/recorders/dmr_recorder_impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ class dmr_recorder_impl : public dmr_recorder {
195195
gr::blocks::multiply_const_ff::sptr levels;
196196
gr::blocks::transmission_sink::sptr wav_sink_slot0;
197197
gr::blocks::transmission_sink::sptr wav_sink_slot1;
198-
gr::blocks::plugin_wrapper::sptr plugin_sink;
198+
gr::blocks::plugin_wrapper::sptr plugin_sink_slot0;
199+
gr::blocks::plugin_wrapper::sptr plugin_sink_slot1;
199200
};
200201

201202
#endif // ifndef dmr_recorder_H

0 commit comments

Comments
 (0)