12-29-2009 04:29 PM
Hi Guys,
I hope someone here has a bit advice for me. I am looking to add metadata to an image that is taken from a blackberry using the Player Video Control method. This works all very well, but trying to add metadata results in a message "Setting Metadata is not supported". i dont know why and have followed the examples on http://www.blackberry.com/developers/docs/5.0.0api
The code i currently have is as follows:
First i initialize the camera:
player = Manager.createPlayer("capture://video");
// Set the player to the REALIZED state (see Player javadoc)
player.realize();
player.start();
control = (VideoControl)player.getControl("VideoControl");
Field cameraView = (Field)control.initDisplayMode(VideoControl.USE_GU
control.setDisplayFullScreen(true);
control.setVisible(true);
add(cameraView);
Once that is done, it shows the fullscreeen viewfinder - all works well.
Then i have a override on the click of the trackball, it calls this method:
Here i try to implement the code to set the metadata, but something seems wrong...
public void TakePicture()
{
try
{
String encoding = "encoding=jpeg&width=640&height=480&quality=fine";
ImageFormatControl imageFormatControl = (ImageFormatControl)player.getControl("javax.micro
if(imageFormatControl != null)
{
imageFormatControl.setFormat("image/jpeg");
imageFormatControl.setParameter(FormatControl.PARA
imageFormatControl.setMetadata("geo.lon", "-35.1111111");
}
_snapShot = control.getSnapshot(encoding);
_isInSnapshotMode = Boolean.FALSE;
DrawStep2();
}
catch(MediaException mediaException)
{
Dialog.inform(mediaException.getMessage());
}
}
If anyone has any ideas. please comment. i will really appreviate it.
Thanks
12-29-2009 07:30 PM
Where does it go wrong, getting the ImageFormatControl? Getting the snapshot, etc. What is the exception?
12-30-2009 03:06 AM
It goes wrong basically on the line where i try to set the metadata.
Exception is : "Setting metadata is not supported."
12-30-2009 08:58 AM
The exception is self explaining, you can't set the metadata.
The problem is the way the JSR process is, if RIM implements a JSR they must implement the entire JSR but they don't need to support all of it.
12-30-2009 12:35 PM
Thanks for the post. As i am new to BB development i thought maybe i missed something. However i figured out a work-around for my problem... thanks again for the helop.