[vlc-commits] [Git][videolan/vlc][master] 5 commits: opengl: display: use shallow video format copy for positioning
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Jun 11 11:16:45 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
ede1b4a4 by Steve Lhomme at 2025-06-11T11:02:11+00:00
opengl: display: use shallow video format copy for positioning
We don't care about the palette or colorimetry to position the video.
- - - - -
34780921 by Steve Lhomme at 2025-06-11T11:02:11+00:00
opengl: display: avoid redundant place_changed setting
It's already set by the PlacePicture() call above.
- - - - -
5fbf4b4a by Steve Lhomme at 2025-06-11T11:02:11+00:00
opengl: display: merge UpdateConfig() and PlacePicture()
They are doing the same thing (sometimes twice).
- - - - -
d5a0f9f1 by Steve Lhomme at 2025-06-11T11:02:11+00:00
opengl: display remove unneeded fallthrough
So that the resizing and placement are distinct.
- - - - -
52ed2542 by Steve Lhomme at 2025-06-11T11:02:11+00:00
opengl: display: ensure the video placement in normal mode matches the core
The core is expecting the display module to put the video in an exact position
so it matches the position of subtitles inside the video.
- - - - -
1 changed file:
- modules/video_output/opengl/display.c
Changes:
=====================================
modules/video_output/opengl/display.c
=====================================
@@ -134,9 +134,7 @@ static void PlacePicture(vout_display_t *vd, vout_display_place_t *place,
/* Copy the initial source, sine we might rotate it to fake a rotated
* display also. */
- video_format_t source;
- video_format_Init(&source, 0);
- video_format_Copy(&source, vd->source);
+ video_format_t source = *vd->source;
video_transform_t transform = (video_transform_t)sys->gl->orientation;
video_format_TransformBy(&source, transform_Inverse(transform));
@@ -161,20 +159,14 @@ static void PlacePicture(vout_display_t *vd, vout_display_place_t *place,
}
sys->place_changed = true;
- video_format_Clean(&source);
-}
-
-static void UpdateConfig(vout_display_t *vd)
-{
- vout_display_sys_t *sys = vd->sys;
- PlacePicture(vd, &sys->place, vd->cfg->display);
- sys->place_changed = true;
+ assert(sys->gl->orientation != ORIENT_NORMAL || place->x == vd->place->x);
+ assert(sys->gl->orientation != ORIENT_NORMAL || place->y == (int)(vd->cfg->display.height - (vd->place->y + vd->place->height)));
}
static int ChangeSourceProjection(vout_display_t *vd, video_projection_mode_t projection)
{
vout_display_sys_t *sys = vd->sys;
- UpdateConfig(vd);
+ PlacePicture(vd, &sys->place, vd->cfg->display);
sys->restart_renderer = true;
return VLC_SUCCESS;
}
@@ -182,7 +174,7 @@ static int ChangeSourceProjection(vout_display_t *vd, video_projection_mode_t pr
static int SetStereoMode(vout_display_t *vd, vlc_stereoscopic_mode_t mode)
{
vout_display_sys_t *sys = vd->sys;
- UpdateConfig(vd);
+ PlacePicture(vd, &sys->place, vd->cfg->display);
sys->stereo.mode = mode;
sys->stereo.changed = true;
return VLC_SUCCESS;
@@ -256,7 +248,6 @@ static int Open(vout_display_t *vd,
struct vout_display_placement dp = vd->cfg->display;
PlacePicture(vd, &sys->place, dp);
- sys->place_changed = true;
sys->stereo.changed = false;
vlc_gl_Resize (sys->gl, vd->cfg->display.width, vd->cfg->display.height);
@@ -367,20 +358,14 @@ static int Control (vout_display_t *vd, int query)
{
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
- UpdateConfig(vd);
+ PlacePicture(vd, &sys->place, vd->cfg->display);
vlc_gl_Resize (sys->gl, vd->cfg->display.width, vd->cfg->display.height);
- // fallthrough
+ return VLC_SUCCESS;
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
case VOUT_DISPLAY_CHANGE_SOURCE_PLACE:
- {
- struct vout_display_placement dp = vd->cfg->display;
-
- PlacePicture(vd, &sys->place, dp);
- sys->place_changed = true;
- UpdateConfig(vd);
+ PlacePicture(vd, &sys->place, vd->cfg->display);
return VLC_SUCCESS;
- }
default:
msg_Err (vd, "Unknown request %d", query);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/05fdfc59c98f8689b2d1b671479f013360d2b9f8...52ed25426cf7307d046a4ca696ca58572dae9fa9
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/05fdfc59c98f8689b2d1b671479f013360d2b9f8...52ed25426cf7307d046a4ca696ca58572dae9fa9
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list