private IVideoPicture convertToPicture(int streamIndex, BufferedImage image,
long timeStamp)
{
// lookup the converter
IConverter videoConverter = mVideoConverters.get(streamIndex);
// if not found create one
if (videoConverter == null)
{
IStream stream = mStreams.get(streamIndex);
IStreamCoder coder = stream.getStreamCoder();
videoConverter = ConverterFactory.createConverter(
ConverterFactory.findDescriptor(image),
coder.getPixelType(),
coder.getWidth(), coder.getHeight(),
image.getWidth(), image.getHeight());
mVideoConverters.put(streamIndex, videoConverter);
}
// return the converter
return videoConverter.toPicture(image, timeStamp);
}