View Full Version : Drawing into a flash movie clip from an External Projector
shawn_t
06-11-2007, 05:12 AM
Is there anyway to draw directly into a flash movie clip from the parent projector? I have a C++ application I'm using as the projector and I'd like to be able to BLIT directly into a flash movieclip. Maybe using ExternalInterface and the BitmapData structure. Is it possible? Is it fast?
shawn_t
06-13-2007, 09:24 PM
I've been doing some research into this and will document my ideas here just in case anybody wants to comment. Here are some ideas I'm researching:
1. Use ExternalInterface to send the frame data directly to the flash movie as a BitmapData object. Then render the BitmapData object to the movie clip using BitmapData.copyPixels. I need to research the following:
Research how to send a BitmapData object from the C++ projector to the Flash movie using the ExternalInterface XML string.
Determine how slow BitmapData.copyPixels is when it receives the data.
Research the packet size options for ExternalInterface [optimal, max]
2. Research Flash’s LocalConnection API to see if it is possible to open the connection between the C++ projector and the Flash movie of interest. If this is possible, then I'm hoping it will be easier/faster to send the data to the flash movie using the local connection instead of using ExternalInterface. Check out: sample code (http://osflash.org/localconnection)
3. Find some way to hack the data into the Video object of Flash. I have no idea whether this is even possible and it would depend greatly what formats the video object supports. If the video object supports uncompressed RAW frames, then perhaps this could be done but I don't really have any idea where to continue.
4. NOTE: This one is strange, but would actually be possible and I believe may provide the best performance. Write a "Virtual WebCam" device driver that the projector feeds with the desired frames. There is a bunch of virtual webcam software out there (e.g. WebCamDV takes firewire input, VirtualCamera broadcasts desktop images, video as a WEBCAM) so I know it is possible to write the driver. I have tried WebCamDV and it is recognized in Flash as a webcam and I can get HD quality video in the flash Video (object). However, I don't have any experience writing a device driver so that will be an interesting experience! Also, the virtual webcam will be viewable by all applications so someone using MSN Messenger, for example, will be able to view/broadcast my virtual webcam stream which may not be desired...
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.