The problem is happending when I take photo in N78,N85,N96,5800.
the code is here:
<1>my Camera initialize
try
{
if (ClientSetManager.Platform != ClientSetManager.S40)
{
mPlayer = Manager.createPlayer("capture://video");
} else
{
mPlayer = Manager.createPlayer("capture://image");
}
mPlayer.realize();
mVideoControl = (VideoControl) mPlayer.getControl("VideoControl");
} catch (Exception ex)
{
}
if (mVideoControl == null)
{
}
try
{
mVideoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, getCanvas());
mVideoControl.setDisplayLocation(0, containery + 10);
mVideoControl.setDisplayFullScreen(true);
mPlayer.start();
mVideoControl.setVisible(true);
} catch (MediaException e)
{
}
<2>Take photo
byte[] raw = null;
try
{
// raw = mVideoControl.getSnapshot("encoding=jpeg");
raw = mVideoControl.getSnapshot(ClientSetManager.ImgSize);
} catch (MediaException ex)
{
Alert alert = new Alert("Alerm");
alert.setString("");
Display.getDisplay(midlet).setCurrent(alert);
return;
} catch (SecurityException ex)
{
Alert alert = new Alert("Alerm");
alert.setString("");
Display.getDisplay(midlet).setCurrent(alert);
return;
}
My code is above,and when I take photo in N78,N85,N96,5800(s60 3rd fp2 or high),it can not work immediately,and all of other operation fail in answer.But when I'm back to nokia menu serface,unexpectedly it takes photo and have a sound.
So I think the problem is from native Thread,but I do not sure.
My code work well in S40 and S60 3rd fp1(midp 2.0).
Here is document from Nokia:
Threading does not act the same on different platforms unlike most of other Java aspects. Two main areas of difference are thread scheduling and thread priorities.
In S60 3rd Edition FP 2 onwards, Java threading model has been changed to use native threading. This means that each Java thread maps to the native thread. Previously all Java threads ran in single native thread (green threads). Threading change is transparent for MIDlets and does not cause any issues for correctly implemented MIDlets.
Anyone have idea?Please help me ,my English is poor

Reply With Quote

