Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGStreamer plugin should allow GPU video encoding #24831
Comments
|
@sdroege I'm trying to work out how to get the plugin to generate frames in GLMemory. I wrote a simple version https://github.com/asajeffrey/my-gst-plugin/blob/2c346d729ce599a85e44209af1b5e8c6f12510c5/src/myglsrc.rs which casts the output buffer to
Any idea what I'm doing wrong? Can you point me to an example GStreamer source that produces GLMemory? |
|
PS: the real thing, which also doesn't work, is at https://github.com/asajeffrey/servo/blob/785e243f1a82818a0cad5ccc97afe1c445540a8f/ports/gstplugin/servosrc.rs |
|
https://github.com/asajeffrey/my-gst-plugin/blob/2c346d729ce599a85e44209af1b5e8c6f12510c5/src/myglsrc.rs#L178 is using an alpha of 0, right? |
|
Changing 0.0 to 1.0 yields a non-black screen, but it looks like random texture memory. |
|
Aaargh, this used to be just RGBx, not RGBA. Random video memory is still not good! |
|
Trying it on linux:
produces
|
|
To be completely accurate, the command line set a slew of env vars, it was actually:
|
|
Ah, the problem is the |
|
OK, I got it to the point where I can generate GLMemory and feed it into glimagesink, yay! Not so yay is the flickering, which I think is caused by black frames when servo can't keep up with the window's framerate. Adding a |
|
Fixed the flickering. Submitted a PR. |
|
It's not perfect, in particular the plugin expects to be fed GLMemory, and sometimes fails due to pipelines which provide non-GL memory for some reason. |
|
Also there's a memory leak, sigh. |
|
Ah, the memory leak is probably caused by using |
GStreamer plugin should use GLMemory <!-- Please describe your changes on the following line: --> Get the gstreamer servosrc plugin to generate frames in GLMemory rather than main memory. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24831 - [x] These changes do not require tests because it's an embedding perf issue <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
GStreamer plugin should use GLMemory <!-- Please describe your changes on the following line: --> Get the gstreamer servosrc plugin to generate frames in GLMemory rather than main memory. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24831 - [x] These changes do not require tests because it's an embedding perf issue <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
GStreamer plugin should use GLMemory <!-- Please describe your changes on the following line: --> Get the gstreamer servosrc plugin to generate frames in GLMemory rather than main memory. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24831 - [x] These changes do not require tests because it's an embedding perf issue <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
GStreamer plugin should use GLMemory <!-- Please describe your changes on the following line: --> Get the gstreamer servosrc plugin to generate frames in GLMemory rather than main memory. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24831 - [x] These changes do not require tests because it's an embedding perf issue <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
At the moment we use readback to get each frame out of GPU memory and into main memory. We shouldn't.