Loading...
Searching...
No Matches
stream.hpp
Go to the documentation of this file.
//
// Copyright 2011-2013 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/rfnoc/actions.hpp>
#include <uhd/types/device_addr.hpp>
#include <uhd/types/ref_vector.hpp>
#include <uhd/types/stream_cmd.hpp>
#include <uhd/utils/noncopyable.hpp>
#include <cstddef>
#include <memory>
#include <string>
#include <vector>
namespace uhd {
struct async_metadata_t;
struct rx_metadata_t;
struct tx_metadata_t;
struct UHD_API stream_args_t
{
stream_args_t(const std::string& cpu = "", const std::string& otw = "")
{
cpu_format = cpu;
otw_format = otw;
}
std::string cpu_format;
std::string otw_format;
device_addr_t args;
std::vector<size_t> channels;
};
class UHD_API rx_streamer : uhd::noncopyable
{
public:
typedef std::shared_ptr<rx_streamer> sptr;
virtual ~rx_streamer(void);
virtual size_t get_num_channels(void) const = 0;
virtual size_t get_max_num_samps(void) const = 0;
typedef ref_vector<void*> buffs_type;
virtual size_t recv(const buffs_type& buffs,
const size_t nsamps_per_buff,
rx_metadata_t& metadata,
const double timeout = 0.1,
const bool one_packet = false) = 0;
virtual void issue_stream_cmd(const stream_cmd_t& stream_cmd) = 0;
virtual void post_input_action(
const std::shared_ptr<uhd::rfnoc::action_info>& action, const size_t port) = 0;
};
class UHD_API tx_streamer : uhd::noncopyable
{
public:
typedef std::shared_ptr<tx_streamer> sptr;
virtual ~tx_streamer(void);
virtual size_t get_num_channels(void) const = 0;
virtual size_t get_max_num_samps(void) const = 0;
typedef ref_vector<const void*> buffs_type;
virtual size_t send(const buffs_type& buffs,
const size_t nsamps_per_buff,
const tx_metadata_t& metadata,
const double timeout = 0.1) = 0;
virtual bool recv_async_msg(
async_metadata_t& async_metadata, double timeout = 0.1) = 0;
virtual void post_output_action(
const std::shared_ptr<uhd::rfnoc::action_info>& action, const size_t port) = 0;
};
} // namespace uhd
actions.hpp
uhd::device_addr_t
Definition device_addr.hpp:39
uhd::ref_vector
Definition ref_vector.hpp:22
uhd::rx_streamer
Definition stream.hpp:170
uhd::rx_streamer::buffs_type
ref_vector< void * > buffs_type
Typedef for a pointer to a single, or a collection of recv buffers.
Definition stream.hpp:183
uhd::rx_streamer::sptr
std::shared_ptr< rx_streamer > sptr
Definition stream.hpp:172
uhd::rx_streamer::post_input_action
virtual void post_input_action(const std::shared_ptr< uhd::rfnoc::action_info > &action, const size_t port)=0
uhd::rx_streamer::~rx_streamer
virtual ~rx_streamer(void)
uhd::rx_streamer::issue_stream_cmd
virtual void issue_stream_cmd(const stream_cmd_t &stream_cmd)=0
uhd::rx_streamer::get_num_channels
virtual size_t get_num_channels(void) const =0
Get the number of channels associated with this streamer.
uhd::rx_streamer::get_max_num_samps
virtual size_t get_max_num_samps(void) const =0
Get the max number of samples per buffer per packet.
uhd::rx_streamer::recv
virtual size_t recv(const buffs_type &buffs, const size_t nsamps_per_buff, rx_metadata_t &metadata, const double timeout=0.1, const bool one_packet=false)=0
uhd::tx_streamer
Definition stream.hpp:323
uhd::tx_streamer::~tx_streamer
virtual ~tx_streamer(void)
uhd::tx_streamer::recv_async_msg
virtual bool recv_async_msg(async_metadata_t &async_metadata, double timeout=0.1)=0
uhd::tx_streamer::sptr
std::shared_ptr< tx_streamer > sptr
Definition stream.hpp:325
uhd::tx_streamer::buffs_type
ref_vector< const void * > buffs_type
Typedef for a pointer to a single, or a collection of send buffers.
Definition stream.hpp:336
uhd::tx_streamer::get_max_num_samps
virtual size_t get_max_num_samps(void) const =0
Get the max number of samples per buffer per packet.
uhd::tx_streamer::post_output_action
virtual void post_output_action(const std::shared_ptr< uhd::rfnoc::action_info > &action, const size_t port)=0
uhd::tx_streamer::send
virtual size_t send(const buffs_type &buffs, const size_t nsamps_per_buff, const tx_metadata_t &metadata, const double timeout=0.1)=0
uhd::tx_streamer::get_num_channels
virtual size_t get_num_channels(void) const =0
Get the number of channels associated with this streamer.
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
device_addr.hpp
uhd
Definition build_info.hpp:12
uhd::noncopyable
boost::noncopyable noncopyable
Definition noncopyable.hpp:45
noncopyable.hpp
ref_vector.hpp
stream_cmd.hpp
uhd::async_metadata_t
Definition metadata.hpp:203
uhd::rx_metadata_t
Definition metadata.hpp:23
uhd::stream_args_t::otw_format
std::string otw_format
Definition stream.hpp:95
uhd::stream_args_t::args
device_addr_t args
Definition stream.hpp:132
uhd::stream_args_t::cpu_format
std::string cpu_format
Definition stream.hpp:75
uhd::stream_args_t::stream_args_t
stream_args_t(const std::string &cpu="", const std::string &otw="")
Convenience constructor for streamer args.
Definition stream.hpp:53
uhd::stream_args_t::channels
std::vector< size_t > channels
Definition stream.hpp:161
uhd::stream_cmd_t
Definition stream_cmd.hpp:40
uhd::tx_metadata_t
Definition metadata.hpp:163