09-16-2010 09:55 AM
I am developing a barcode(qrcode) decoder application for BB in which I am able to decode the qrcode when I capture the image from camera and process it.
But now I want to have a facility in which I keep my camera on and while the camera is running without taking any snapshot(with the button) I want to capture the frame to decode it.
In short the end user should not need to press the capture button and if he/she puts the camera on barcode I should be able to give the decoded result directly.
There are many such applications available on net for android, symbian and may be for bb too.
So I feel that it is possible but I don't how can I implement.
Any support from your side will be appreciated.
Thanks in advance
09-16-2010 03:15 PM
Let me see if I understand this properly: you want the user to start the app, the camera automatically starts up, and in real time it decodes the barcode (by you extracting a frame from the stream)?
If so then everything up until the real time decode is possible.
Real time decoding will obviously slow down the device heavily (along with battery life), if you took a snapshot every second or so instead of every frame it might be easier. If you want to do every frame you need to be using 5.0 or higher (video recording) and (since frame control is not supported) you need to process RIM's proprietary streaming format (search for "RIMM format") and extract the frames yourself.
09-17-2010 08:08 AM
Actually I have developed the solution for taking snapshots and decoding the barcode, But in that case after taking picture camera goes invisible and then after processing if zxing is not able to decode barcode I again need to display camera for next capture. So user needs to wait till the process of decoding completes.
So that I though let camera be on I check if the current picture visible from camera is proper barcode then I can proceed for next step.
I found some similar applications like quiQR for iphone and there are many others for symbian and android too.
So I just want to implement same logic where the camera remains on until I get the proper decoded result for qrcode.
I feel this will be more clear now to you,
I will look forward for more guideline on above metter from your side.
09-19-2010 05:35 PM
Yes that is (and I checked out quiQR). I have not tried something like that but I'll see if I can help.
First off are you invoking the camera app or intergrating the viewfinder into your app? If you are invoking the camera app then that would explain the single photo problem. But the other option (intergrated viewfinder) has it's own issues.
If the app you are developing is for 5.0 and higher it can use the intergrated video control and you should be able to just take multiple pictures without it going away. Obviously it requires 5.0 and higher. Any lower and you need to do the invoke camera.
09-21-2010 11:31 AM
09-22-2010 10:15 AM
One more thing if you can guide me in that...
I am now planning to write code for os 5.0 or higher.
In that the logic I am planning to apply is something like this....
1) I will create a thread and in that will call function to getsnapshot and decode it
2) I will call this thread after few seconds
Does it seem to be the correct logic from your side?
Please send me your suggestions in above.
09-22-2010 10:29 AM
It sounds logical to me but I don't know if the camera is thread safe so I don't know what might happen. The thread should be paused if the app is minimized and continued when maximized.
It is definitly something to play around with because there are other uses for it, now if only BlackBerry supported overlays on the camera.
09-22-2010 11:19 AM
But in case if I use camera.invoke with CameraArguments.ARG_VIDEO_RECORDER, how could I capture the frame?
I mean it support journal listener and we can notified only when there is any file saved via journal listener.. isn't it?
Can you give me your suggestion in matter.
Thanks in advance
09-22-2010 11:33 AM
unlike the Android and other platforms the BBOS doesnt allow developer access to the stream in preview mode. You only get notified when the picture is actually saved.
If RIM open up the API then you can do whatever you like with the stream.