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
46b26be5
Commit
46b26be5
authored
Jan 15, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DirectDraw: port to UNICODE friendly APIs
This would need more testing and close look
parent
59f746f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
modules/video_output/msw/directx.c
modules/video_output/msw/directx.c
+13
-11
modules/video_output/msw/events.c
modules/video_output/msw/events.c
+3
-3
No files found.
modules/video_output/msw/directx.c
View file @
46b26be5
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
#include "common.h"
#include "common.h"
#ifdef UNICODE
#ifdef UNICODE
#
error "Unicode mode not suppor
ted"
#
warning "Unicode mode not tes
ted"
#endif
#endif
/*****************************************************************************
/*****************************************************************************
...
@@ -446,12 +446,14 @@ static BOOL WINAPI DirectXOpenDDrawCallback(GUID *guid, LPTSTR desc,
...
@@ -446,12 +446,14 @@ static BOOL WINAPI DirectXOpenDDrawCallback(GUID *guid, LPTSTR desc,
if
(
!
hmon
)
if
(
!
hmon
)
return
TRUE
;
return
TRUE
;
msg_Dbg
(
vd
,
"DirectXEnumCallback: %s, %s"
,
desc
,
drivername
);
char
*
psz_drivername
=
FromT
(
drivername
);
msg_Dbg
(
vd
,
"DirectXEnumCallback: %s, %s"
,
FromT
(
desc
),
psz_drivername
);
char
*
device
=
var_GetString
(
vd
,
"directx-device"
);
char
*
device
=
var_GetString
(
vd
,
"directx-device"
);
/* Check for forced device */
/* Check for forced device */
if
(
device
&&
*
device
&&
!
strcmp
(
drivername
,
device
))
{
if
(
device
&&
*
device
&&
!
strcmp
(
psz_
drivername
,
device
))
{
MONITORINFO
monitor_info
;
MONITORINFO
monitor_info
;
monitor_info
.
cbSize
=
sizeof
(
MONITORINFO
);
monitor_info
.
cbSize
=
sizeof
(
MONITORINFO
);
...
@@ -475,7 +477,7 @@ static BOOL WINAPI DirectXOpenDDrawCallback(GUID *guid, LPTSTR desc,
...
@@ -475,7 +477,7 @@ static BOOL WINAPI DirectXOpenDDrawCallback(GUID *guid, LPTSTR desc,
free
(
device
);
free
(
device
);
if
(
hmon
==
sys
->
hmonitor
)
{
if
(
hmon
==
sys
->
hmonitor
)
{
msg_Dbg
(
vd
,
"selecting %s, %s"
,
desc
,
drivername
);
msg_Dbg
(
vd
,
"selecting %s, %s"
,
FromT
(
desc
),
psz_
drivername
);
free
(
sys
->
display_driver
);
free
(
sys
->
display_driver
);
sys
->
display_driver
=
malloc
(
sizeof
(
*
guid
));
sys
->
display_driver
=
malloc
(
sizeof
(
*
guid
));
...
@@ -564,16 +566,16 @@ static int DirectXOpenDDraw(vout_display_t *vd)
...
@@ -564,16 +566,16 @@ static int DirectXOpenDDraw(vout_display_t *vd)
/* */
/* */
HRESULT
(
WINAPI
*
OurDirectDrawCreate
)(
GUID
*
,
LPDIRECTDRAW
*
,
IUnknown
*
);
HRESULT
(
WINAPI
*
OurDirectDrawCreate
)(
GUID
*
,
LPDIRECTDRAW
*
,
IUnknown
*
);
OurDirectDrawCreate
=
OurDirectDrawCreate
=
(
void
*
)
GetProcAddress
(
sys
->
hddraw_dll
,
_T
(
"DirectDrawCreate"
)
);
(
void
*
)
GetProcAddress
(
sys
->
hddraw_dll
,
"DirectDrawCreate"
);
if
(
!
OurDirectDrawCreate
)
{
if
(
!
OurDirectDrawCreate
)
{
msg_Err
(
vd
,
"DirectXInitDDraw failed GetProcAddress"
);
msg_Err
(
vd
,
"DirectXInitDDraw failed GetProcAddress"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
/* */
/* */
HRESULT
(
WINAPI
*
OurDirectDrawEnumerateEx
)(
LPDDENUMCALLBACKEX
A
,
LPVOID
,
DWORD
);
HRESULT
(
WINAPI
*
OurDirectDrawEnumerateEx
)(
LPDDENUMCALLBACKEX
,
LPVOID
,
DWORD
);
OurDirectDrawEnumerateEx
=
OurDirectDrawEnumerateEx
=
(
void
*
)
GetProcAddress
(
sys
->
hddraw_dll
,
_T
(
"DirectDrawEnumerateExA"
)
);
(
void
*
)
GetProcAddress
(
sys
->
hddraw_dll
,
"DirectDrawEnumerateEx"
);
if
(
OurDirectDrawEnumerateEx
)
{
if
(
OurDirectDrawEnumerateEx
)
{
char
*
device
=
var_GetString
(
vd
,
"directx-device"
);
char
*
device
=
var_GetString
(
vd
,
"directx-device"
);
...
@@ -1425,8 +1427,8 @@ static BOOL WINAPI DirectXEnumCallback2(GUID *guid, LPTSTR desc,
...
@@ -1425,8 +1427,8 @@ static BOOL WINAPI DirectXEnumCallback2(GUID *guid, LPTSTR desc,
ctx
->
descs
=
xrealloc
(
ctx
->
descs
,
(
ctx
->
count
+
1
)
*
sizeof
(
char
*
));
ctx
->
descs
=
xrealloc
(
ctx
->
descs
,
(
ctx
->
count
+
1
)
*
sizeof
(
char
*
));
/* TODO? Unicode APIs */
/* TODO? Unicode APIs */
ctx
->
values
[
ctx
->
count
]
=
From
ANSI
(
drivername
);
ctx
->
values
[
ctx
->
count
]
=
From
T
(
drivername
);
ctx
->
descs
[
ctx
->
count
]
=
From
ANSI
(
drivername
);
ctx
->
descs
[
ctx
->
count
]
=
From
T
(
drivername
);
ctx
->
count
++
;
ctx
->
count
++
;
return
TRUE
;
/* Keep enumerating */
return
TRUE
;
/* Keep enumerating */
...
@@ -1448,9 +1450,9 @@ static int FindDevicesCallback(vlc_object_t *object, const char *name,
...
@@ -1448,9 +1450,9 @@ static int FindDevicesCallback(vlc_object_t *object, const char *name,
if
(
hddraw_dll
!=
NULL
)
if
(
hddraw_dll
!=
NULL
)
{
{
/* Enumerate displays */
/* Enumerate displays */
HRESULT
(
WINAPI
*
OurDirectDrawEnumerateEx
)(
LPDDENUMCALLBACKEX
A
,
HRESULT
(
WINAPI
*
OurDirectDrawEnumerateEx
)(
LPDDENUMCALLBACKEX
,
LPVOID
,
DWORD
)
=
LPVOID
,
DWORD
)
=
(
void
*
)
GetProcAddress
(
hddraw_dll
,
_T
(
"DirectDrawEnumerateExA"
)
);
(
void
*
)
GetProcAddress
(
hddraw_dll
,
"DirectDrawEnumerateEx"
);
if
(
OurDirectDrawEnumerateEx
!=
NULL
)
if
(
OurDirectDrawEnumerateEx
!=
NULL
)
OurDirectDrawEnumerateEx
(
DirectXEnumCallback2
,
&
ctx
,
OurDirectDrawEnumerateEx
(
DirectXEnumCallback2
,
&
ctx
,
DDENUM_ATTACHEDSECONDARYDEVICES
);
DDENUM_ATTACHEDSECONDARYDEVICES
);
...
...
modules/video_output/msw/events.c
View file @
46b26be5
...
@@ -499,7 +499,7 @@ static int DirectXCreateWindow( event_thread_t *p_event )
...
@@ -499,7 +499,7 @@ static int DirectXCreateWindow( event_thread_t *p_event )
HMENU
hMenu
;
HMENU
hMenu
;
RECT
rect_window
;
RECT
rect_window
;
WNDCLASS
wc
;
/* window class components */
WNDCLASS
wc
;
/* window class components */
char
vlc_path
[
MAX_PATH
+
1
];
TCHAR
vlc_path
[
MAX_PATH
+
1
];
int
i_style
,
i_stylex
;
int
i_style
,
i_stylex
;
msg_Dbg
(
vd
,
"DirectXCreateWindow"
);
msg_Dbg
(
vd
,
"DirectXCreateWindow"
);
...
@@ -1043,9 +1043,9 @@ event_thread_t *EventThreadCreate( vout_display_t *vd)
...
@@ -1043,9 +1043,9 @@ event_thread_t *EventThreadCreate( vout_display_t *vd)
p_event
->
source
=
vd
->
source
;
p_event
->
source
=
vd
->
source
;
vout_display_PlacePicture
(
&
p_event
->
place
,
&
vd
->
source
,
vd
->
cfg
,
false
);
vout_display_PlacePicture
(
&
p_event
->
place
,
&
vd
->
source
,
vd
->
cfg
,
false
);
_snprintf
(
p_event
->
class_main
,
sizeof
(
p_event
->
class_main
)
/
sizeof
(
*
p_event
->
class_main
),
_sn
t
printf
(
p_event
->
class_main
,
sizeof
(
p_event
->
class_main
)
/
sizeof
(
*
p_event
->
class_main
),
_T
(
"VLC MSW %p"
),
p_event
);
_T
(
"VLC MSW %p"
),
p_event
);
_snprintf
(
p_event
->
class_video
,
sizeof
(
p_event
->
class_video
)
/
sizeof
(
*
p_event
->
class_video
),
_sn
t
printf
(
p_event
->
class_video
,
sizeof
(
p_event
->
class_video
)
/
sizeof
(
*
p_event
->
class_video
),
_T
(
"VLC MSW video %p"
),
p_event
);
_T
(
"VLC MSW video %p"
),
p_event
);
return
p_event
;
return
p_event
;
}
}
...
...
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