Closed pwicks86 closed 6 years ago
I think it should be possible to add annotations via either stream tags or messages, but for global metadata it doesn't seem like you'd ever want to use a stream tag. It might be practical to just have a single message port: if a message is received with a timestamp or sample offset, it's an annotation, otherwise, it's a global metadata key/value pair.
How about this:
set_annotation_meta(uint64_t sample_start, uint64_t sample_count, std::string key, pmt::pmt_t val)
. If there's already an annotation with the same sample start and count, then we add to that, otherwise we make a new one. set_global_meta
functions to more or less match this same signature (i.e. remove the 5 overloads and just have it take a pmt::pmt_t
)commands
{
'cmd': 'set_annotation_meta',
'sample_start': 23423,
'sample_count': 1000,
'key': 'core:comment',
'val': 'This is some interesting data'
}
The only other question then is whether it makes sense to have any api to create new capture segments apart from stream tags.
Made a PR with my proposed changes for review, see #5
Closed via #5
It seems like it would be nice if the sink block could create new metadata based on received messages. What should the api surface for this look like? Should it be via a separate port? Should there also be corresponding methods to add metadata? Does it make sense to do both capture and annotation segments this way?