Skip to content

Commit 4b73906

Browse files
committed
feat(python): add queue_size arg to DataHandler
1 parent a1f8709 commit 4b73906

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

pyudmaio/src/DataHandlerPython.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ namespace udmaio {
1616
DataHandlerPython::DataHandlerPython(std::shared_ptr<UioAxiDmaIf> dma_ptr,
1717
std::shared_ptr<UioMemSgdma> desc_ptr,
1818
std::shared_ptr<DmaBufferAbstract> mem_ptr,
19-
bool receive_packets)
20-
: DataHandlerSync("DataHandlerPython", *dma_ptr, *desc_ptr, *mem_ptr, receive_packets)
19+
bool receive_packets,
20+
size_t queue_size)
21+
: DataHandlerSync("DataHandlerPython",
22+
*dma_ptr,
23+
*desc_ptr,
24+
*mem_ptr,
25+
receive_packets,
26+
queue_size)
2127
, _dma_ptr(dma_ptr)
2228
, _desc_ptr(desc_ptr)
2329
, _mem_ptr(mem_ptr) {}

pyudmaio/src/DataHandlerPython.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class DataHandlerPython : public DataHandlerSync {
3030
DataHandlerPython(std::shared_ptr<UioAxiDmaIf>,
3131
std::shared_ptr<UioMemSgdma>,
3232
std::shared_ptr<DmaBufferAbstract>,
33-
bool receive_packets = true);
33+
bool receive_packets = true,
34+
size_t queue_size = 64);
3435

3536
void start(int nr_pkts, size_t pkt_size, bool init_only = false);
3637
py::array_t<uint8_t> numpy_read(uint32_t ms_timeout = 0);

pyudmaio/src/PythonBinding.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ PYBIND11_MODULE(binding, m) {
124124
.def(py::init<std::shared_ptr<udmaio::UioAxiDmaIf>,
125125
std::shared_ptr<udmaio::UioMemSgdma>,
126126
std::shared_ptr<udmaio::DmaBufferAbstract>,
127-
bool>(),
127+
bool,
128+
size_t>(),
128129
py::arg("dma"),
129130
py::arg("desc"),
130131
py::arg("mem"),
131-
py::arg("receive_packets") = bool(true))
132+
py::arg("receive_packets") = bool(true),
133+
py::arg("queue_size") = size_t(64))
132134
.def("start",
133135
&udmaio::DataHandlerPython::start,
134136
py::arg("nr_pkts"),

0 commit comments

Comments
 (0)