Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
paragrughani
Posts: 9
Registered: ‎08-20-2010
My Device: Not Specified

Help in continuous camera

Hello Friends,

 

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

 

 

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: Help in continuous camera

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.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
New Contributor
paragrughani
Posts: 9
Registered: ‎08-20-2010
My Device: Not Specified

Re: Help in continuous camera

Thanks rcmaniac25,


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.

 

Thanks again

 

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: Help in continuous camera

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.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
New Contributor
paragrughani
Posts: 9
Registered: ‎08-20-2010
My Device: Not Specified

Re: Help in continuous camera

Thanks, I tried to access the invoke but in that case I am not able to capture the image during the camera is on because it can be trapped only with journal listener. Then I tried to integrate player but in that case after capturing first image in thread it stops and hangs. So I feel that I will need to move to os 5.0 or higher for getting the solution. Thanks for your help and support.
New Contributor
paragrughani
Posts: 9
Registered: ‎08-20-2010
My Device: Not Specified

Re: Help in continuous camera

Hi  rcmaniac25,

 

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.

 

Thanks

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: Help in continuous camera

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.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
New Contributor
paragrughani
Posts: 9
Registered: ‎08-20-2010
My Device: Not Specified

Re: Help in continuous camera

Hi,

 

Thanks,

 

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

Developer
smiley
Posts: 1,497
Registered: ‎07-14-2008
My Device: Z10

Re: Help in continuous camera

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.

 

 

New Contributor
paragrughani
Posts: 9
Registered: ‎08-20-2010
My Device: Not Specified

Re: Help in continuous camera

Thanks,

 

But, the BB messanger 5.0 has this functionality with OS 6.0 so what kind of logic it would be using there?

 

Can you provide some information on this?

 

Regards