I'm currently making an OpenGL video player using libvlc (C++).
I have different behaviors on different hardware using the same OS and
libvlc versions:
Code: Select all
$ lsb_release -d
Description: Ubuntu 16.04.2 LTS
$ apt show libvlc-dev 2> /dev/null | head -n 2
Package: libvlc-dev
Version: 3.0.0~~git20160813+r65787+62~ubuntu16.04.1
libvlc_video_set_format_callbacks and set the chroma to "RV24".
-
On HW A:
-
The lock callback is called once after new/play and the
unlock callback once after calling stop/release. This is not the
expected behavior. Seems like this is supposed to be fixed cf. ticket 17187. - The format is correctly set to 3*8 bits RGB.
-
The lock callback is called once after new/play and the
-
On HW B and C:
-
The lock callback is called before every display call and
the unlock callback is called after every display. - The format is incorrectly set to 3*8 bits BGR.
-
The lock callback is called before every display call and
buffer, I also can't do double-buffering if the only way to change the buffer
address is through the unlock callback.
So here's my questions:
- Will all my problems be fixed if I upgrade (and manually compile) libvlc?
- Is the RGB/BGR confusion a bug or my own mistake?
- Is there a way to know in what order I'll get those bytes?
- Is there a better way to render a video to memory? I don't know much about
OpenGL and how libvlc works, but if I understood correctly, using
libvlc_video_set_callbacks forces libvlc to do all its work on the
CPU and I have then to copy the buffer over to the GPU, which seems
suboptimal if libvlc could do its thing on the GPU and updating the texure
was just a matter of pointing a FBO to the right address.
Thanks for taking the time to read.