Commit 904ef782 authored by Laurent Aimar's avatar Laurent Aimar

Changed the prototype of vout_display_SendEventDisplaySize.

It is needed to avoid problems with threaded event.
parent 5b8dcc36
...@@ -174,7 +174,7 @@ enum { ...@@ -174,7 +174,7 @@ enum {
VOUT_DISPLAY_EVENT_FULLSCREEN, VOUT_DISPLAY_EVENT_FULLSCREEN,
VOUT_DISPLAY_EVENT_DISPLAY_SIZE, /* The display size need to change : int i_width, int i_height */ VOUT_DISPLAY_EVENT_DISPLAY_SIZE, /* The display size need to change : int i_width, int i_height, bool is_fullscreen */
/* */ /* */
VOUT_DISPLAY_EVENT_CLOSE, VOUT_DISPLAY_EVENT_CLOSE,
...@@ -315,9 +315,9 @@ static inline void vout_display_SendEvent(vout_display_t *vd, int query, ...) ...@@ -315,9 +315,9 @@ static inline void vout_display_SendEvent(vout_display_t *vd, int query, ...)
va_end(args); va_end(args);
} }
static inline void vout_display_SendEventDisplaySize(vout_display_t *vd, int width, int height) static inline void vout_display_SendEventDisplaySize(vout_display_t *vd, int width, int height, bool is_fullscreen)
{ {
vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_DISPLAY_SIZE, width, height); vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_DISPLAY_SIZE, width, height, is_fullscreen);
} }
static inline void vout_display_SendEventPicturesInvalid(vout_display_t *vd) static inline void vout_display_SendEventPicturesInvalid(vout_display_t *vd)
{ {
......
...@@ -314,6 +314,7 @@ struct vout_display_owner_sys_t { ...@@ -314,6 +314,7 @@ struct vout_display_owner_sys_t {
bool ch_display_size; bool ch_display_size;
int display_width; int display_width;
int display_height; int display_height;
bool display_is_fullscreen;
bool ch_display_filled; bool ch_display_filled;
bool is_display_filled; bool is_display_filled;
...@@ -554,12 +555,15 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args) ...@@ -554,12 +555,15 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
case VOUT_DISPLAY_EVENT_DISPLAY_SIZE: { case VOUT_DISPLAY_EVENT_DISPLAY_SIZE: {
const int width = (int)va_arg(args, int); const int width = (int)va_arg(args, int);
const int height = (int)va_arg(args, int); const int height = (int)va_arg(args, int);
msg_Dbg(vd, "VoutDisplayEvent 'resize' %dx%d", width, height); const bool is_fullscreen = (bool)va_arg(args, int);
msg_Dbg(vd, "VoutDisplayEvent 'resize' %dx%d %s",
width, height, is_fullscreen ? "fullscreen" : "window");
/* */ /* */
osys->ch_display_size = true; osys->ch_display_size = true;
osys->display_width = width; osys->display_width = width;
osys->display_height = height; osys->display_height = height;
osys->display_is_fullscreen = is_fullscreen;
break; break;
} }
...@@ -647,8 +651,10 @@ void vout_ManageDisplay(vout_display_t *vd) ...@@ -647,8 +651,10 @@ void vout_ManageDisplay(vout_display_t *vd)
cfg.display.width = osys->display_width; cfg.display.width = osys->display_width;
cfg.display.height = osys->display_height; cfg.display.height = osys->display_height;
if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, &cfg)) { if (!cfg.is_fullscreen != !osys->display_is_fullscreen ||
msg_Err(vd, "Failed to resize display"); vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, &cfg)) {
if (!cfg.is_fullscreen == !osys->display_is_fullscreen)
msg_Err(vd, "Failed to resize display");
/* We ignore the resized */ /* We ignore the resized */
osys->display_width = osys->cfg.display.width; osys->display_width = osys->cfg.display.width;
...@@ -657,7 +663,7 @@ void vout_ManageDisplay(vout_display_t *vd) ...@@ -657,7 +663,7 @@ void vout_ManageDisplay(vout_display_t *vd)
osys->cfg.display.width = osys->display_width; osys->cfg.display.width = osys->display_width;
osys->cfg.display.height = osys->display_height; osys->cfg.display.height = osys->display_height;
if (!osys->is_fullscreen) { if (!osys->display_is_fullscreen) {
osys->width_saved = osys->display_width; osys->width_saved = osys->display_width;
osys->height_saved = osys->display_height; osys->height_saved = osys->display_height;
} }
...@@ -698,9 +704,10 @@ void vout_ManageDisplay(vout_display_t *vd) ...@@ -698,9 +704,10 @@ void vout_ManageDisplay(vout_display_t *vd)
osys->zoom.num = osys->cfg.zoom.num; osys->zoom.num = osys->cfg.zoom.num;
osys->zoom.den = osys->cfg.zoom.den; osys->zoom.den = osys->cfg.zoom.den;
} else if (cfg.is_display_filled) { } else if (cfg.is_display_filled) {
osys->ch_display_size = true; const int display_width = (int64_t)vd->source.i_width * osys->zoom.num / osys->zoom.den;
osys->display_width = (int64_t)vd->source.i_width * osys->zoom.num / osys->zoom.den; const int display_height = (int64_t)vd->source.i_height * osys->zoom.num / osys->zoom.den;
osys->display_height = (int64_t)vd->source.i_height * osys->zoom.num / osys->zoom.den;
vout_display_SendEventDisplaySize(vd, display_width, display_height, osys->cfg.is_fullscreen);
} }
osys->cfg.zoom.num = osys->zoom.num; osys->cfg.zoom.num = osys->zoom.num;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment