|
|
User login
Feeds |
Problem With RWsSession::Flush()
|
|||||
| Wed, 2005-06-15 07:33 | |
|
Hi All,
I have a YUV file which i want to display on the screen. First I convert YUV frame to RGB data and copy this to the CFbsBitmap object. Now I am drawing this RGB frame to the screen using the following code. I am calling the following code from a thread created by the main application thread. void CExampleAppView::Draw_Image(CFbsBitmap* aImage,unsigned int img_width,unsigned int img_height) {         CWindowGc& gc = SystemGc(); gc.Activate(Window()); TRect drawRect=Rect(); TPoint pos; pos.iX =(240-(int)img_width)/2;         pos.iY =(320-(int)img_height)/2; gc.BitBlt(pos,aImage); gc.Deactivate(); RWsSession temp = iCoeEnv->WsSession(); RDebug::Printf("\n temp.Flush() \n"); temp.Flush(); RDebug::Printf("\n Passed Flush \n"); } When it executes temp.Flush() line. A prompt with KERN_EXEC 0 error comes. I am unable to understand why this is happening. When i comment this line, which i believe i should not, it works fine but it jumps off few frames then display the next frame and so on. Please help me in this regard. Pinky |
|
Forum posts: 56
In your case RWsSession& returned by CCoeEnv::WsSession becomes invalid in created thread because it contains the kernel object index for the another thread.
hope this helps!
Forum posts: 35
Anyways, How can i get rid of this problem? I need to call this function in a separate thread. Is there any workaround??
Thanks
Pinky
Forum posts: 56
The only way I see is to notify another thread that RWsSession::Flush needed to be called and call it from this thread. But it seems to be not a good solution.
Best regards.
Forum posts: 56
But in documentation you can also find the folowing
But if there is no another way...
BR,
addonic