diff options
author | Aaron Rossetto <aaron.rossetto@ni.com> | 2019-09-27 14:56:25 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:32 -0800 |
commit | 2f97f8bd0167d4179427efa8a955046fbf417e91 (patch) | |
tree | 255c660b8bdff86047937a75a0f3b3798b1da73b /host/include | |
parent | 41f142050fb39ad533f82256b574b5c08c160bc1 (diff) | |
download | uhd-2f97f8bd0167d4179427efa8a955046fbf417e91.tar.gz uhd-2f97f8bd0167d4179427efa8a955046fbf417e91.tar.bz2 uhd-2f97f8bd0167d4179427efa8a955046fbf417e91.zip |
transport: Implement eov indications for Rx and Tx streams
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/types/metadata.hpp | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/host/include/uhd/types/metadata.hpp b/host/include/uhd/types/metadata.hpp index a29cae93c..8ec321e5f 100644 --- a/host/include/uhd/types/metadata.hpp +++ b/host/include/uhd/types/metadata.hpp @@ -31,14 +31,17 @@ struct UHD_API rx_metadata_t //! Reset values. void reset() { - has_time_spec = false; - time_spec = time_spec_t(0.0); - more_fragments = false; - fragment_offset = 0; - start_of_burst = false; - end_of_burst = false; - error_code = ERROR_CODE_NONE; - out_of_sequence = false; + has_time_spec = false; + time_spec = time_spec_t(0.0); + more_fragments = false; + fragment_offset = 0; + start_of_burst = false; + end_of_burst = false; + eov_positions = nullptr; + eov_positions_size = 0; + eov_positions_count = 0; + error_code = ERROR_CODE_NONE; + out_of_sequence = false; } //! Has time specification? @@ -70,6 +73,31 @@ struct UHD_API rx_metadata_t bool end_of_burst; /*! + * If this pointer is not null, it specifies the address of an array of + * `size_t`s into which the sample offset relative to the beginning of + * a call to `recv()` of each vector (as denoted by packets with the `eov` + * header byte set) will be written. + * + * The caller is responsible for allocating and deallocating the storage + * for the array and for indicating the maximum number of elements in + * the array via the `eov_positions_size` value below. + * + * Upon return from `recv()`, `eov_positions_count` will be updated to + * indicate the number of valid entries written to the + * `end_of_vector_positions` array. It shall never exceed the value of + * `eov_positions_size`. However, if in the process of `recv()`, storage + * for new positions is exhausted, then `recv()` shall return. + */ + size_t* eov_positions; + size_t eov_positions_size; + + /*! + * Upon return from `recv()`, holds the number of end-of-vector indications + * in the `eov_positions` array. + */ + size_t eov_positions_count; + + /*! * The error condition on a receive call. * * Note: When an overrun occurs in continuous streaming mode, @@ -151,6 +179,18 @@ struct UHD_API tx_metadata_t bool end_of_burst; /*! + * If this pointer is not null, it specifies the address of an array of + * `size_t`s specifying the sample offset relative to the beginning of + * the call to `send()` where an EOV should be signalled. + * + * The caller is responsible for allocating and deallocating the storage + * for the array and for indicating the maximum number of elements in + * the array via the `eov_positions_size` value below. + */ + size_t* eov_positions = nullptr; + size_t eov_positions_size = 0; + + /*! * The default constructor: * Sets the fields to default values (flags set to false). */ |