Wednesday, May 9, 2012

Re: [Discuss-gnuradio] Block with two or more outputs, with different sizes

On Wed, May 9, 2012 at 3:06 PM, André Selva <andrefselva@gmail.com> 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?
>
> Thanks,
>
> --
> 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 :)

Tom

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

No comments:

Post a Comment