[vlc-commits] [Git][videolan/vlc][master] 2 commits: display: trigger place change on format update
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Tue Sep 1 10:30:26 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
bb243738 by Alexandre Janniaux at 2026-09-01T12:08:29+02:00
display: trigger place change on format update
Update format can change the source format, which can trigger a place
change if the dimensions or aspect ratio are changing.
- - - - -
637a652f by Alexandre Janniaux at 2026-09-01T12:08:29+02:00
display: expose vout_display_SetFormat API
The vout display API currently store an internal state in the core,
tracking what was previously requested to the vout_display by previous
clients.
Recently, this state has been used to provide a vout_display place to
the vout_display modules which used it to place the video frame and the
subpictures on screen. This enforced the usage of a core vout_display
API to manipulate the vout_display objects.
However, there were no vout_display core API to update the format of the
displays, and calling the callback function directly led to
discrepancies between the internal core state and the format visible to
the vout display through the pictures.
This commit introduces a core API to circumvent that, but later commits
will eventually get rid of the internal state, like it's done for the
vout_window implementation.
- - - - -
3 changed files:
- include/vlc_vout_display.h
- src/libvlccore.sym
- src/video_output/display.c
Changes:
=====================================
include/vlc_vout_display.h
=====================================
@@ -489,6 +489,26 @@ static inline void vout_display_Display(vout_display_t *vd, picture_t *picture)
VLC_API
void vout_display_SetSize(vout_display_t *vd, unsigned width, unsigned height);
+/**
+ * Updates the video format for an existing display.
+ *
+ * This function changes the input video format of a vout display by calling
+ * the display module's update_format callback. It handles internal format
+ * updates, video context management, and display converter cleanup when the
+ * format change is accepted by the display module.
+ *
+ * \note The format size is not expected to change.
+ *
+ * \param vd the vout display to update
+ * \param fmt the new video format to set
+ * \param vctx the video context associated with the format (may be NULL)
+ * \return VLC_SUCCESS on success, VLC_EGENERIC if the display module doesn't
+ * support format updates, or another error code on failure
+ */
+VLC_API
+int vout_display_SetFormat(vout_display_t *, const video_format_t *fmt,
+ vlc_video_context *vctx);
+
static inline void vout_display_SendEventMousePressed(vout_display_t *vd, int button)
{
vlc_window_ReportMousePressed(vd->cfg->window, button);
=====================================
src/libvlccore.sym
=====================================
@@ -799,6 +799,7 @@ vout_display_New
vout_display_Delete
vout_display_Prepare
vout_display_SetSize
+vout_display_SetFormat
xml_Create
text_style_Copy
text_style_Create
=====================================
src/video_output/display.c
=====================================
@@ -779,9 +779,26 @@ int vout_SetDisplayFormat(vout_display_t *vd, const video_format_t *fmt,
osys->converter = NULL;
}
+ bool place_changed = PlaceVideoInDisplay(osys);
+ if (place_changed && vd->ops->video_place_changed != NULL)
+ {
+ int ret = vd->ops->video_place_changed(vd, &osys->src_place);
+ if (ret != VLC_SUCCESS)
+ {
+ msg_Dbg(vd, "update format update place change failed");
+ return ret;
+ }
+ }
+
return VLC_SUCCESS;
}
+int vout_display_SetFormat(vout_display_t *vd, const video_format_t *fmt,
+ vlc_video_context *vctx)
+{
+ return vout_SetDisplayFormat(vd, fmt, vctx);
+}
+
void vout_SetDisplayProjection(vout_display_t *vd,
video_projection_mode_t projection)
{
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/35e48e569e252eb12552c7f90dbd753a41b9bb30...637a652f4ed0489564861d0638b99b8b3326b3fb
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/35e48e569e252eb12552c7f90dbd753a41b9bb30...637a652f4ed0489564861d0638b99b8b3326b3fb
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list