Set format to javax.media.player or to framegrabbing
hello,
I've got a javax.media.player to display my webcam.. that works without any problems... with a framgegrabber I grab frames and display them too, works also. but the images are just 320x240. my webcam is able to handle up to 640x480 @ rgb and that is what i want. how must I change my code to get that?
my code:
private BufferToImage bufferToImage;
private FrameGrabbingControl frameGrabbingControl;
private static Player player;
private static CaptureDeviceInfo captureDeviceInfo = null;
private static MediaLocator mediaLocator = null;
private static final String device = "vfw:Microsoft WDM Image Capture (Win32):0";
public void playerStart() {
captureDeviceInfo = CaptureDeviceManager.getDevice(device);
mediaLocator = captureDeviceInfo.getLocator();
// I didn't copie the try-catch
player = Manager.createRealizedPlayer(mediaLocator);
player.start();
}
//--
//this is included in another function, which first calls the method above and then run this and later it calls the method beneath
frameGrabbingControl = (FrameGrabbingControl) player
.getControl("javax.media.control.FrameGrabbingControl");
//-
private Image getImage() {
Image image = null;
frameBuffer = frameGrabbingControl.grabFrame();
// Convert it to an image
bufferToImage = new BufferToImage((VideoFormat) frameBuffer.getFormat());
image = bufferToImage.createImage(frameBuffer);
return image;
}
i'm reading the jmf guide but without any help right now... so please give me a litlle help...

