On 10/10/2016 01:22 AM, Chris Dreher wrote:
> Here is a brief summary of the original questions and their status here
> (TL;DR).
>
>
> 1.  Once put() is called for OUTPUT_BINARY, is there anyway to go back
> and change those bytes?

No. It is a continuous stream, and the producer of that stream has no 
knowledge of what receives that stream, by design.

> 2.  Is it acceptable to buffer most of the file data and then just output
> the entire file at the end?

No. That violates the principle that everything in sigrok (libsigrok and 
libsigrokdecode) is a continuous stream.

I realize that is not so easy to do with e.g. file formats that simply don't 
permit this, but in such cases it's perhaps worth thinking whether that file 
format is a good match for sigrok processing to begin with. It has not been 
a big problem so far.

> 3.  Is there a way to know that the end of the sample input stream has
> been reached?

No. The interface from a frontend to a PD is srd_session_send(), which takes 
a raw buffer of logic data.

If this were to be changed to be more like libsigrok, which sends packets 
with corresponding packet type, this would be more flexible. For example a 
packet type similar to libsigrok's SR_DF_END could be used to help here.

Another way to do this, though not as elegant as the above solution, would 
be to add a meta packet type to signal the end of the stream.

> 4.  (new question) Can put()'s parameters of startsample and endsample be
> used to insert data earlier into the file output or are these parameters
> ignored because the order of calls to put() determine the order bytes are
> output?

No. You can not expect any listener to that stream to be able to handle 
this, nor should you.


Don't mean to sound negative, but hey, straight answers :-)


-- 
Bert Vermeulen
b...@biot.com

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to