Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes conventionalDMR plugin support #828

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions trunk-recorder/recorders/dmr_recorder_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion trunk-recorder/recorders/dmr_recorder_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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