Block with two or more outputs, with different sizes

Hi!

I’m creating a signal processing block in C++, and I want my block to
separate the source information into two different outputs, according to
a
pattern. The problem is that the outputs have different sizes, and, as a
I
return noutput_items in the work method, the outputs are completed with
zeros until they have all the same size. Is it possible to have
different
output sizes in the block?

Thanks,

On 05/09/2012 12:06 PM, Andr S. wrote:

Hi!

I’m creating a signal processing block in C++, and I want my block to
separate the source information into two different outputs, according to a
pattern. The problem is that the outputs have different sizes, and, as a I
return noutput_items in the work method, the outputs are completed with
zeros until they have all the same size. Is it possible to have different
output sizes in the block?

ok yes, see io_signaturev and some of the convenience factory functions
here:
http://gnuradio.org/cgit/gnuradio.git/tree/gnuradio-core/src/lib/runtime/gr_io_signature.h

-josh

Josh,

The problem is that i don’t know in advance the size of each stream. I’m
kind of routing the input stream to the output streams, according to
some
information i read in each packet. So, I know a max value to the stream
number of items, but cannot know certainly the output actual size.

Att,

2012/5/9 Josh B. [email protected]

On Wed, May 9, 2012 at 3:06 PM, Andr S. [email protected]
wrote:


Andr F. B. Selva

Andre,

You can call “produce(which_output, how_many_items)” yourself inside
the work function. When you return, instead of returning
noutput_items, return WORK_CALLED_PRODUCE (or -2). The ‘produce’
handles updating the write buffers, and the return tells the scheduler
not to do anything more with the pointers.

I’ve never used this myself, so be careful :slight_smile:

Tom