int width = video.getVideoWidth();
int height = video.getVideoHeight();
Surface surface = getPrimarySurface();
surface.drawImage(video.getVideoElement(), 0, 0, width, height,
0, 0, width, height);
ImageDataAdapter frame = surface.getImageData(0, 0, width, height);
CanvasPixelArray pixelData = frame.getPixelData();
int l = pixelData.getLength();
for (int i = 0; i < l; i += 4) {
int r = pixelData.getData(i + 0);
int g = pixelData.getData(i + 1);