Thank you for the links FL53. Indeed I already know the callbacks lock/unlock but it is not the most efficient, I mean there are copies between gpu and cpu. I would like to have a zero copy pipeline, in other words stay on gpu in the whole pipeline.
Code: Select all
You need a patch to libVLC to do that.
Code: Select all
LIBVLC_API
bool libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
libvlc_video_engine_t engine,
libvlc_video_setup_cb setup_cb,
libvlc_video_cleanup_cb cleanup_cb,
libvlc_video_update_output_cb update_output_cb,
libvlc_video_swap_cb swap_cb,
libvlc_video_makeCurrent_cb makeCurrent_cb,
libvlc_video_getProcAddress_cb getProcAddress_cb,
void* opaque );
4.0 and libvlc_video_set_output_callbacks are still experimental and haven't been released; so it might even change again. It was mostly done as a prototype before integrating the same mechanism for d3d11 and vulkan, then it will probably become an unified API for doing this.Thank you for your input unidan.
I've got my hands on the latest 4.0 nightly build and the libvlc_video_set_output_callbacks signature is different from the example you've mentioned. I'm on Windows 10 and the behavior seems to be awkward as the cleanup, procAdress and setup callbacks are called every single frame. I'm not quite sure where to go from here.
You need to provide a context to libvlc. As libvlc output runs into its own thread, you need to dedicate a full context that you don't use in another thread. So you'll likely have two contexts that share resources.Also, it might work quite nicely in a one cpp example but chances are that other people like me have their GL context on an other thread, which make this process difficult to implement. In order to move the GL context to the libvlc_video_set_output_callbacks thread, is it possible to access the libvlc_video_set_output_callbacks thread some how?
When run this example, it's founded that the CPU using is so high than normal relaesed player. Is there any more information on Why the CPU using growth so high and the video play is not smooth. There is more info at https://forum.videolan.org/viewtopic.php?f=14&t=155928Hi, check in doc/libvlc/sdl_opengl_player.cpp.
Hi, is there copies between CPU and GPU in this example doc/libvlc/sdl_opengl_player.cpp? I found CPU consumption is so higher(example 30%) than the normal released player(3%). More info at https://forum.videolan.org/viewtopic.php?f=14&t=155928Thank you for the links FL53. Indeed I already know the callbacks lock/unlock but it is not the most efficient, I mean there are copies between gpu and cpu. I would like to have a zero copy pipeline, in other words stay on gpu in the whole pipeline.
You need a patch to libVLC to do that.
Return to “Development around libVLC”
Users browsing this forum: No registered users and 26 guests