when using libvlc_video_set_output_callbacks, VLC has no native surface to
intercept mouse events (unlike libvlc_media_player_set_xwindow/xid/...). This
patch allows user to send these events manually to VLC. This is useful when
dealing with interactive medias (DVD menus).
Using a raw path from the QFileDialog can lead to wrong native
separators in the provided string.
Using URLs instead of paths should be more cross-platform compliant.
If the thumbnail fails, the returned picture is NULL. It is handled that way in
the snapshot() function. But libvlc_picture_retain() doesn't handle NULL
pictures.
This improves the documentation by exposing a C++-idiomatic way to
handle the resources without leaking for most users copying this part of
the code to their application.
QOpenGLFramebufferObject::takeTexture is detaching the current texture
and transfering ownership to the caller, and the texture was never
destroyed afterwards. It was leading to a huge memory consumption and
leak when using the sample app.
From the documentation[^1] in Qt5:
Returns the texture id for the texture attached to this framebuffer
object. The ownership of the texture is transferred to the caller.
If the framebuffer object is currently bound, an implicit release()
will be done. During the next call to bind() a new texture will be
created.
[1]: https://doc.qt.io/qt-5/qopenglframebufferobject.html#takeTexture
Co-authored-by: Alexandre Janniaux <ajanni@videolabs.io>
For the commit message and cleaning the fix mostly.
Fixes#25867
Precision is available but no-op on GLSL 130 (see [3], section 4.5.2)
and mandatory for OpenGL ES. It was first reserved on GLSL 120 and
didn't exist in GLSL <= 110 (= OpenGL 2.0). Since it's a no-op, the
easiest solution is to never use it for OpenGL code.
This description is also copied into the sample to explain to the users
that they might have difference in behaviour depending on whether they
are using OpenGL or OpenGL ES2, and depending on the version of OpenGL
used.
The precision qualifier was added because Qt was linked from the
contribs, which was linked with -opengl angle and thus was actually
using OpenGL ES2, which needs the precision qualifier.
Resources used:
[1]: https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.1.10.pdf
[2]: https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.1.20.pdf
[3]: https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.1.30.pdf
On Windows if I don't set this I get the following error:
QOpenGLShader::compile(Fragment): ERROR: 0:3: '' : No precision specified for (float)
ERROR: 0:8: ';' : syntax error
This is more flexible as it doesn't depend on a shared ID3D11DeviceContext.
A NULL callback is still allowed as long as the host app does the
OMSetRenderTargets on their single ID3D11RenderTargetView.
In some cases the decoder might ask for a decoder device that will use the
setup callback. But in the end it's not using the decoder device. Then the
display module is created, without knowing about that decoder device (via a
video context) and calls the setup callback again.
Unless the decoder device that is created in the vout is passed to the display
module, we need to allow those multiple calls per session.
Fix the D3D11 sample to take this in account. The D3D9 sample already takes
care of it.