1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-07 03:56:28 +02:00
Commit Graph

132 Commits

Author SHA1 Message Date
Pierre Lamot
04ea9e055e doc: QtGL: implement window resize and mouse callbacks 2023-06-14 07:01:11 +00:00
Pierre Lamot
2ed2509750 doc: d3d11_player: implement mouse support 2023-06-14 07:01:11 +00:00
Pierre Lamot
60078ca975 libvlc: allow user to report mouse events when using libvlc_video_set_output_callbacks
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).
2023-06-14 07:01:11 +00:00
Steve Lhomme
4c99f1a44a include cassert instead of assert.h
cassert is the preferred way in C++. It doesn't contain static_assert
which is otherwise a keyword.

https://stackoverflow.com/a/43011752/1266123
https://en.cppreference.com/w/cpp/header/cassert
https://en.cppreference.com/w/cpp/language/static_assert
2023-04-19 12:58:03 +00:00
Simon Latapie
f7d4afc821 doc: QtPlayer: fix file opening on Windows
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.
2023-03-23 14:36:25 +00:00
Steve Lhomme
86e598311e vlc-thumb: fix error handling
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.
2023-02-23 07:09:44 +00:00
Steve Lhomme
246d451260 doc/libvlc: include cstdio/cstdlib
They are the headers that should be used from C++.

+ set the SPDX license so it can be parsed easily.
2023-01-27 11:40:39 +00:00
Steve Lhomme
8c2b60de03 libvlc: always include the libvlc version header from vlc.h
Just like the other libvlc headers.
2022-11-29 07:06:26 +00:00
Ordissimo
76bb0f1316 Fix gtk_player migrate to gtk3 2022-11-27 10:16:36 +00:00
Steve Lhomme
7c64a9d27a doc: win32: remove window flag that redraws the window
This trick worked to redraw/resize the VLC HWND when the parent changes. But
not all apps can do that.
2022-11-17 14:39:26 +00:00
Rémi Denis-Courmont
815116d80c Use static assertions to check constant predicates
This is more straightforward than #if/#error/#endif.
2022-08-02 13:44:55 +00:00
Rémi Denis-Courmont
b18a675901 lib: remove useless libvlc_media_new_path() parameter 2022-06-18 19:10:34 +00:00
Rémi Denis-Courmont
5aec19d53f lib: remove useless libvlc_media_new_location() parameter 2022-06-18 19:10:34 +00:00
Rémi Denis-Courmont
d607bf767f lib/media_player: pass instance when creating from media
The caller ought to be able to select which instance the player should
be instantiated from.
2022-06-18 19:10:34 +00:00
Rémi Denis-Courmont
cd05f2ff55 lib/media: pass explicit instance to generate thumbnail 2022-06-17 10:30:35 +00:00
Steve Lhomme
ee28019fb9 d3d11_player: only read lParam once 2022-06-02 09:10:37 +00:00
Steve Lhomme
d22c1a2bca d3d11_player: handle 0 dimensions we report to the app
We could avoid sending 0, or we could avoid the rendering if it's 0.
But being a "simple" sample app, let's use the easiest way.
2022-06-02 09:10:37 +00:00
Alexandre Janniaux
60fcef78ee doc/libvlc: add appkit_player demo code
The sample code demonstrate how to bind an NSView to a media player to
integrate video playback in a Cocoa application.
2022-05-27 06:22:44 +00:00
Thomas Guillem
6d3b8ada5f doc: examples: use the Stopped event
From VLC 4.0, Ended or EndReached are sent when the player is stopping,
so listen to the stopped event instead.
2022-03-12 09:41:12 +00:00
Steve Lhomme
6fa58261ff libvlc: add a callback for the type of the resize callback
This will avoid lengthy variable declarations.
2022-03-05 12:23:02 +00:00
Steve Lhomme
c3d874c989 doc: libvlc: rename callbacks to clarify what they do 2022-03-05 12:23:02 +00:00
Steve Lhomme
553f6091c0 libvlc: add the possibility to flip the rendered textures
Only supported by the D3D11 renderer for now.
2022-03-05 12:23:02 +00:00
Steve Lhomme
e70bb01630 doc: libvlc: add a CMake makefile to build the win32 samples
CMake has good integration with VSCode which makes it as easy as just loading
the folder in VSCode, set the SDK folder and build.
2022-03-03 18:43:58 +00:00
Steve Lhomme
df63adafd9 doc: fix warnings with MSVC in d3d11_player 2022-03-03 18:43:58 +00:00
Steve Lhomme
db6ad1bc86 doc: libvlc: fix type casting 2022-03-03 18:43:58 +00:00
Steve Lhomme
4bad605e3b doc: libvlc: use _strdup() on Windows samples
strdup() is issuing a deprecated warning with the MS SDK.
2022-03-03 18:43:58 +00:00
Steve Lhomme
491e7440b3 doc: libvlc: fix QtGL shader compilation issue 2022-03-03 16:57:05 +00:00
Romain Roffé
49dc4a6d11 doc: gtk: Fix build with GTK3+ 2022-02-07 19:10:36 +00:00
Alexandre Janniaux
df2a9c37cd doc: libvlc: add minimal example from wiki
The example will be included in the main page of libVLC documentation.
2022-01-29 18:07:27 +00:00
Alexandre Janniaux
b225c6dbc0 doc: QtGl: use nullptr and remove stray comments 2021-12-15 14:47:15 +00:00
Alexandre Janniaux
530cc094d1 doc: QtGl: use std::unique_ptr<>
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.
2021-12-15 14:47:15 +00:00
Alexandre Janniaux
a6ab218963 doc: QtGL: switch to C++14
C++14 is needed to use std::make_unique<> in particular, and is already
a requirement for libvlc anyway.
2021-12-15 14:47:15 +00:00
Hugo Beauzée-Luyssen
e56d967334 doc: thumbnailer: Use new media thumbnailer API 2021-12-02 12:40:22 +00:00
Hugo Beauzée-Luyssen
d3be66ede9 doc: vlc-thumb: Remove trailing whitespace 2021-12-02 12:40:22 +00:00
Hugo Beauzée-Luyssen
3394964816 doc: thumbnailer: Remove deprecated options 2021-12-02 12:40:22 +00:00
Craig Turner
180cc78689 doc: QtGL: fix textures being recreated
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
2021-10-05 08:30:04 +00:00
Steve Lhomme
f35b34c0a1 d3d11_player: adjust the swapchain size when resizing
This will provide better quality when expanding the size compared to the
initial size.
2021-08-20 13:54:28 +00:00
Steve Lhomme
27515ae5d3 d3d11_player: use a SRWLOCK instead of a CRITICAL_SECTION
It's lighter and faster.
2021-08-20 13:54:28 +00:00
Alexandre Janniaux
febdeca0b4 doc: QtGL: conditionnally set precision qualifier
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
2021-07-01 16:24:23 +00:00
Alexandre Janniaux
f3f32481fc doc: QtGL: check _WIN32 for windows plugins
QWindowsIntegrationPlugin is supposed to be linked against only when the
example is being compiled for Windows platform.
2021-07-01 16:24:23 +00:00
Alexandre Janniaux
ce4e4085c6 doc: QtPlayer: check _WIN32 for windows plugins
QWindowsIntegrationPlugin is supposed to be linked against only when the
example is being compiled for Windows platform.
2021-07-01 16:24:23 +00:00
Steve Lhomme
4b60c03dfb doc: QtGl: fix usage of OpenGL functions when running in Qt
glActiveTexture doesn't exist in opengl32.dll on Windows.

Co-Authored-By: Alexandre Janniaux <ajanni@videolabs.io>
2021-07-01 16:24:23 +00:00
Steve Lhomme
ff816e4096 doc: QtGl: remove unused private variables 2021-07-01 16:24:23 +00:00
Steve Lhomme
fd58e14843 doc: QtGl: replace std::mutex with QMutex
std::mutex is not available on some platforms (mingw64 with gcc for example).
2021-07-01 16:24:23 +00:00
Steve Lhomme
1d80e39533 doc: QtGl: set the shader precision
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
2021-07-01 16:24:23 +00:00
Steve Lhomme
1e09fce382 doc: QtGl: don't condition plugin import based on QT_STATICPLUGIN
QT_STATICPLUGIN is only used to export plugins, it has no impact on importing
plugins (see qplugin.h).
2021-07-01 16:24:23 +00:00
Steve Lhomme
930b5ef4f9 doc: QtPlayer: add QWindowsIntegrationPlugin plugin
Similar to the one in the QtGl sample.
2021-07-01 16:24:23 +00:00
Martin Finkel
b7378da2dd d3d11_player: field renaming 2021-05-07 08:21:48 +00:00
Steve Lhomme
dd514b9ef6 libvlc: make the D3D11 callback give a ID3D11RenderTargetView per plane
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.
2021-04-02 15:51:48 +02:00
Steve Lhomme
e3ed8e2d52 libvlc: the setup/cleanup rendering callbacks can be called many times
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.
2021-02-18 07:42:36 +01:00