[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 06/06: runtime: TSBs can now act as sources
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 06/06: runtime: TSBs can now act as sources |
Date: |
Tue, 9 Dec 2014 20:02:14 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 971d13ac09d2b3c191cb031111c0ef9204fa5fc8
Author: Martin Braun <address@hidden>
Date: Thu Dec 4 19:22:07 2014 +0100
runtime: TSBs can now act as sources
---
gnuradio-runtime/include/gnuradio/tagged_stream_block.h | 2 ++
gnuradio-runtime/lib/tagged_stream_block.cc | 12 +++++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/gnuradio-runtime/include/gnuradio/tagged_stream_block.h
b/gnuradio-runtime/include/gnuradio/tagged_stream_block.h
index 1fe92ee..86343f2 100644
--- a/gnuradio-runtime/include/gnuradio/tagged_stream_block.h
+++ b/gnuradio-runtime/include/gnuradio/tagged_stream_block.h
@@ -97,6 +97,8 @@ namespace gr {
*/
void /* final */ forecast (int noutput_items, gr_vector_int
&ninput_items_required);
+ bool check_topology(int ninputs, int /* noutputs */);
+
/*!
* - Reads the number of input items from the tags using
parse_length_tags()
* - Checks there's enough data on the input and output buffers
diff --git a/gnuradio-runtime/lib/tagged_stream_block.cc
b/gnuradio-runtime/lib/tagged_stream_block.cc
index c6d5fc1..252a235 100644
--- a/gnuradio-runtime/lib/tagged_stream_block.cc
+++ b/gnuradio-runtime/lib/tagged_stream_block.cc
@@ -89,6 +89,14 @@ namespace gr {
return;
}
+ bool
+ tagged_stream_block::check_topology(int ninputs, int /* noutputs */)
+ {
+ d_n_input_items_reqd.resize(ninputs, 0);
+ return true;
+ }
+
+
int
tagged_stream_block::general_work(int noutput_items,
gr_vector_int &ninput_items,
@@ -99,7 +107,9 @@ namespace gr {
return work(noutput_items, ninput_items, input_items, output_items);
}
- if(d_n_input_items_reqd[0] == 0) { // Otherwise, it's already set from a
previous call
+ // Read TSB tags, unless we...
+ // ...don't have inputs or ... ... we already set it in a previous run.
+ if(!d_n_input_items_reqd.empty() && d_n_input_items_reqd[0] == 0) {
std::vector<std::vector<tag_t> > tags(input_items.size(),
std::vector<tag_t>());
for(unsigned i = 0; i < input_items.size(); i++) {
get_tags_in_range(tags[i], i, nitems_read(i), nitems_read(i)+1);
- [Commit-gnuradio] [gnuradio] branch master updated (56f6953 -> 971d13a), git, 2014/12/09
- [Commit-gnuradio] [gnuradio] 04/06: Merge branch 'maint', git, 2014/12/09
- [Commit-gnuradio] [gnuradio] 02/06: grc: move convert hier into a child generator, git, 2014/12/09
- [Commit-gnuradio] [gnuradio] 05/06: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2014/12/09
- [Commit-gnuradio] [gnuradio] 06/06: runtime: TSBs can now act as sources,
git <=
- [Commit-gnuradio] [gnuradio] 03/06: grc: refactor/enhance hier block generation, git, 2014/12/09
- [Commit-gnuradio] [gnuradio] 01/06: Merge branch 'maint_grcwg' into master_grcwg, git, 2014/12/09