[Discuss-gnuradio] How to check if more input is available on an input s
From:
Mir Ali
Subject:
[Discuss-gnuradio] How to check if more input is available on an input stream
Date:
Wed, 7 Jan 2009 04:44:39 -0600
Hi, I have a simple question. I have a block that has 2 input streams and the inputs are consumed at different rates. For each 1 input consumed on the first input stream N inputs are consumed in the second stream.
The forecast function and set_multiple call of this block are as shown below,
my_new_block::forecast(int noutput_items,gr_vector_int &ninput_items_required){ assert(noutput_items % N==0); # the
int items_on_first_input_stream = noutput_items; int items_on_second_input_stream = noutput_items/(8*N); ninput_items_required[0]=items_on_first_input_stream; ninput_items_required[1]=items_on_data_input_stream;
}
{ set_output_multiple(8*N); # the output items are a multiple of 8*N.
} For each (8*N) inputs consumed on second stream 1 input is consumed on first stream. If the first stream has uninterrupted supply but the second one doesn't then how should I check if input is available on the second stream. Will the input_vector contain NULL values when nothing is in it? If it is true should i just do