Archived:JSR-135 - VideoControl does not show captured content when Player object is started before setting the Displayable as current (Known Issue)
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
The article is believed to be still valid for the original topic scope.
The article is believed to be still valid for the original topic scope.
Article Metadata
Compatibility
Platform(s): S60 3rd Edition FP1
Article
Created: User:Technical writer 1
(14 Sep 2007)
Last edited: hamishwillee
(28 Jun 2012)
Contents |
Overview
A Player object is created in order to capture an image from the phone’s camera. A VideoControl object is then created and appended to an LCDUI Form. When the Player object is started before setting the form as the current displayable, VideoControl does not show the captured content.The CustomItem control paints only white background.
Description
This happens whenever a Player object is started before Display.getDisplay() is called.
How to reproduce
Form form = new Form("Camera");
// Initializing VideoControl for snapshot taking
player = Manager.createPlayer("capture://video");
player.realize();
vControl = (VideoControl)player.getControl("VideoControl");
form.append((Item)(vControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null)));
player.start(); // user can see where the camera points
Display.getDisplay(this).setCurrent(form);
vControl.setVisible(true); // the video control remains blank
Solution
There is currently no solution. However, the issue can be avoided if Display.getDisplay() is called at least once during the MIDlet’s lifecycle before starting the Player, e.g. in the beginning of MIDlet’s constructor.
form.append((Item)(vControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null)));
// Calling Display.getDisplay before starting the player
Display.getDisplay(this).setCurrent(form);
player.start(); // user can see where the camera points


(no comments yet)