diff options
Diffstat (limited to 'host/lib/rfnoc/rfnoc_tx_streamer.cpp')
-rw-r--r-- | host/lib/rfnoc/rfnoc_tx_streamer.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/host/lib/rfnoc/rfnoc_tx_streamer.cpp b/host/lib/rfnoc/rfnoc_tx_streamer.cpp index 9b511818e..578db5cdf 100644 --- a/host/lib/rfnoc/rfnoc_tx_streamer.cpp +++ b/host/lib/rfnoc/rfnoc_tx_streamer.cpp @@ -16,11 +16,13 @@ const std::string STREAMER_ID = "TxStreamer"; static std::atomic<uint64_t> streamer_inst_ctr; static constexpr size_t ASYNC_MSG_QUEUE_SIZE = 1000; -rfnoc_tx_streamer::rfnoc_tx_streamer( - const size_t num_chans, const uhd::stream_args_t stream_args) - : tx_streamer_impl<chdr_tx_data_xport>(num_chans, stream_args) +rfnoc_tx_streamer::rfnoc_tx_streamer(const size_t num_chans, + const uhd::stream_args_t stream_args, + disconnect_fn_t disconnect_cb) + : tx_streamer_impl<chdr_tx_data_xport>(stream_args.channels.size(), stream_args) , _unique_id(STREAMER_ID + "#" + std::to_string(streamer_inst_ctr++)) , _stream_args(stream_args) + , _disconnect_cb(disconnect_cb) { _async_msg_queue = std::make_shared<tx_async_msg_queue>(ASYNC_MSG_QUEUE_SIZE); @@ -78,6 +80,13 @@ rfnoc_tx_streamer::rfnoc_tx_streamer( node_accessor.init_props(this); } +rfnoc_tx_streamer::~rfnoc_tx_streamer() +{ + if (_disconnect_cb) { + _disconnect_cb(_unique_id); + } +} + std::string rfnoc_tx_streamer::get_unique_id() const { return _unique_id; |