-
Notifications
You must be signed in to change notification settings - Fork 16
Description
We would like to have some form of support for pdus. In the short term, there are a few questions that need to be answered to put this in. The new pmts provide more flexibility and stronger typing.
- What exactly is a pdu? The short answer is a dictionary and a vector of data. There was a question on the mailing list a little while back about have a dictionary and a string. The question really is, should a pdu be a (dict, vector) or a (dict, pmt)?
- Should there be one pdu for any type of vector or one per type of vector (i.e. is there a
pdu<int>,pdu<float>, etc or just apdu.) This has implications on the functions that one writes to process messages. If my function has a signaturevoid proc(pmtf::pdu<float> fthen I know that the data vector that I receive will be of the correct type. - Should there be any limits on the dictionary portion of the pdu?
In the long term, I think there are some important questions to answer about how metadata is handled in gnuradio. There is a desire to make it easy to write one processing function that works for streaming or packet based processing. I do not believe that there is an easy way to do this given the differences between tags and pdus. They just handle metadata differently. I'm not necessarily proposing that we figure out the perfect solution right now. I would like to know if there are things that can be done as I am implementing pdus that push us in the right direction. We are also going to want to add support for tags, so this could be of value there too.
I would argue that with tags and pdus, we have 3 kinds of metadata.
- Metadata that applies to a single sample (tags)
- Metadata that applies forever or until superceeded. (tags)
- Metadata that applies to a fixed duration of data. (pdus)
There are many possible solutions:
- Make tags more like pdus. The work function would receive a pdu instead of a buffer. There would be no need to call functions like get_tags_in_window.
- Make pdus more like tags. Add in functions such as get_tags_in_window that work on pdus.
- Support both in both places. The idea would be that we expand pdus and tags to support the 3 metadata cases above in a consistent manner.
I would like to hear thoughts on the matter.
@mormj @jacobagilbert