discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to detect that the input item is empty?


From: Marcus Müller
Subject: Re: How to detect that the input item is empty?
Date: Mon, 13 Dec 2021 19:33:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

Linge,

> How to judge that this is the last input?

There's no way.

seriously, we discussed this yesterday. It's a bit tiring to explain things in chat, and then say exactly the same thing next day on the mailing list.

You cann't do it this way. Your framing must come from where you read the data.
By far the easiest way to achieve that is by writing a Python block that reads a file, adds a kind of header that says how many bytes of useful data will come, and then output the file, and add the trailing zeros.

Best regards,
Marcus

On 13.12.21 04:08, 能书能言 wrote:
Hi,all
I want to know how a block judges that input has been stopped? For example, my source has a total of 1000 samples, the number of input buffers is different each time, it may be 500, 100, 68... etc. When the input buffer has enough input, the work function will be called, but when the last set of data of 1000 samples has reached the input buffer, there will be no more input, and no more work functions will be called. When processing the last set of input data, I need to be able to judge that this is the last time the work function is called, and there will be no more input next, and then I will perform zero padding during the call to the work function this time.
How to judge that this is the last input? Thanks in advance.
Best Regards,
linge93



reply via email to

[Prev in Thread] Current Thread [Next in Thread]