Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom frameSink implementation #611

Open
scarletsky opened this issue Mar 9, 2022 · 0 comments
Open

Support custom frameSink implementation #611

scarletsky opened this issue Mar 9, 2022 · 0 comments

Comments

@scarletsky
Copy link

OGVPlayer is using YUVCanvas to draw frame data into canvas.
This works great when the canvas is appended to dom.

However when the canvas is as the use of another webgl context texture data, it will be slow. This is because the gl.texImage2D API is slow in some browser(like safari). If we support custom frameSink implementation, we can improve the performance by draw the framedata into the FBO in another webgl context !

before:

  1. framedata -> draw into ogv canvas
  2. call gl.texImage2D in another webgl with ogv canvas
  3. use the texture

after:

  1. framedata -> draw into another webgl FBO (custom frameSink)
  2. use the texture

To implement this feature is very simple:

_setupVideo() {
        // ...
-	this._frameSink = YUVCanvas.attach(this._canvas, canvasOptions);
+	this._frameSink = this._options.frameSink || YUVCanvas.attach(this._canvas, canvasOptions);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant