ref: 31432bd518edadf97c038bd1b950ed3c04f2b665
parent: 404bf6018e1385a8bc06844cc00605a4b136416b
author: Sam Leitch <sam.leitch@calgaryscientific.com>
date: Mon Mar 31 08:25:37 EDT 2014
Fixed RGBA version of drawNextOutputPicture to work with croppingParams.
--- a/js/h264bsd_canvas.js
+++ b/js/h264bsd_canvas.js
@@ -272,6 +272,7 @@
var width = decoder.outputPictureWidth();
var height = decoder.outputPictureHeight();
+ var croppingParams = decoder.croppingParams();
var argbData = decoder.nextOutputPictureRGBA();
@@ -278,5 +279,10 @@
var ctx = canvas.getContext('2d');
var imageData = ctx.getImageData(0, 0, width, height);
imageData.data.set(argbData);
- ctx.putImageData(imageData, 0, 0);
+
+ if(croppingParams === null) {
+ ctx.putImageData(imageData, 0, 0);
+ } else {
+ ctx.putImageData(imageData, -croppingParams.left, -croppingParams.top, 0, 0, croppingParams.width, croppingParams.height);
+ }
}