summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2013-05-12 09:46:25 +1000
committerJohnathan Corgan <johnathan@corganlabs.com>2013-05-12 09:46:25 +1000
commit792302fbdfa37cf680234353dbe973886c4b2898 (patch)
treee999bcf6dbfe12cf19ae49b1762cd71d724aa8ae /gnuradio-runtime/lib
parenta7adf4689b58d91bd88d0dc948b017e1d42bff01 (diff)
parent9851f2377d099ffe72312375e7f761f66b664aa6 (diff)
Merge branch 'next' into runtime_pimpl
Catches up runtime_pimpl branch with changes on next since the initial branch start. Conflicts: gnuradio-runtime/include/gnuradio/constants.h gnuradio-runtime/include/gnuradio/tags.h gnuradio-runtime/include/gr_block_detail.h gnuradio-runtime/include/gr_buffer.h gnuradio-runtime/lib/CMakeLists.txt gnuradio-runtime/lib/gr_block.cc gnuradio-runtime/lib/gr_block_detail.cc gnuradio-runtime/lib/gr_block_executor.cc gnuradio-runtime/lib/gr_buffer.cc gnuradio-runtime/lib/gr_realtime.cc gr-blocks/lib/interleaved_short_to_complex_impl.cc
Diffstat (limited to 'gnuradio-runtime/lib')
-rw-r--r--gnuradio-runtime/lib/CMakeLists.txt12
-rw-r--r--gnuradio-runtime/lib/block.cc6
-rw-r--r--gnuradio-runtime/lib/block_detail.cc16
-rw-r--r--gnuradio-runtime/lib/block_executor.cc8
-rw-r--r--gnuradio-runtime/lib/buffer.cc17
-rw-r--r--gnuradio-runtime/lib/controlport/frontend.ice5
-rw-r--r--gnuradio-runtime/lib/realtime.cc2
7 files changed, 37 insertions, 29 deletions
diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt
index 3206e3c224..a87141cb92 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -69,8 +69,6 @@ GR_INCLUDE_SUBDIRECTORY(math)
# Setup library
########################################################################
list(APPEND gnuradio_runtime_sources
- complex_vec_test.cc
- malloc16.c
basic_block.cc
block.cc
block_detail.cc
@@ -79,6 +77,7 @@ list(APPEND gnuradio_runtime_sources
block_registry.cc
buffer.cc
circular_file.cc
+ complex_vec_test.cc
feval.cc
flat_flowgraph.cc
flowgraph.cc
@@ -87,6 +86,7 @@ list(APPEND gnuradio_runtime_sources
io_signature.cc
local_sighandler.cc
logger.cc
+ malloc16.c
message.cc
misc.cc
msg_accepter.cc
@@ -94,10 +94,6 @@ list(APPEND gnuradio_runtime_sources
msg_queue.cc
pagesize.cc
prefs.cc
- tagged_stream_block.cc
- test.cc
- top_block.cc
- top_block_impl.cc
realtime.cc
scheduler.cc
scheduler_sts.cc
@@ -108,6 +104,10 @@ list(APPEND gnuradio_runtime_sources
sync_decimator.cc
sync_interpolator.cc
sys_paths.cc
+ tagged_stream_block.cc
+ test.cc
+ top_block.cc
+ top_block_impl.cc
tpb_detail.cc
tpb_thread_body.cc
vmcircbuf.cc
diff --git a/gnuradio-runtime/lib/block.cc b/gnuradio-runtime/lib/block.cc
index b38377e856..4246180d80 100644
--- a/gnuradio-runtime/lib/block.cc
+++ b/gnuradio-runtime/lib/block.cc
@@ -240,7 +240,7 @@ namespace gr {
block::remove_item_tag(unsigned int which_input,
const tag_t &tag)
{
- d_detail->remove_item_tag(which_input, tag);
+ d_detail->remove_item_tag(which_input, tag, unique_id());
}
void
@@ -248,7 +248,7 @@ namespace gr {
unsigned int which_output,
uint64_t start, uint64_t end)
{
- d_detail->get_tags_in_range(v, which_output, start, end);
+ d_detail->get_tags_in_range(v, which_output, start, end, unique_id());
}
void
@@ -257,7 +257,7 @@ namespace gr {
uint64_t start, uint64_t end,
const pmt::pmt_t &key)
{
- d_detail->get_tags_in_range(v, which_output, start, end, key);
+ d_detail->get_tags_in_range(v, which_output, start, end, key, unique_id());
}
block::tag_propagation_policy_t
diff --git a/gnuradio-runtime/lib/block_detail.cc b/gnuradio-runtime/lib/block_detail.cc
index a3ab4b3f7b..293412f513 100644
--- a/gnuradio-runtime/lib/block_detail.cc
+++ b/gnuradio-runtime/lib/block_detail.cc
@@ -171,14 +171,14 @@ namespace gr {
}
void
- block_detail::remove_item_tag(unsigned int which_input, const tag_t &tag)
+ block_detail::remove_item_tag(unsigned int which_input, const tag_t &tag, long id)
{
if(!pmt::is_symbol(tag.key)) {
throw pmt::wrong_type("block_detail::add_item_tag key", tag.key);
}
else {
// Add tag to gr_buffer's deque tags
- d_input[which_input]->buffer()->remove_item_tag(tag);
+ d_input[which_input]->buffer()->remove_item_tag(tag, id);
}
}
@@ -186,10 +186,11 @@ namespace gr {
block_detail::get_tags_in_range(std::vector<tag_t> &v,
unsigned int which_input,
uint64_t abs_start,
- uint64_t abs_end)
+ uint64_t abs_end,
+ long id)
{
// get from gr_buffer_reader's deque of tags
- d_input[which_input]->get_tags_in_range(v, abs_start, abs_end);
+ d_input[which_input]->get_tags_in_range(v, abs_start, abs_end, id);
}
void
@@ -197,14 +198,15 @@ namespace gr {
unsigned int which_input,
uint64_t abs_start,
uint64_t abs_end,
- const pmt::pmt_t &key)
+ const pmt::pmt_t &key,
+ long id)
{
std::vector<tag_t> found_items;
v.resize(0);
// get from gr_buffer_reader's deque of tags
- d_input[which_input]->get_tags_in_range(found_items, abs_start, abs_end);
+ d_input[which_input]->get_tags_in_range(found_items, abs_start, abs_end, id);
// Filter further by key name
pmt::pmt_t itemkey;
@@ -261,6 +263,7 @@ namespace gr {
d_avg_noutput_items = noutput_items;
d_var_noutput_items = 0;
for(size_t i=0; i < d_input.size(); i++) {
+ gr::thread::scoped_lock guard(*d_output[i]->mutex());
float pfull = static_cast<float>(d_input[i]->items_available()) /
static_cast<float>(d_input[i]->max_possible_items_available());
d_ins_input_buffers_full[i] = pfull;
@@ -268,6 +271,7 @@ namespace gr {
d_var_input_buffers_full[i] = 0;
}
for(size_t i=0; i < d_output.size(); i++) {
+ gr::thread::scoped_lock guard(*d_output[i]->mutex());
float pfull = 1.0f - static_cast<float>(d_output[i]->space_available()) /
static_cast<float>(d_output[i]->bufsize());
d_ins_output_buffers_full[i] = pfull;
diff --git a/gnuradio-runtime/lib/block_executor.cc b/gnuradio-runtime/lib/block_executor.cc
index 8059ea2d5a..b0eb2eccee 100644
--- a/gnuradio-runtime/lib/block_executor.cc
+++ b/gnuradio-runtime/lib/block_executor.cc
@@ -93,7 +93,7 @@ namespace gr {
static bool
propagate_tags(block::tag_propagation_policy_t policy, block_detail *d,
const std::vector<uint64_t> &start_nitems_read, double rrate,
- std::vector<tag_t> &rtags)
+ std::vector<tag_t> &rtags, long block_id)
{
// Move tags downstream
// if a sink, we don't need to move downstream
@@ -109,7 +109,7 @@ namespace gr {
// every tag on every input propogates to everyone downstream
for(int i = 0; i < d->ninputs(); i++) {
d->get_tags_in_range(rtags, i, start_nitems_read[i],
- d->nitems_read(i));
+ d->nitems_read(i), block_id);
std::vector<tag_t>::iterator t;
if(rrate == 1.0) {
@@ -135,7 +135,7 @@ namespace gr {
if(d->ninputs() == d->noutputs()) {
for(int i = 0; i < d->ninputs(); i++) {
d->get_tags_in_range(rtags, i, start_nitems_read[i],
- d->nitems_read(i));
+ d->nitems_read(i), block_id);
std::vector<tag_t>::iterator t;
for(t = rtags.begin(); t != rtags.end(); t++) {
@@ -450,7 +450,7 @@ namespace gr {
if(!propagate_tags(m->tag_propagation_policy(), d,
d_start_nitems_read, m->relative_rate(),
- d_returned_tags))
+ d_returned_tags, m->unique_id()))
goto were_done;
if(n == block::WORK_DONE)
diff --git a/gnuradio-runtime/lib/buffer.cc b/gnuradio-runtime/lib/buffer.cc
index 1bcfc2a6e4..cd6feefe34 100644
--- a/gnuradio-runtime/lib/buffer.cc
+++ b/gnuradio-runtime/lib/buffer.cc
@@ -228,13 +228,12 @@ namespace gr {
}
void
- buffer::remove_item_tag(const tag_t &tag)
+ buffer::remove_item_tag(const tag_t &tag, long id)
{
gr::thread::scoped_lock guard(*mutex());
for(std::deque<tag_t>::iterator it = d_item_tags.begin(); it != d_item_tags.end(); ++it) {
if(*it == tag) {
- d_item_tags.erase(it);
- break;
+ (*it).marked_deleted.push_back(id);
}
}
}
@@ -315,7 +314,8 @@ namespace gr {
void
buffer_reader::get_tags_in_range(std::vector<tag_t> &v,
uint64_t abs_start,
- uint64_t abs_end)
+ uint64_t abs_end,
+ long id)
{
gr::thread::scoped_lock guard(*mutex());
@@ -327,9 +327,14 @@ namespace gr {
item_time = (*itr).offset;
if((item_time >= abs_start) && (item_time < abs_end)) {
- v.push_back(*itr);
+ std::vector<long>::iterator id_itr;
+ id_itr = std::find(itr->marked_deleted.begin(), itr->marked_deleted.end(), id);
+ if (id_itr == itr->marked_deleted.end()) { // If id is not in the vector of marked blocks
+ v.push_back(*itr);
+ v.back().marked_deleted.clear();
+ }
}
-
+
itr++;
}
}
diff --git a/gnuradio-runtime/lib/controlport/frontend.ice b/gnuradio-runtime/lib/controlport/frontend.ice
index b7474f37bf..50d056df72 100644
--- a/gnuradio-runtime/lib/controlport/frontend.ice
+++ b/gnuradio-runtime/lib/controlport/frontend.ice
@@ -98,15 +98,14 @@ module GNURadio {
idempotent void setInfo(string k, string v) throws ReceiverFailure, NotSupported, InvalidSetting;
};
- interface Channel {
+ interface Channel extends Tuner {
void start();
void stop();
void destroyChannel() throws NotSupported;
idempotent bool active();
- idempotent ChannelStatus status();
+ idempotent ChannelStatus channelStat();
idempotent StreamInfo stream();
idempotent bool setComplex(bool complex) throws ReceiverFailure, NotSupported, InvalidSetting;
- idempotent void setInfo(string k, string v) throws ReceiverFailure, NotSupported, InvalidSetting;
idempotent void setStreamInfo(string k, string v) throws ReceiverFailure, NotSupported, InvalidSetting;
};
diff --git a/gnuradio-runtime/lib/realtime.cc b/gnuradio-runtime/lib/realtime.cc
index 81f92ae488..e3fea1c6a6 100644
--- a/gnuradio-runtime/lib/realtime.cc
+++ b/gnuradio-runtime/lib/realtime.cc
@@ -31,7 +31,7 @@ namespace gr {
rt_status_t
enable_realtime_scheduling()
{
- return enable_realtime_scheduling();
+ return gr::enable_realtime_scheduling();
}
} /* namespace gr */