[squeak-dev] Re: Playing Flash movies in-image

John M McIntosh johnmci at smalltalkconsulting.com
Wed Dec 29 23:35:55 UTC 2010


So you want to draw bits, yes squeak draw bits from the bitmap of a form. 
So you want an external library to place bits into that form's bitmap. 

Oops problem, the squeak garbage collector wants to move the memory address of the bitmap, that won't work. 

The surface plugin puts an integer into the slot where the oops reference to the bits would. 
The surface plugin logic then interacts with the surface plugin client to say yes surface plugin form #72 actually points to that 
chunk of memory you allocated for me and when I'm asked to draw the form we take the data from over there, not from the 
Squeak image space. 

Over in the third party library we allocate the chunk of memory for our bits, tell the surfaceplugin logic who we are and where the memory address is and 
of course agree what the bits and shape is, we draw into our *shared* bits.. Everyone is happy.  


MMM I'm not sure I use the surface plugin for quicktime, rather I thought a Gworld was used and we copy the bytes. Been years, someone might look. 

Cough I will point out there is a bug in the surface plugin logic.  It seems the drawing loop for Form drawing actually reads one word over the end of the bitmap.
Disaster lurks when the form is a multiple of the operating system page size, and memory is allocated such that page 1-N are the form, but page N+1 is tagged as executable, or non-readable, etc... I *think* we reverted from using the surface plugin in Sophie to using a gworld and doing the copy just because we occasionally could get a crash  on a read page protection error.   

Fixing the draw loop was non-trival, you are welcome to do that... 


On 2010-12-29, at 1:54 PM, Chris Cunnington wrote:
> Yea... I'm not sure how that works: "splash onto the Tweak UI". A Form is full of bits. In an MPEGMoviePlayerMorph we have Forms full of
> bits for each frame, I suppose. But with the SurfacePlugin, we just have a Form defined location that contains nothing. I thought the SurfacePlugin
> created a surface that floated above Squeak controlled by the OS.

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================







More information about the Squeak-dev mailing list