[vlc-commits] [Git][videolan/vlc][master] 2 commits: vout/window: add new dimensions to resize ack
Jean-Baptiste Kempf
gitlab at videolan.org
Thu Jun 10 08:53:01 UTC 2021
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
dabfd605 by Rémi Denis-Courmont at 2021-06-10T08:19:00+00:00
vout/window: add new dimensions to resize ack
- - - - -
0b161909 by Rémi Denis-Courmont at 2021-06-10T08:19:00+00:00
xdg-shell: update window geometry with ack
This makes sure that the window geometry is updated before the first
new size buffer is attached.
- - - - -
5 changed files:
- include/vlc_vout_window.h
- modules/video_output/splitter.c
- modules/video_output/wayland/xdg-shell.c
- src/video_output/opengl.c
- src/video_output/window.c
Changes:
=====================================
include/vlc_vout_window.h
=====================================
@@ -175,8 +175,13 @@ typedef struct vout_window_cfg_t {
/**
* Callback prototype for window event acknowledgement.
+ *
+ * @param width pixel width as supplied to vout_window_callbacks::resized
+ * @param height pixel height as supplied to vout_window_callbacks::resized
+ * @param data opaque pointer as supplied to vout_window_callbacks::resized
*/
-typedef void (*vout_window_ack_cb)(struct vout_window_t *, void *);
+typedef void (*vout_window_ack_cb)(struct vout_window_t *, unsigned width,
+ unsigned height, void *data);
/**
* Window event callbacks structure.
=====================================
modules/video_output/splitter.c
=====================================
@@ -148,7 +148,7 @@ static void vlc_vidsplit_window_Resized(vout_window_t *wnd,
vout_display_SetSize(part->display, width, height);
if (cb != NULL)
- cb(wnd, opaque);
+ cb(wnd, width, height, opaque);
vlc_sem_post(&part->lock);
}
=====================================
modules/video_output/wayland/xdg-shell.c
=====================================
@@ -157,7 +157,8 @@ static void *Thread(void *data)
//return NULL;
}
-static void ResizeAck(vout_window_t *wnd, void *data)
+static void ResizeAck(vout_window_t *wnd, unsigned width, unsigned height,
+ void *data)
{
#ifdef XDG_SHELL
vout_window_sys_t *sys = wnd->sys;
@@ -165,8 +166,10 @@ static void ResizeAck(vout_window_t *wnd, void *data)
if (serial != NULL)
xdg_surface_ack_configure(sys->surface, *serial);
+
+ xdg_surface_set_window_geometry(sys->surface, 0, 0, width, height);
#else
- (void) wnd; (void) data;
+ (void) wnd; (void) width; (void) height; (void) data;
#endif
}
@@ -179,7 +182,6 @@ static void ReportSize(vout_window_t *wnd, void *data)
unsigned height = sys->wm.height ? sys->wm.height : sys->set.height;
wnd->owner.cbs->resized(wnd, width, height, ResizeAck, data);
- xdg_surface_set_window_geometry(sys->surface, 0, 0, width, height);
}
static void Resize(vout_window_t *wnd, unsigned width, unsigned height)
=====================================
src/video_output/opengl.c
=====================================
@@ -196,7 +196,7 @@ static void vlc_gl_surface_ResizeNotify(vout_window_t *surface,
sys->height = height;
if (cb != NULL)
- cb(surface, opaque);
+ cb(surface, width, height, opaque);
vlc_mutex_unlock(&sys->lock);
}
=====================================
src/video_output/window.c
=====================================
@@ -201,6 +201,8 @@ void vout_window_ReportFullscreen(vout_window_t *window, const char *id)
struct vout_window_ack_data {
vout_window_t *window;
vout_window_ack_cb callback;
+ unsigned width;
+ unsigned height;
void *opaque;
};
@@ -209,7 +211,8 @@ static void vout_window_Ack(void *data)
struct vout_window_ack_data *cb_data = data;
if (cb_data->callback != NULL)
- cb_data->callback(cb_data->window, cb_data->opaque);
+ cb_data->callback(cb_data->window, cb_data->width, cb_data->height,
+ cb_data->opaque);
}
/* Video output display integration */
@@ -234,7 +237,7 @@ static void vout_display_window_ResizeNotify(vout_window_t *window,
{
vout_display_window_t *state = window->owner.sys;
vout_thread_t *vout = state->vout;
- struct vout_window_ack_data data = { window, cb, opaque };
+ struct vout_window_ack_data data = { window, cb, width, height, opaque };
msg_Dbg(window, "resized to %ux%u", width, height);
vout_ChangeDisplaySize(vout, width, height, vout_window_Ack, &data);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/122661ecd9967b777743967e29d13ca0da544259...0b161909070159f2950945ab8137ea218546bc80
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/122661ecd9967b777743967e29d13ca0da544259...0b161909070159f2950945ab8137ea218546bc80
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list