Release Notes

Open Source Used In AsyncOS 8.8 for Cisco Web Security Appliances
77
*entire* buffer (use the saved start address and buffer length;
ignore the current state of next_output_byte and free_in_buffer).
Then reset the pointer & count to the start of the buffer, and
return TRUE indicating that the buffer has been dumped.
free_in_buffer must be set to a positive value when TRUE is
returned. A FALSE return should only be used when I/O suspension is
desired (this operating mode is discussed in the next section).
term_destination (j_compress_ptr cinfo)
Terminate destination --- called by jpeg_finish_compress() after all
data has been written. In most applications, this must flush any
data remaining in the buffer. Use either next_output_byte or
free_in_buffer to determine how much data is in the buffer.
term_destination() is NOT called by jpeg_abort() or jpeg_destroy(). If you
want the destination manager to be cleaned up during an abort, you must do it
yourself.
You will also need code to create a jpeg_destination_mgr struct, fill in its
method pointers, and insert a pointer to the struct into the "dest" field of
the JPEG compression object. This can be done in-line in your setup code if
you like, but it's probably cleaner to provide a separate routine similar to
the jpeg_stdio_dest() or jpeg_mem_dest() routines of the supplied destination
managers.
Decompression source managers follow a parallel design, but with some
additional frammishes. The source manager struct contains a pointer and count
defining the next byte to read from the work buffer and the number of bytes
remaining:
const JOCTET * next_input_byte; /* => next byte to read from buffer */
size_t bytes_in_buffer; /* # of bytes remaining in buffer */
The library increments the pointer and decrements the count until the buffer
is emptied. The manager's fill_input_buffer method must reset the pointer and
count. In most applications, the manager must remember the buffer's starting
address and total size in private fields not visible to the library.
A data source manager provides five methods:
init_source (j_decompress_ptr cinfo)
Initialize source. This is called by jpeg_read_header() before any
data is actually read. Unlike init_destination(), it may leave
bytes_in_buffer set to 0 (in which case a fill_input_buffer() call
will occur immediately).
fill_input_buffer (j_decompress_ptr cinfo)
This is called whenever bytes_in_buffer has reached zero and more