Skip to content

Commit

Permalink
Update demo to align with latest WEBGL_video_texture proposal (Khrono…
Browse files Browse the repository at this point in the history
…sGroup#3073)

VideoElementTargetVideoTexture -> shareVideoImageWEBGL
add releaseVideoImageWEBGL call.
  • Loading branch information
shaoboyan authored May 15, 2020
1 parent 0eb3076 commit 3429e1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk/demos/intel/js/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ window.Renderer = (function () {
} else {
if (this.ext !== null) {
gl.bindTexture(ext.TEXTURE_VIDEO_IMAGE, self.texture);
ext.VideoElementTargetVideoTexture(ext.TEXTURE_VIDEO_IMAGE, video);
ext.shareVideoImageWEBGL(ext.TEXTURE_VIDEO_IMAGE, video);
gl.bindTexture(ext.TEXTURE_VIDEO_IMAGE, null);
}
}
Expand Down Expand Up @@ -222,14 +222,16 @@ window.Renderer = (function () {
gl.bindTexture(ext.TEXTURE_VIDEO_IMAGE, this.texture);

if (this.videoElement && !this.videoElement.paused && this.ext !== null) {
ext.VideoElementTargetVideoTexture(ext.TEXTURE_VIDEO_IMAGE, this.videoElement);
ext.shareVideoImageWEBGL(ext.TEXTURE_VIDEO_IMAGE, this.videoElement);
}
}

gl.clearColor(0, 0, 0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);

gl.drawElements(gl.TRIANGLES, this.indices.length, gl.UNSIGNED_SHORT, 0);

ext.releaseVideoImageWEBGL(ext.TEXTURE_VIDEO_IMAGE_WEBGL);
};

return Renderer;
Expand Down

0 comments on commit 3429e1b

Please sign in to comment.