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

decode images in worker #20

Closed
totaam opened this issue May 16, 2018 · 5 comments
Closed

decode images in worker #20

totaam opened this issue May 16, 2018 · 5 comments

Comments

@totaam
Copy link
Collaborator

totaam commented May 16, 2018

See createImageBitmap(): It allows you to decode an image in the background, and get access to a new ImageBitmap primitive, which you can draw into a canvas in the same way you would an element, another canvas, or a video.

@totaam
Copy link
Collaborator Author

totaam commented Jul 24, 2019

Same as #16, needs help.

@totaam totaam transferred this issue from Xpra-org/xpra Jan 22, 2021
@totaam
Copy link
Collaborator Author

totaam commented Aug 17, 2021

Bonus of using the worker is that we can move the complicated logic that preserves the paint order to the decode worker.

The overhead of using a worker for small rgb+lz4 packets is probably quite high, but since those tend to be small then that's not a real problem. The gains when decoding h264 or large images are quite significant.

@totaam totaam closed this as completed Aug 17, 2021
totaam added a commit that referenced this issue Aug 18, 2021
allows us to do the scaling there too
@totaam
Copy link
Collaborator Author

totaam commented Aug 18, 2021

Some reports of latency issues with the worker: Xpra-org/xpra#3229 (comment)

totaam added a commit that referenced this issue Aug 18, 2021
totaam added a commit that referenced this issue Aug 18, 2021
since that also uses createImageBitmap, which is asynchronous
@totaam
Copy link
Collaborator Author

totaam commented Sep 23, 2021

99f9ff2 detects broken implementations of createImageBitmap like Firefox and prints:

we can't decode using a worker: TypeError: WorkerGlobalScope.createImageBitmap: 2 is not a valid argument count for any overload.

@totaam
Copy link
Collaborator Author

totaam commented Nov 3, 2021

Looks like image decoding is single threaded in chrome!?
The decode worker checks timeout when running on a slow connection because it seems to be busy loading the desktop background and doesn't start decoding the test images until it is too late.

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