-1

Having a problem when trying to render a Camera Preview buffer into an opengl renderer in BB10 (but relevant to any platform). My renderer is just a basic open gl renderer that goes through a relatively infinite render loop however im looking to send in the camera preview buffer from my camera class (where i instantiate my renderer) as so

myThread = new QThread();
renderer = new BPRenderer();
renderer->moveToThread(myThread);
connect(myThread, SIGNAL(started()), renderer, SLOT(run()));
connect(this, SIGNAL(NewTexture(int)), renderer, SLOT(SetTextureFromRaw(unsigned char*)));
myThread->start();

So the emit function is:

emit this->NewTexture(camera->buf);

so thats pretty basic and i know its getting updated fine. But it seems i may be having a problem in my threading as although the run signal runs fine, my settexturefromraw slot never gets triggered, i tried setting it to a local camera function to check it isnt the camera(this) function but that was working fine so im sure its the settexturefromrawfunc.

If anyone has any ideas throw them at me because this has had me for quite a while! Cheers

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
James
  • 93
  • 1
  • 1
  • 5

1 Answers1

0

Check the console output (you may need to SSH into the device and do "slog2info") to see if the signal is actually being connected. Without seeing the rest of the code it's hard to be sure, but I would guess that the arguments for NewTexture don't match.

In the connect call, you are connecting to NewTexture(int). When you emit it, you are calling this->NewTexture(camera->buf). By the argument name, that looks more like a pointer.

Paul Bernhardt
  • 491
  • 2
  • 6