Skip to content

fbo rendering #12

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

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

hack-s
Copy link
Contributor

@hack-s hack-s commented May 11, 2025

Use projectm_opengl_render_frame_fbo() to render ProjectM to an OpenGL texture. Removes direct OpenGL buffer access and avoids copying of GPU memory to main memory if not needed.
gstaudiovisualizer is not suitable as a basis for the plugin anymore. It's hard-coded to use main memory, cpu based transition shaders, and does not expose timestamps to synchronize projectm. gstpmaudiovisualizer is added to support customized memory allocation and expose timestamps.

Rendering test video: https://www.youtube.com/watch?v=kl3nVd-iug8

@rootnotez
Copy link

I was able to test this successfully on Debian12 with Nvidia drivers in X11 with DWM window manager.

@hack-s hack-s marked this pull request as draft May 25, 2025 06:26
@hack-s hack-s marked this pull request as ready for review May 28, 2025 09:07
@rootnotez
Copy link

rootnotez commented Jun 4, 2025

Getting this compile warning with build.sh on debian12.

[6/7] /usr/bin/cc -DPROJECTM_STATIC_DEFINE -Dgstprojectm_EXPORTS -I/usr/include/gstreamer-1.0 -I/usr/lib/x86_64-linux-gnu/gstreamer-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/user/work/hack-s/gst-projectm-fbo -fPIC -MD -MT CMakeFiles/gstprojectm.dir/src/plugin.c.o -MF CMakeFiles/gstprojectm.dir/src/plugin.c.o.d -o CMakeFiles/gstprojectm.dir/src/plugin.c.o -c /home/user/work/hack-s/gst-projectm-fbo/src/plugin.c
/home/user/work/hack-s/gst-projectm-fbo/src/plugin.c: In function ‘wrap_gl_texture’:
/home/user/work/hack-s/gst-projectm-fbo/src/plugin.c:61:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   61 |   glTextures[0] = (gpointer)plugin->priv->texture_id;
      |                   ^  

@rootnotez
Copy link

rootnotez commented Jun 4, 2025

Getting a crash while exiting test.sh --audio Attaching crash dump, some gdb, and some Claude proposed fixes. Opps, realizing this is with ctrl-c quitting.

Sending SIGTERM (15) instead of CTRL-C / SIGINT (2) I do not get a crash.

I'm not confident this is a bug that needs fixing at the moment. Maybe we turn this into an issue for long term fixing?

2025-06-04_gstreamer_projectm_debug_session.md

@hack-s
Copy link
Contributor Author

hack-s commented Jun 5, 2025

Getting a crash while exiting test.sh --audio Attaching crash dump, some gdb, and some Claude proposed fixes. Opps, realizing this is with ctrl-c quitting.

Sending SIGTERM (15) instead of CTRL-C / SIGINT (2) I do not get a crash.

I'm not confident this is a bug that needs fixing at the moment. Maybe we turn this into an issue for long term fixing?

2025-06-04_gstreamer_projectm_debug_session.md

turned out there was a memory error. I have back-ported a fix for it from gst.

@hack-s
Copy link
Contributor Author

hack-s commented Jun 5, 2025

Getting this compile warning with build.sh on debian12.

[6/7] /usr/bin/cc -DPROJECTM_STATIC_DEFINE -Dgstprojectm_EXPORTS -I/usr/include/gstreamer-1.0 -I/usr/lib/x86_64-linux-gnu/gstreamer-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/user/work/hack-s/gst-projectm-fbo -fPIC -MD -MT CMakeFiles/gstprojectm.dir/src/plugin.c.o -MF CMakeFiles/gstprojectm.dir/src/plugin.c.o.d -o CMakeFiles/gstprojectm.dir/src/plugin.c.o -c /home/user/work/hack-s/gst-projectm-fbo/src/plugin.c
/home/user/work/hack-s/gst-projectm-fbo/src/plugin.c: In function ‘wrap_gl_texture’:
/home/user/work/hack-s/gst-projectm-fbo/src/plugin.c:61:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   61 |   glTextures[0] = (gpointer)plugin->priv->texture_id;
      |                   ^  

That's some api weirdness, basically storing an int value (OpenGL texture id) in a pointer var. But that's what's needed..

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

Successfully merging this pull request may close these issues.

3 participants