XML Feeds

.

[jitter] lua gencoord

(())_n kinomatic at gmail.com
Wed Oct 24 17:15:50 MDT 2007


On Oct 24, 2007, at 3:02 PM, Wesley Smith wrote:

> You don't have to call it on the draw but it can be convenient.  If
> you're not using opengl, you can just send a message to output a frame
> whenever you want.
>
> wes

Hi Wes, Mark,

Yes I was just trying to think to keep the CPU and GPU processes  
separate.
Will see what is more effective in the long run.

So I now made a player based on your input. I noticed that if I call  
a local matrix on every draw() or play() for the matrixcalc it slowed  
down and crashed after a while. So now I create the processing matrix  
in the setup. With this code I noticed that dozer.mov and other short  
movies play fine, but that the frame rate drops proportionately on  
longer movie files with the same photo-jpeg 320x240 compression  
settings. The longer files play fast in jit.qt.movie in a patch. I  
went back to jitter 1.6.3 but it didn't change anything.

The patch and code here (and below):
http://home.earthlink.net/~posit/lua/

(())_n

--  code es.play.lua

render_context = this.drawto
autogarbage = 1
autowatch = 1
gc = 1

function script_load()
	vmovie = jit.new("jit.qt.movie")
	vmovie.colormode = "uyvy"
	vmovie.adapt = 1
	vplane = jit.new("jit.gl.videoplane", render_context)
	vplane.colormode = "uyvy"
	vplane.scale = {1.333, 1., 1.}
	vframe = jit.matrix(4, "char", 320, 240)
end

function read(a)
	vmovie:read(a)
end

function play()
	if (vmovie.framecount > 0) then
		vmovie:matrixcalc(vframe.name, vframe.name)
		outlet(0, "jit_matrix", vframe.name)
	end
end

function draw()
	if (vmovie.framecount > 0) then
		vmovie:matrixcalc(vframe.name, vframe.name)
		vplane:jit_matrix(vframe.name)
	end
end


-- play patch:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 314 243 48 196617 loadbang;
#P message 314 269 82 196617 colormode uyvy;
#P user jit.pwindow 135 303 322 242 0 1 0 0 1 0;
#P newex 292 150 183 196617 jit.gl.handle bar @inherit_transform 1;
#P newex 292 192 127 196617 jit.gl.render bar @ortho 2;
#P newex 300 218 76 196617 jit.window bar;
#P message 208 192 80 196617 read dozer.mov;
#P message 171 193 30 196617 read;
#P message 136 193 29 196617 play;
#P user jit.fpsgui 66 141 60 196617 0;
#P newex 145 110 30 196617 t b b;
#P user gswitch2 136 140 39 32 0 0;
#P newex 136 237 64 196617 prepend call;
#P toggle 145 53 15 0;
#P newex 145 79 57 196617 qmetro 20;
#P newex 136 268 143 196617 jit.gl.lua bar @file es.play.lua;
#P comment 416 270 38 196617 (())_n;
#P connect 16 0 15 0;
#P connect 13 0 12 0;
#P fasten 5 1 12 0 170 178 297 178;
#P connect 6 1 5 1;
#P connect 2 0 6 0;
#P connect 3 0 2 0;
#P connect 1 0 14 0;
#P fasten 15 0 14 0 319 294 141 294;
#P connect 4 0 1 0;
#P connect 9 0 4 0;
#P connect 10 0 4 0;
#P connect 8 0 4 0;
#P connect 5 0 8 0;
#P fasten 6 0 7 0 150 134 71 134;
#P window clipboard copycount 17;



More information about the jitter mailing list