Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
8a27f191
Commit
8a27f191
authored
Sep 08, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Centralized common init/clean code (msw).
parent
e17db4e3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
147 deletions
+86
-147
modules/video_output/msw/common.c
modules/video_output/msw/common.c
+50
-0
modules/video_output/msw/direct3d.c
modules/video_output/msw/direct3d.c
+14
-42
modules/video_output/msw/directx.c
modules/video_output/msw/directx.c
+5
-28
modules/video_output/msw/glwin32.c
modules/video_output/msw/glwin32.c
+7
-30
modules/video_output/msw/vout.h
modules/video_output/msw/vout.h
+3
-0
modules/video_output/msw/wingdi.c
modules/video_output/msw/wingdi.c
+7
-47
No files found.
modules/video_output/msw/common.c
View file @
8a27f191
...
...
@@ -72,6 +72,56 @@
static
int
vaControlParentWindow
(
vout_thread_t
*
,
int
,
va_list
);
/* */
int
CommonInit
(
vout_thread_t
*
p_vout
)
{
vout_sys_t
*
p_sys
=
p_vout
->
p_sys
;
p_sys
->
hwnd
=
NULL
;
p_sys
->
hvideownd
=
NULL
;
p_sys
->
hparent
=
NULL
;
p_sys
->
hfswnd
=
NULL
;
p_sys
->
i_changes
=
0
;
SetRectEmpty
(
&
p_sys
->
rect_display
);
SetRectEmpty
(
&
p_sys
->
rect_parent
);
p_sys
->
b_cursor_hidden
=
0
;
p_sys
->
i_lastmoved
=
mdate
();
p_sys
->
i_mouse_hide_timeout
=
var_GetInteger
(
p_vout
,
"mouse-hide-timeout"
)
*
1000
;
var_Create
(
p_vout
,
"video-title"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
/* Set main window's size */
p_sys
->
i_window_width
=
p_vout
->
i_window_width
;
p_sys
->
i_window_height
=
p_vout
->
i_window_height
;
if
(
!
CreateEventThread
(
p_vout
)
)
return
VLC_EGENERIC
;
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
var_TriggerCallback
(
p_vout
,
"video-on-top"
);
/* Why not with glwin32 */
#if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32)
var_Create
(
p_vout
,
"disable-screensaver"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
DisableScreensaver
(
p_vout
);
#endif
return
VLC_SUCCESS
;
}
/* */
void
CommonClean
(
vout_thread_t
*
p_vout
)
{
StopEventThread
(
p_vout
);
#if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32)
RestoreScreensaver
(
p_vout
);
#endif
}
/*****************************************************************************
* UpdateRects: update clipping rectangles
*****************************************************************************
...
...
modules/video_output/msw/direct3d.c
View file @
8a27f191
...
...
@@ -194,50 +194,25 @@ static int OpenVideo( vlc_object_t *p_this )
p_vout
->
pf_display
=
FirstDisplay
;
p_vout
->
pf_control
=
Control
;
p_vout
->
p_sys
->
hwnd
=
p_vout
->
p_sys
->
hvideownd
=
NULL
;
p_vout
->
p_sys
->
hparent
=
p_vout
->
p_sys
->
hfswnd
=
NULL
;
p_vout
->
p_sys
->
i_changes
=
0
;
p_vout
->
p_sys
->
b_desktop
=
false
;
SetRectEmpty
(
&
p_vout
->
p_sys
->
rect_display
);
SetRectEmpty
(
&
p_vout
->
p_sys
->
rect_parent
);
if
(
CommonInit
(
p_vout
)
)
goto
error
;
p_vout
->
p_sys
->
b_desktop
=
false
;
var_Create
(
p_vout
,
"directx-hw-yuv"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"directx-device"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
p_vout
->
p_sys
->
b_cursor_hidden
=
0
;
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
p_vout
->
p_sys
->
i_mouse_hide_timeout
=
var_GetInteger
(
p_vout
,
"mouse-hide-timeout"
)
*
1000
;
var_Create
(
p_vout
,
"video-title"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"disable-screensaver"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
/* Set main window's size */
p_vout
->
p_sys
->
i_window_width
=
p_vout
->
i_window_width
;
p_vout
->
p_sys
->
i_window_height
=
p_vout
->
i_window_height
;
if
(
CreateEventThread
(
p_vout
)
)
{
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
var_TriggerCallback
(
p_vout
,
"video-on-top"
);
/* Trigger a callback right now */
var_Create
(
p_vout
,
"direct3d-desktop"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
val
.
psz_string
=
_
(
"Desktop"
);
var_Change
(
p_vout
,
"direct3d-desktop"
,
VLC_VAR_SETTEXT
,
&
val
,
NULL
);
var_AddCallback
(
p_vout
,
"direct3d-desktop"
,
DesktopCallback
,
NULL
);
var_TriggerCallback
(
p_vout
,
"direct3d-desktop"
);
/* Trigger a callback right now */
var_Create
(
p_vout
,
"direct3d-desktop"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
val
.
psz_string
=
_
(
"Desktop"
);
var_Change
(
p_vout
,
"direct3d-desktop"
,
VLC_VAR_SETTEXT
,
&
val
,
NULL
);
var_AddCallback
(
p_vout
,
"direct3d-desktop"
,
DesktopCallback
,
NULL
);
var_TriggerCallback
(
p_vout
,
"direct3d-desktop"
);
DisableScreensaver
(
p_vout
)
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
else
{
CloseVideo
(
VLC_OBJECT
(
p_vout
)
);
return
VLC_EGENERIC
;
}
error:
CloseVideo
(
VLC_OBJECT
(
p_vout
)
);
return
VLC_EGENERIC
;
}
/*****************************************************************************
...
...
@@ -251,12 +226,9 @@ static void CloseVideo( vlc_object_t *p_this )
Direct3DVoutRelease
(
p_vout
);
StopEventThread
(
p_vout
);
RestoreScreensaver
(
p_vout
);
CommonClean
(
p_vout
);
free
(
p_vout
->
p_sys
);
p_vout
->
p_sys
=
NULL
;
}
/*****************************************************************************
...
...
modules/video_output/msw/directx.c
View file @
8a27f191
...
...
@@ -227,16 +227,15 @@ static int OpenVideo( vlc_object_t *p_this )
p_vout
->
pf_display
=
FirstDisplay
;
p_vout
->
pf_control
=
Control
;
if
(
CommonInit
(
p_vout
)
)
goto
error
;
/* */
p_vout
->
p_sys
->
p_ddobject
=
NULL
;
p_vout
->
p_sys
->
p_display
=
NULL
;
p_vout
->
p_sys
->
p_current_surface
=
NULL
;
p_vout
->
p_sys
->
p_clipper
=
NULL
;
p_vout
->
p_sys
->
hwnd
=
p_vout
->
p_sys
->
hvideownd
=
NULL
;
p_vout
->
p_sys
->
hparent
=
p_vout
->
p_sys
->
hfswnd
=
NULL
;
p_vout
->
p_sys
->
i_changes
=
0
;
p_vout
->
p_sys
->
b_wallpaper
=
0
;
SetRectEmpty
(
&
p_vout
->
p_sys
->
rect_display
);
SetRectEmpty
(
&
p_vout
->
p_sys
->
rect_parent
);
/* Multimonitor stuff */
p_vout
->
p_sys
->
hmonitor
=
NULL
;
...
...
@@ -256,20 +255,6 @@ static int OpenVideo( vlc_object_t *p_this )
var_Create
(
p_vout
,
"directx-hw-yuv"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"directx-3buffering"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"directx-device"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"video-title"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"disable-screensaver"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
p_vout
->
p_sys
->
b_cursor_hidden
=
0
;
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
p_vout
->
p_sys
->
i_mouse_hide_timeout
=
var_GetInteger
(
p_vout
,
"mouse-hide-timeout"
)
*
1000
;
/* Set main window's size */
p_vout
->
p_sys
->
i_window_width
=
p_vout
->
i_window_width
;
p_vout
->
p_sys
->
i_window_height
=
p_vout
->
i_window_height
;
if
(
!
CreateEventThread
(
p_vout
)
)
goto
error
;
/* Initialise DirectDraw */
if
(
DirectXInitDDraw
(
p_vout
)
)
...
...
@@ -285,10 +270,6 @@ static int OpenVideo( vlc_object_t *p_this )
goto
error
;
}
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
var_TriggerCallback
(
p_vout
,
"video-on-top"
);
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
var_Create
(
p_vout
,
"directx-wallpaper"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
...
...
@@ -297,8 +278,6 @@ static int OpenVideo( vlc_object_t *p_this )
var_AddCallback
(
p_vout
,
"directx-wallpaper"
,
WallpaperCallback
,
NULL
);
var_TriggerCallback
(
p_vout
,
"directx-wallpaper"
);
DisableScreensaver
(
p_vout
);
return
VLC_SUCCESS
;
error:
...
...
@@ -438,13 +417,11 @@ static void CloseVideo( vlc_object_t *p_this )
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
StopEventThread
(
p_vout
);
/* Make sure the wallpaper is restored */
var_DelCallback
(
p_vout
,
"directx-wallpaper"
,
WallpaperCallback
,
NULL
);
SwitchWallpaperMode
(
p_vout
,
false
);
RestoreScreensaver
(
p_vout
);
CommonClean
(
p_vout
);
free
(
p_vout
->
p_sys
);
}
...
...
modules/video_output/msw/glwin32.c
View file @
8a27f191
...
...
@@ -104,36 +104,14 @@ static int OpenVideo( vlc_object_t *p_this )
p_vout
->
pf_swap
=
FirstSwap
;
p_vout
->
pf_control
=
Control
;
p_vout
->
p_sys
->
hwnd
=
p_vout
->
p_sys
->
hvideownd
=
NULL
;
p_vout
->
p_sys
->
hparent
=
p_vout
->
p_sys
->
hfswnd
=
NULL
;
p_vout
->
p_sys
->
i_changes
=
0
;
SetRectEmpty
(
&
p_vout
->
p_sys
->
rect_display
);
SetRectEmpty
(
&
p_vout
->
p_sys
->
rect_parent
);
if
(
CommonInit
(
p_vout
)
)
goto
error
;
var_Create
(
p_vout
,
"video-title"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
p_vout
->
p_sys
->
b_cursor_hidden
=
0
;
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
p_vout
->
p_sys
->
i_mouse_hide_timeout
=
var_GetInteger
(
p_vout
,
"mouse-hide-timeout"
)
*
1000
;
/* Set main window's size */
p_vout
->
p_sys
->
i_window_width
=
p_vout
->
i_window_width
;
p_vout
->
p_sys
->
i_window_height
=
p_vout
->
i_window_height
;
if
(
CreateEventThread
(
p_vout
)
)
{
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
var_TriggerCallback
(
p_vout
,
"video-on-top"
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
else
{
CloseVideo
(
VLC_OBJECT
(
p_vout
)
);
return
VLC_EGENERIC
;
}
error:
CloseVideo
(
VLC_OBJECT
(
p_vout
)
);
return
VLC_EGENERIC
;
}
/*****************************************************************************
...
...
@@ -191,10 +169,9 @@ static void CloseVideo( vlc_object_t *p_this )
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
StopEventThread
(
p_vout
);
CommonClean
(
p_vout
);
free
(
p_vout
->
p_sys
);
p_vout
->
p_sys
=
NULL
;
}
/*****************************************************************************
...
...
modules/video_output/msw/vout.h
View file @
8a27f191
...
...
@@ -262,6 +262,9 @@ void StopEventThread ( vout_thread_t *p_vout );
/*****************************************************************************
* Prototypes from common.c
*****************************************************************************/
int
CommonInit
(
vout_thread_t
*
);
void
CommonClean
(
vout_thread_t
*
);
int
Control
(
vout_thread_t
*
p_vout
,
int
i_query
,
va_list
args
);
void
UpdateRects
(
vout_thread_t
*
p_vout
,
bool
b_force
);
...
...
modules/video_output/msw/wingdi.c
View file @
8a27f191
...
...
@@ -141,13 +141,6 @@ static int OpenVideo ( vlc_object_t *p_this )
p_vout
->
p_sys
->
render_height
=
p_vout
->
render
.
i_height
;
#endif
p_vout
->
p_sys
->
p_event
=
vlc_object_create
(
p_vout
,
sizeof
(
event_thread_t
)
);
if
(
!
p_vout
->
p_sys
->
p_event
)
{
free
(
p_vout
->
p_sys
);
return
VLC_ENOMEM
;
}
p_vout
->
pf_init
=
Init
;
p_vout
->
pf_end
=
End
;
p_vout
->
pf_manage
=
Manage
;
...
...
@@ -158,46 +151,18 @@ static int OpenVideo ( vlc_object_t *p_this )
p_vout
->
p_sys
->
b_focus
=
0
;
p_vout
->
p_sys
->
b_parent_focus
=
0
;
#else
p_vout
->
pf_display
=
FirstDisplayGDI
;
#endif
p_vout
->
p_sys
->
hwnd
=
p_vout
->
p_sys
->
hvideownd
=
NULL
;
p_vout
->
p_sys
->
hparent
=
p_vout
->
p_sys
->
hfswnd
=
NULL
;
p_vout
->
p_sys
->
i_changes
=
0
;
SetRectEmpty
(
&
p_vout
->
p_sys
->
rect_display
);
SetRectEmpty
(
&
p_vout
->
p_sys
->
rect_parent
);
var_Create
(
p_vout
,
"video-title"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"disable-screensaver"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
p_vout
->
p_sys
->
b_cursor_hidden
=
0
;
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
p_vout
->
p_sys
->
i_mouse_hide_timeout
=
var_GetInteger
(
p_vout
,
"mouse-hide-timeout"
)
*
1000
;
/* Set main window's size */
p_vout
->
p_sys
->
i_window_width
=
p_vout
->
i_window_width
;
p_vout
->
p_sys
->
i_window_height
=
p_vout
->
i_window_height
;
if
(
CreateEventThread
(
p_vout
)
)
{
if
(
CommonInit
(
p_vout
)
)
goto
error
;
#ifndef UNDER_CE
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
var_TriggerCallback
(
p_vout
,
"video-on-top"
);
return
VLC_SUCCESS
;
DisableScreensaver
(
p_vout
);
#endif
return
VLC_SUCCESS
;
}
else
{
CloseVideo
(
VLC_OBJECT
(
p_vout
)
);
return
VLC_EGENERIC
;
}
error:
CloseVideo
(
VLC_OBJECT
(
p_vout
)
);
return
VLC_EGENERIC
;
}
/*****************************************************************************
...
...
@@ -207,18 +172,13 @@ static void CloseVideo ( vlc_object_t *p_this )
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
StopEventThread
(
p_vout
);
#ifndef UNDER_CE
RestoreScreensaver
(
p_vout
);
#endif
CommonClean
(
p_vout
);
#ifdef MODULE_NAME_IS_wingapi
FreeLibrary
(
p_vout
->
p_sys
->
gapi_dll
);
#endif
free
(
p_vout
->
p_sys
);
p_vout
->
p_sys
=
NULL
;
}
/*****************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment