Commits on Source (17)
-
sys->embed was used to store the window created from the display in pre-3.0 design, but now the display is created after the window and the window is available in vd->cfg->window. The sys->embed was storing the same pointer in the normal case, but ironically, it was undefined in the libvlc embedding case and was leading to crash.
cdd8a75f -
This is anyway not properly supported currently so opting in to it here does not change anything for the better. Forward port from 3.0.x branch. Cherry-picked from commit 4591255d. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
fee7cff9 -
The CGL context was destroyed too early, so move around the vout display removal to prevent using the already-gone context. Forward port from 3.0.x branch. Cherry-picked from commit 7d1e7f28. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
48c59025 -
Forward port from 3.0.x branch. Cherry-picked from commit 52ee0328. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
e68145e4 -
Rewrites most of the layer vout code to have the same features as the view based vout. Additionally fixes laggy resizing, fixes CGL context creation bugs, adds support for CI filters and fixes various memory management errors. The CAOpenGLLayer based API is special and different from all other APIs provided on other OSes as it is not a push-model API but a pull one, where the OS calls a specific method when a new frame should be rendered. This makes integration into VLC relatively tricky and the code a bit harder to follow. While the API is a pull-model, we can kind of trick it by just forcing a re-display of the layer in the vouts display function. With views this would be forbidden as views are supposed to be accessed from the main thread only, but with layers this is possible if some care is taken. When forcing the layer to render from a different thread, the implicitly created CATransaction has to be flushed explicitly, as we do not have a main loop at the end of which it would be flushed. We do not force rendering all the time though, as doing that would break resize animations given that VLC can not know the right time when display refresh will happen, so resizing would look laggy and have glitches, as during a resize both the OS and VLC would drive the rendering of the layer, resulting in unexpected result. To prevent that, when live resizing starts (the user resizing by dragging a windows corner), the layer is set into asynchronous rendering mode which makes the OS drive the rendering loop completely not only for drawing the resize change. While the layer is in asynchronous mode, we ignore all update requests from the core, as the layer is anyway updated continuously by the OS and forcing rendering from another thread would lead to artifacts. Additionally while in live resize, we do not report the size changes to the core, as the event takes too long to reach the vout Control() function, resulting in the layer content being displayed at the wrong (old) size. Instead we take the current viewport size as the size and display using that. Another unusual thing compared to other vouts is that the VLC OpenGL display functions to update the viewport and aspect ratio are not called in the Control event handling callback, thats because before the render callback is called, the OS sets the OpenGL viewport to match the layer backing store size. So setting it in the Control callback is useless as it does not make any difference. Forward-port from 3.0.x branch. Cherry-picked from commit 879ca61f. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io> Noticeable changes: - vlc_object_release has been changed into vlc_object_delete
b7fadee3 -
Forward-port from 3.0.x branch. Cherry-picked from commit baf1b282. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
93c12089 -
Changing from a retina screen to a non-retina screen changes the scale of the layer, so from point of view of the OpenGL code, the size of the surface changes. Therefore we need to signal this change so that the size is adapted correctly. This is not a perfect solution as the size event will arrive too late so for a few frames the wrong size can still be seen before it switches to the new size. Ideally this would be handled like the live resize but so far I have not found a good solution for how to do that. Forward-port from 3.0.x branch. Cherry-picked from commit 57401f90. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
489e62d1 -
Forward-port from 3.0.x branch. Cherry-picked from commit 2272cd45. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
9fe5c444 -
Other views might need the mouse events as well. Do the analog logic as in the old macosx vout module. Fixes steering of fullscreen panel. fixes #24560 Signed-off-by:
Marvin Scholz <epirat07@gmail.com> Forward-port from 3.0.x branch. Cherry-picked from commit 4d98f418. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
7a659c60 -
use layoutSublayers instead of resizeWithOldSuperlayerSize: as the resizeWithOldSuperlayerSize: method is not called when compiled with 10.13 SDK, possibly because then the layer is not in a full layer tree so has no superlayer eventually. So using layoutSublayers feels more correct to be called when a layout change occurs. Fix #24559 Forward-port from 3.0.x branch. Cherry-picked from commit 11591b11. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
ad5f35b1 -
This fixes #24646 Forward-port from 3.0.x branch. Cherry-picked from commit 7c74e968. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
a446af46 -
We don't create an internal window anymore, so we can always use vd->cfg->window where needed.
ee1f1720 -
Store the current modified vout_display_cfg_t and inline the calls to vout_display_PlacePicture. Refs #26845 Refs #25264
689b64b1 -
DISPLAY_SIZE controls are emitted by the windowing system to control the display state, but the caopengllayer display module is handling its own windowing state without window and doesn't need to react to those events. Instead, store the new size into the internal vout_display_cfg_t and avoid trying to report the size to itself. Fixes #26845 Refs #25264
bd24889a -
The display currently requires an NSObject window which is will be fetched from a drawable window module in next patch. Fetching the drawable from the display is not necessary anymore.
8de94040 -
Add an NSObject-drawable window implementation initializing the vout_window properties from libvlc. Fixes #26864
514954e2 -
This and the previous commit ensure that the new CAOpenGLLayer based video output is used on macOS 10.14 and higher if the output selection is set to automatic. Forward-port from 3.0.x branch. Cherry-picked from commit bbd1dca5. Signed-off-by:
Alexandre Janniaux <ajanni@videolabs.io>
6bc300f3