I'm writing a socket-based MJPEG video feed display in Flex.
I have written a custom byte buffer, which queues up data from
socket until a full JPEG is present. When a JPEG is present, these
bytes are written into a ByteArray and loaded with a Loader object
(through loadBytes). This loader object is the child of one of two
Image controls, which alternate into visibility for double
The issue I'm having is I cannot achieve more than 17 frames
per second. Under the previous Java implementation, I was able to
get 30 frames per second. Increasing the application framerate to
60 helps (I can match the java performance), but I do not want to
do this since it screws up other component animations. I have
narrowed down the issue to the Loader.loadBytes method. The
asynchronous event handling of the load completion significantly
slows down the load time. Without the call, the system processes
the jpeg bytes at over 30 frames per second.
Is there any alternative way to get the ByteArray into the
Image other than using loadBytes? I'm grateful for any suggestions
or advice. Thanks!