Hello Sean,
Let me present my findings more clearly:
1. I changed the statement from capture://video to capture://image and
also passed the parameter encoding=jpeg to getSnapshot(...) method. If
I leave the rest of the code as is - I get a null pointer exception
since the raw image bytes returned is null by the getSnapshot(..)
method. Passing null to the getSnapshot(...) as parameter is also
resulting in null since several Nokia phones seem to assume that null
means encoding=png and since the Nokia 3500c does not have png as a
supported encoding format - it fails.
2. I have a feeling that if we use the locator as capture://image for
the MediaPlayer and then get the Video Control - then the
player.stop() is resulting in a certain behaviour that makes the raw
image bytes returned by getSnapshot as null. I got a hint from the
thread over here:
http://discussion.forum.nokia.com/forum/showthread.php?t=78634
3. So I rearranged the player.stop() method by calling it after the
getSnapshot(...) and then the raw image bytes are not null.
4. During all this time - I DO GET a Video Stream from the camera
showing on the screen. So based on this - it looks like the app is
working as expected - except when I run into those decoding errors
(which I will try with some larger QR Codes, etc). I have generated
the QR Code from the kaywa site and am capturing it from the screen.
Moving on next :
1. I am going to try changing the encoding=jpeg and try out all the
encoding options one after the other. I will do this a little later in
the day and report my findings.
2. If some of this finally makes sense - we might just have to add
methods for getLocator() and getImageEncoding() in the code base. And
you could determine which one is supported and only then initialize
the player.
3. (Optional) - I think what could help you moving on is some kind of
a J2ME utility (packaged separately) that all of us first run on their
mobiles and report our system (phone) capabilities. So everytime we
report a problem - we could also mention some of our phone
capabilities which could help point the obvious problems straight
away.
4. Here are some threads from the Nokia forum around this issue
including reorganizing some directions of reorganizing the code to
determine whether to use capture://video or capture://image.
http://discussion.forum.nokia.com/forum/showthread.php?t=82903
5. On some other related forum topic - I found this piece of text
which might be interesting to note:
"Re: hey nokia please return to capture://video for the rest of the
S40 devices
I got some answers from Series40 organization
There is a good reason for having separate locators for video and
images. As the camera hw is modal (you have to initialize the hw
either in video mode or in still image mode) and if you want to take a
picture in video mode, the hw have to be changed to still image mode
first and hence serious shutter lag is experienced. With separate
locators the hw can be initialized to the correct mode and the user
experience is much smoother."
6. Several other threads discussing this workaround (or problem :-))
http://discussion.forum.nokia.com/forum/showthread.php?t=103158
Cheers
Romin.