Im back again with another annoying problem of mine...
i've created a thread in my program and a class that has private and public members.
the thread is created like this:
Code: Select all
class Camera
{
public:
Camera();
~Camera();
int stop();
int start();
int fillBuffer(bool blitToScreen);
void Init(u8* c_buf,u8* c_work,u32* c_fbuf);
void destroy();
bool Started;
bool Error;
u8* buffer;
private:
PspUsbCamSetupVideoParam videoparam;
int LoadModules();
int UnloadModules();
int InitCamera();
int StartUsb();
int StopUsb();
int InitJpegDecoder();
int FinishJpegDecoder();
bool initiated;
u8* work;//[68*1024] __attribute__((aligned(64)));
u32* framebuffer;//[480*272] __attribute__((aligned(64)));
};
Code: Select all
video_thid = sceKernelCreateThread("video_thread", video_thread, 16, 16*1024, 0, NULL);
if (video_thid < 0)
{
printf("Cannot create video thread.\n");
//return -1;
}
if (sceKernelStartThread(video_thid, 0, NULL) < 0)
{
printf("Cannot start video thread.\n");
//return -1;
}
Code: Select all
int video_thread(SceSize args, void *argp){
while(true){
if(!WebCam.Error && WebCam.Started){
if(WebCam.FillBuffer(true)<0){
printf("There was an error filling the buffer...\n");
}
}
}else if(WebCam.Error){
printf("Webcam Error...\n");
sceKernelDelayThread(50000);
}
}
sceKernelExitDeleteThread(0);
return 0;
}
im not 100% clear with threads yet, but i cant see anything going wrong here.
Maybe you guys can see what im doing wrong?
Cheers
Roman