Hello Experts,
I have developed an NPAPI plugin which displays and manipulates images, the image to be displayed in the plugin is specified via the "src" attribute of the embed tag.
The browser loads the image specified by the "src" attribute and calls my plugin to deliver the image. The calls I receive are in the following order:
- NPP_NewStream(): with NPMIMEType = "image/jpeg"
- NPP_WriteReady() & NPP_Write(): multiple times until the image is fully read
- NPP_DestroyStream(): When the image is fully delivered (or an error occurs)
I recently decided to add support for motion jpeg video (MJPEG), which is basically a series of jpeg images in the same HTTP stream separated by a special separator, the response type of the "src" attribute in this case would have an initial MIME type of "multipart/x-mixed-replace" and then "image/jpeg" for each jpeg frame. (BTW, chrome and firefox can handle motion jpeg video when the url is typed directly in the address bar)
So far, I haven't been able to get the browser to deliver the motion jpeg stream to the plugin; the browser does initiate the communication with the motion jpeg server and retrieves the HTTP headers and the headers of the first frame, but fails to deliver the first image and calls NPP_DestroyStream() with reason=NPRES_NETWORK_ERR
Here is a more detailed description of what is going on:
- Browser calls NPP_NewStream() with NPMIMEType="multipart/x-mixed-replace" and *stype = NP_NORMAL
- Browser calls NPP_NewStream() again with NPMIMEType="image/jpeg" and *stype = NP_NORMAL (the stream pointer I receive here is the same as the one received in the previous call to NPP_NewStream)
- Browser calls NPP_WriteReady(): my plugin returns 100 * 1024
- Browser calls NPP_Write() and delivers 711 bytes
- Browser calls NPP_DestroyStream() with reason = NPRES_NETWORK_ERR
I never managed to get the browser to read any frames for me. I'm not sure if Mixed-Replace mime type is supposed to be used with NPAPI plugins but I'm thinking why not?
I'm using Chromium 11.0.696.71 and have seen this behavior on Windows 7 64-bit and 32-bit
Can some one enlighten me what could be the problem?
Thanks very much...
Khalid.


LinkBack URL
About LinkBacks



Reply With Quote