I am trying to devellop a console based camera application. This application is meant for the environment where there is no windowserver service. I am facing a problem of showing the viewfinder frames onto the screen. Below is the way i try to construct a offscreen bit map and then blit it onto the screen. But nothing shows up.
void CMyCamera::ViewFinderFrameReady(CFbsBitmap& aFrame) { Â Â ....... Â Â CFbsBitmap* fbsBitmap = new (ELeave) CFbsBitmap(); CleanupStack::PushL(fbsBitmap); Â Â TInt err = fbsBitmap->Create(TSize(100, 100), EColor256); RDebug::Print(_L("fbsBitmap->Create Error = %d"), err); Â Â if(err != KErrNone) User::Leave(err); Â Â CFbsBitGc* bitmapGc = NULL; Â Â CFbsBitmapDevice* bitmapDev; Â Â TRAP(err, bitmapDev = CFbsBitmapDevice::NewL(fbsBitmap)); Â Â RDebug::Print(_L("CFbsBitmapDevice::NewL Error = %d"), err); Â Â if(err != KErrNone) User::Leave(err);
  CleanupStack::PushL(bitmapDev);
  bitmapDev->CreateContext(bitmapGc);   CleanupStack::PushL(bitmapGc);   bitmapGc->SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );   bitmapGc->DrawBitmap(TRect(0, 0, iVfSize.iWidth, iVfSize.iHeight), &aFrame);   bitmapGc->BitBlt(TPoint(0,20), fbsBitmap);
.......
}
I get the call back from Camera (ViewFinderFrameReady). But nothing is shown in the screen.
As there is not Window server, I cant use CWindowGc& gc = SystemGc(); to get system gc. Instead I am restricted to use CFbsBitGc or CGraphicsContext.
I think you are drawing to memory, not to the screen. I don't think you can draw to screen without CWindowGc or DSA. And to Flush() in the end is always a good idea.
I found out the problem. I was actually drawing it to the memory and the correct implementaation is using CFbsScreenDevice instead of CFbsBitmapDevice.
It works now!!
But, I was wondering how to improve the view finder frame rate. Currently its quite slow. Though the callback from CameraAPI is almost 15fps but the display is not more than 5-7fps.
Anybody has any idea if CFbsBitGc::Bitblt can draw that fast? I understood that its a synchronous call and also time consuming. Is there anyway to implement the same with better view finder frame rate?
It shouldn't run at 7-8. On the Nokia 6600 it's running 14 fps with some postprocessing. On the newest phones it should be even faster. What phone are you using ?
Forum posts: 115
CellaGameS.com
Forum posts: 14
I found out the problem. I was actually drawing it to the memory and the correct implementaation is using CFbsScreenDevice instead of CFbsBitmapDevice.
It works now!!
But, I was wondering how to improve the view finder frame rate. Currently its quite slow. Though the callback from CameraAPI is almost 15fps but the display is not more than 5-7fps.
Anybody has any idea if CFbsBitGc::Bitblt can draw that fast? I understood that its a synchronous call and also time consuming. Is there anyway to implement the same with better view finder frame rate?
Please help!!
Brs,
OJ
Forum posts: 115
CellaGameS.com