matrix-output

Jul 28, 2008 at 12:23am

matrix-output

hello everyone.

i try to copy a matrix to the output matrix, but somehow it does not work… i red this forum-entry up and down, but could not find the correct way to do this.

http://www.cycling74.com/forums/index.php?t=msg&goto=127057&rid=0&S=9267b2c47adb48f9432155790a0912c1&srch=copy+to+output+matrix#msg_127057

heres some piece of code from the matrix_calc function:

//x->vmatrix is the matrix i want to output. i obtain this matrix like this:
//err = (t_jit_err)jit_object_method(x->qtmovie, _jit_sym_getmatrix, NULL, x->vmatrix);
//where x->qtmovie is a jit_qt_movie object…

out_matrix = jit_object_method(outputs,_jit_sym_getindex,0);
a = jit_object_method(out_matrix, _jit_sym_getmatrix); //i also tried without this…

if (x&&out_matrix&&a) {
out_savelock = (long) jit_object_method(out_matrix,_jit_sym_lock,1);

jit_object_method(x->vmatrix,_jit_sym_getinfo,&info);
jit_object_method(a,_jit_sym_setinfo,&info);
//jit_object_method(out_matrix,_jit_sym_setinfo,&info); //also tried this

jit_object_method(a,_jit_sym_frommatrix,x->vmatrix,NULL);
//jit_object_method(out_matrix,_jit_sym_frommatrix,x->vmatrix,NULL); //also tried

out:
jit_object_method(out_matrix,_jit_sym_lock,out_savelock);
return err;

if i catch the matrix-outlet of the object, the dimension, planecount, type is set correct, but the content is all 0.
whats wrong there? i cant get it.

do i have to use the x->vmatrix or can i connect the output of the internal jit_qt_movie object to the output of this wrapper-external? i have the feeling copying matrices around is not the most efficient way…

thanks for any hints!
io

#39023
Jul 28, 2008 at 9:32am

What’s x->vmatrix? Maybe you could send some more complete code?

jb

Am 28.07.2008 um 02:23 schrieb ingo randolf:

> i try to copy a matrix to the output matrix, but somehow it does not
> work… i red this forum-entry up and down, but could not find the
> correct way to do this.

#136835
Jul 28, 2008 at 6:41pm

vmatrix is a pointer in the main structure:

typedef struct _jit_threaded_qt
{
t_jit_object ob;
void *x_pthread; //worker
void *vmatrix; //video matrix
Boolean flag;
} t_jit_threaded_qt

so, basically what i want to do, is to setup a thread, install a jit_qt_movie there, grab the matrix out of the jit_qt_movie, and in the first shot just send it to the output of this external.

so in the runloop of the thread i grab the matrix from the movie like this:

jit_object_method(qtmovie, _jit_sym_getmatrix, NULL, x->vmatrix);

and want to output the matrix, whenever the matrix_calc method is called…
here the whole matrix_calc function as i thought i should/could work:

t_jit_err jit_thqt_matrix_calc(t_jit_hello *x, void *inputs, void *outputs)
{
long out_savelock;
t_jit_matrix_info info;
void *out_matrix;
void *a;

out_matrix = jit_object_method(outputs,_jit_sym_getindex,0);
a = jit_object_method(out_matrix, _jit_sym_getmatrix);

if (x&&out_matrix&&a) {
out_savelock = (long) jit_object_method(out_matrix,_jit_sym_lock,1);

jit_object_method(x->vmatrix,_jit_sym_getinfo,&info); //get the info from the vmatrix
jit_object_method(a,_jit_sym_setinfo,&info); //set the info of the outputmatrix

jit_object_method(a,_jit_sym_frommatrix,x->vmatrix ,NULL); //copy the vmatrix to the outputmatrix ?

} else {
return JIT_ERR_INVALID_PTR;
}

out:
jit_object_method(out_matrix,_jit_sym_lock,out_savelock);
return err;
}

io

#136836

You must be logged in to reply to this topic.