[vlc-commits] msw: shrink events data structure
Rémi Denis-Courmont
git at videolan.org
Thu Oct 16 19:25:56 CEST 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 9 22:33:34 2014 +0300| [643f98a114525241dc3b1acc63e3bb75ca85ac1e] | committer: Rémi Denis-Courmont
msw: shrink events data structure
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=643f98a114525241dc3b1acc63e3bb75ca85ac1e
---
modules/video_output/msw/common.c | 9 +++----
modules/video_output/msw/direct3d.c | 9 +++----
modules/video_output/msw/events.c | 48 +++++++++++++++++++++--------------
modules/video_output/msw/events.h | 6 +++--
4 files changed, 41 insertions(+), 31 deletions(-)
diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c
index fbf790c..d1728b0 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -78,11 +78,10 @@ int CommonInit(vout_display_t *vd)
#ifdef MODULE_NAME_IS_directdraw
cfg.use_overlay = sys->use_overlay;
#endif
- cfg.win.type = VOUT_WINDOW_TYPE_HWND;
- cfg.win.x = var_InheritInteger(vd, "video-x");
- cfg.win.y = var_InheritInteger(vd, "video-y");
- cfg.win.width = vd->cfg->display.width;
- cfg.win.height = vd->cfg->display.height;
+ cfg.x = var_InheritInteger(vd, "video-x");
+ cfg.y = var_InheritInteger(vd, "video-y");
+ cfg.width = vd->cfg->display.width;
+ cfg.height = vd->cfg->display.height;
event_hwnd_t hwnd;
if (EventThreadStart(sys->event, &hwnd, &cfg))
diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index 7fa4585..2f6a9c6 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -399,11 +399,10 @@ static int ControlReopenDevice(vout_display_t *vd)
memset(&cfg, 0, sizeof(cfg));
cfg.use_desktop = sys->use_desktop;
if (!sys->use_desktop) {
- cfg.win.type = VOUT_WINDOW_TYPE_HWND;
- cfg.win.x = sys->desktop_save.win.left;
- cfg.win.y = sys->desktop_save.win.top;
- cfg.win.width = sys->desktop_save.win.right - sys->desktop_save.win.left;
- cfg.win.height = sys->desktop_save.win.bottom - sys->desktop_save.win.top;
+ cfg.x = sys->desktop_save.win.left;
+ cfg.y = sys->desktop_save.win.top;
+ cfg.width = sys->desktop_save.win.right - sys->desktop_save.win.left;
+ cfg.height = sys->desktop_save.win.bottom - sys->desktop_save.win.top;
}
event_hwnd_t hwnd;
diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index a1fe018..934f0fe 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -75,8 +75,9 @@ struct event_thread_t
/* Title */
char *psz_title;
- int i_window_style;
- vout_window_cfg_t wnd_cfg;
+ int i_window_style;
+ int x, y;
+ unsigned width, height;
/* */
vout_window_t *parent_window;
@@ -414,15 +415,13 @@ void EventThreadUpdateWindowPosition( event_thread_t *p_event,
int x, int y, unsigned w, unsigned h )
{
vlc_mutex_lock( &p_event->lock );
- *pb_moved = x != p_event->wnd_cfg.x ||
- y != p_event->wnd_cfg.y;
- *pb_resized = w != p_event->wnd_cfg.width ||
- h != p_event->wnd_cfg.height;
-
- p_event->wnd_cfg.x = x;
- p_event->wnd_cfg.y = y;
- p_event->wnd_cfg.width = w;
- p_event->wnd_cfg.height = h;
+ *pb_moved = x != p_event->x || y != p_event->y;
+ *pb_resized = w != p_event->width || h != p_event->height;
+
+ p_event->x = x;
+ p_event->y = y;
+ p_event->width = w;
+ p_event->height = h;
vlc_mutex_unlock( &p_event->lock );
}
@@ -495,7 +494,10 @@ int EventThreadStart( event_thread_t *p_event, event_hwnd_t *p_hwnd, const event
{
p_event->use_desktop = p_cfg->use_desktop;
p_event->use_overlay = p_cfg->use_overlay;
- p_event->wnd_cfg = p_cfg->win;
+ p_event->x = p_cfg->x;
+ p_event->y = p_cfg->y;
+ p_event->width = p_cfg->width;
+ p_event->height = p_cfg->height;
p_event->has_moved = false;
@@ -683,8 +685,16 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
if( !p_event->use_desktop )
{
#endif
+ vout_window_cfg_t wnd_cfg = {
+ .type = VOUT_WINDOW_TYPE_HWND,
+ .x = p_event->x,
+ .y = p_event->y,
+ .width = p_event->width,
+ .height = p_event->height,
+ };
+
/* If an external window was specified, we'll draw in it. */
- p_event->parent_window = vout_display_NewWindow(vd, &p_event->wnd_cfg );
+ p_event->parent_window = vout_display_NewWindow(vd, &wnd_cfg );
if( p_event->parent_window )
p_event->hparent = p_event->parent_window->handle.hwnd;
else
@@ -746,8 +756,8 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
* the window corresponding to the useable surface we want */
rect_window.left = 10;
rect_window.top = 10;
- rect_window.right = rect_window.left + p_event->wnd_cfg.width;
- rect_window.bottom = rect_window.top + p_event->wnd_cfg.height;
+ rect_window.right = rect_window.left + p_event->width;
+ rect_window.bottom = rect_window.top + p_event->height;
if( var_GetBool( vd, "video-deco" ) )
{
@@ -785,10 +795,10 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
p_event->class_main, /* name of window class */
_T(VOUT_TITLE) _T(" (VLC Video Output)"), /* window title */
i_style, /* window style */
- (!p_event->wnd_cfg.x) ? (UINT)CW_USEDEFAULT :
- (UINT)p_event->wnd_cfg.x, /* default X coordinate */
- (!p_event->wnd_cfg.y) ? (UINT)CW_USEDEFAULT :
- (UINT)p_event->wnd_cfg.y, /* default Y coordinate */
+ (!p_event->x) ? (UINT)CW_USEDEFAULT :
+ (UINT)p_event->x, /* default X coordinate */
+ (!p_event->y) ? (UINT)CW_USEDEFAULT :
+ (UINT)p_event->y, /* default Y coordinate */
rect_window.right - rect_window.left, /* window width */
rect_window.bottom - rect_window.top, /* window height */
p_event->hparent, /* parent window */
diff --git a/modules/video_output/msw/events.h b/modules/video_output/msw/events.h
index 92d2e52..25372c6 100644
--- a/modules/video_output/msw/events.h
+++ b/modules/video_output/msw/events.h
@@ -32,8 +32,10 @@ typedef struct event_thread_t event_thread_t;
typedef struct {
bool use_desktop; /* direct3d */
bool use_overlay; /* directx */
-
- vout_window_cfg_t win;
+ int x;
+ int y;
+ unsigned width;
+ unsigned height;
} event_cfg_t;
typedef struct {
More information about the vlc-commits
mailing list