In looking at how to output files from protocol decoders, I have the following 
questions:
1.  Once put() is called for OUTPUT_BINARY, is there anyway to go back and 
change those bytes?  This is especially useful for adjusting file headers based 
on sample inputs the come later in the stream.  For example, the i2s PD can 
output a WAV file.  However, because the WAV file headers include a size field 
and these headers are written out first and before the rest of the sample 
inputs are handled, the current i2s code is just hardcoding a corrupt size 
field.  While some media players are forgiving for WAV files, other non-WAV 
file formats have strict size fields.
2.  Is it acceptible to buffer most of the file data and then just output the 
entire file at the end?  Again, this relates to file headers.  Theoretically, a 
PD could buffer the file data until it reaches the end of the sample inputs, 
then calculate the size fields, and finally call put() to output the entire 
file at once.  Are there memory limits in python, similar to Java VM memory 
limits, or is memory only limited by the OS's memory limits?
3.  Is there a way to know that the end of the sample input stream has been 
reached?  This way, a PD would know that there is no more data and that 
decoding is done.  This would prevent a PD from waiting any further for sample 
inputs that will never come.
-Chris
------------------------------------------------------------------------------
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