Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
db70ec8e
Commit
db70ec8e
authored
Dec 02, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use normal dll imports instead of GetProcAddress hacks.
parent
e8195355
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
115 deletions
+31
-115
Makefile.in
programs/avitools/Makefile.in
+4
-4
aviinfo.c
programs/avitools/aviinfo.c
+8
-37
aviplay.c
programs/avitools/aviplay.c
+14
-53
icinfo.c
programs/avitools/icinfo.c
+5
-21
No files found.
programs/avitools/Makefile.in
View file @
db70ec8e
...
...
@@ -18,10 +18,10 @@ C_SRCS = \
all
:
$(PROGRAMS:%=%$(DLLEXT)) $(PROGRAMS:.exe=$(EXEEXT))
aviinfo.exe.spec.c
:
aviinfo.o $(WINEBUILD)
$(WINEBUILD)
$(DEFS)
$(DLLFLAGS)
-o
$@
--exe
aviinfo.exe
--exe-mode
gui aviinfo.o
-L
$(DLLDIR)
-lkernel32
$(WINEBUILD)
$(DEFS)
$(DLLFLAGS)
-o
$@
--exe
aviinfo.exe
--exe-mode
gui aviinfo.o
-L
$(DLLDIR)
-l
avifil32
-l
kernel32
aviplay.exe.spec.c
:
aviplay.o $(WINEBUILD)
$(WINEBUILD)
$(DEFS)
$(DLLFLAGS)
-o
$@
--exe
aviplay.exe
--exe-mode
gui aviplay.o
-L
$(DLLDIR)
-lddraw
-lkernel32
$(WINEBUILD)
$(DEFS)
$(DLLFLAGS)
-o
$@
--exe
aviplay.exe
--exe-mode
gui aviplay.o
-L
$(DLLDIR)
-l
avifil32
-l
ddraw
-lkernel32
icinfo.exe.spec.c
:
icinfo.o $(WINEBUILD)
$(WINEBUILD)
$(DEFS)
$(DLLFLAGS)
-o
$@
--exe
icinfo.exe
--exe-mode
gui icinfo.o
-L
$(DLLDIR)
-lmsvfw32
-lkernel32
...
...
@@ -36,10 +36,10 @@ icinfo.exe.so: icinfo.o icinfo.exe.spec.o
$(LDDLL)
-o
$@
icinfo.o icinfo.exe.spec.o
$(ALL_LIBS)
-lc
aviinfo.exe
:
aviinfo.o
$(CC)
-o
$@
aviinfo.o
-lkernel32
$(ALL_LIBS)
$(CC)
-o
$@
aviinfo.o
-l
avifil32
-l
kernel32
$(ALL_LIBS)
aviplay.exe
:
aviplay.o
$(CC)
-o
$@
aviplay.o
-lddraw
-lkernel32
$(ALL_LIBS)
$(CC)
-o
$@
aviplay.o
-l
avifil32
-l
ddraw
-lkernel32
$(ALL_LIBS)
icinfo.exe
:
icinfo.o
$(CC)
-o
$@
icinfo.o
-lmsvfw32
-lkernel32
$(ALL_LIBS)
...
...
programs/avitools/aviinfo.c
View file @
db70ec8e
...
...
@@ -29,51 +29,22 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
{
int
n
;
HRESULT
hres
;
HMODULE
avifil32
=
LoadLibrary
(
"avifil32.dll"
);
PAVIFILE
avif
;
PAVISTREAM
vids
,
auds
;
AVIFILEINFO
afi
;
AVISTREAMINFO
asi
;
void
(
WINAPI
*
fnAVIFileInit
)(
void
);
void
(
WINAPI
*
fnAVIFileExit
)(
void
);
ULONG
(
WINAPI
*
fnAVIFileRelease
)(
PAVIFILE
);
ULONG
(
WINAPI
*
fnAVIStreamRelease
)(
PAVISTREAM
);
HRESULT
(
WINAPI
*
fnAVIFileOpen
)(
PAVIFILE
*
ppfile
,
LPCTSTR
szFile
,
UINT
uMode
,
LPCLSID
lpHandler
);
HRESULT
(
WINAPI
*
fnAVIFileInfo
)(
PAVIFILE
ppfile
,
AVIFILEINFO
*
afi
,
LONG
size
);
HRESULT
(
WINAPI
*
fnAVIFileGetStream
)(
PAVIFILE
ppfile
,
PAVISTREAM
*
afi
,
DWORD
fccType
,
LONG
lParam
);
HRESULT
(
WINAPI
*
fnAVIStreamInfo
)(
PAVISTREAM
iface
,
AVISTREAMINFO
*
afi
,
LONG
size
);
#define XX(x) fn##x = (void*)GetProcAddress(avifil32,#x);assert(fn##x);
#ifdef UNICODE
# define XXT(x) fn##x = (void*)GetProcAddress(avifil32,#x"W");assert(fn##x);
#else
# define XXT(x) fn##x = (void*)GetProcAddress(avifil32,#x"A");assert(fn##x);
#endif
/* Non character dependent routines: */
XX
(
AVIFileInit
);
XX
(
AVIFileExit
);
XX
(
AVIFileRelease
);
XX
(
AVIStreamRelease
);
XX
(
AVIFileGetStream
);
/* A/W routines: */
XXT
(
AVIFileOpen
);
XXT
(
AVIFileInfo
);
XXT
(
AVIStreamInfo
);
#undef XX
#undef XXT
fnAVIFileInit
();
AVIFileInit
();
if
(
GetFileAttributes
(
cmdline
)
==
INVALID_FILE_ATTRIBUTES
)
{
fprintf
(
stderr
,
"Usage: aviinfo <avifilename>
\n
"
);
exit
(
1
);
}
hres
=
fn
AVIFileOpen
(
&
avif
,
cmdline
,
OF_READ
,
NULL
);
hres
=
AVIFileOpen
(
&
avif
,
cmdline
,
OF_READ
,
NULL
);
if
(
hres
)
{
fprintf
(
stderr
,
"AVIFileOpen: 0x%08lx
\n
"
,
hres
);
exit
(
1
);
}
hres
=
fn
AVIFileInfo
(
avif
,
&
afi
,
sizeof
(
afi
));
hres
=
AVIFileInfo
(
avif
,
&
afi
,
sizeof
(
afi
));
if
(
hres
)
{
fprintf
(
stderr
,
"AVIFileInfo: 0x%08lx
\n
"
,
hres
);
exit
(
1
);
...
...
@@ -105,12 +76,12 @@ HRESULT (WINAPI *fnAVIStreamInfo)(PAVISTREAM iface,AVISTREAMINFO *afi,LONG size)
char
buf
[
5
];
PAVISTREAM
ast
;
hres
=
fn
AVIFileGetStream
(
avif
,
&
ast
,
0
,
n
);
hres
=
AVIFileGetStream
(
avif
,
&
ast
,
0
,
n
);
if
(
hres
)
{
fprintf
(
stderr
,
"AVIFileGetStream %d: 0x%08lx
\n
"
,
n
,
hres
);
exit
(
1
);
}
hres
=
fn
AVIStreamInfo
(
ast
,
&
asi
,
sizeof
(
asi
));
hres
=
AVIStreamInfo
(
ast
,
&
asi
,
sizeof
(
asi
));
if
(
hres
)
{
fprintf
(
stderr
,
"AVIStreamInfo %d: 0x%08lx
\n
"
,
n
,
hres
);
exit
(
1
);
...
...
@@ -150,9 +121,9 @@ HRESULT (WINAPI *fnAVIStreamInfo)(PAVISTREAM iface,AVISTREAMINFO *afi,LONG size)
break
;
}
}
fn
AVIStreamRelease
(
ast
);
AVIStreamRelease
(
ast
);
}
fn
AVIFileRelease
(
avif
);
fn
AVIFileExit
();
AVIFileRelease
(
avif
);
AVIFileExit
();
return
0
;
}
programs/avitools/aviplay.c
View file @
db70ec8e
...
...
@@ -52,7 +52,6 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
LONG
cnt
;
BITMAPINFOHEADER
*
bmi
;
HRESULT
hres
;
HMODULE
avifil32
=
LoadLibrary
(
"avifil32.dll"
);
PAVIFILE
avif
;
PAVISTREAM
vids
=
NULL
,
auds
=
NULL
;
AVIFILEINFO
afi
;
...
...
@@ -64,55 +63,17 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
LPDIRECTDRAWPALETTE
dpal
;
PALETTEENTRY
palent
[
256
];
void
(
WINAPI
*
fnAVIFileInit
)(
void
);
void
(
WINAPI
*
fnAVIFileExit
)(
void
);
ULONG
(
WINAPI
*
fnAVIFileRelease
)(
PAVIFILE
);
ULONG
(
WINAPI
*
fnAVIStreamRelease
)(
PAVISTREAM
);
HRESULT
(
WINAPI
*
fnAVIFileOpen
)(
PAVIFILE
*
ppfile
,
LPCTSTR
szFile
,
UINT
uMode
,
LPCLSID
lpHandler
);
HRESULT
(
WINAPI
*
fnAVIFileInfo
)(
PAVIFILE
ppfile
,
AVIFILEINFO
*
afi
,
LONG
size
);
HRESULT
(
WINAPI
*
fnAVIFileGetStream
)(
PAVIFILE
ppfile
,
PAVISTREAM
*
afi
,
DWORD
fccType
,
LONG
lParam
);
HRESULT
(
WINAPI
*
fnAVIStreamInfo
)(
PAVISTREAM
iface
,
AVISTREAMINFO
*
afi
,
LONG
size
);
HRESULT
(
WINAPI
*
fnAVIStreamReadFormat
)(
PAVISTREAM
iface
,
LONG
pos
,
LPVOID
format
,
LPLONG
size
);
PGETFRAME
(
WINAPI
*
fnAVIStreamGetFrameOpen
)(
PAVISTREAM
iface
,
LPBITMAPINFOHEADER
wanted
);
LPVOID
(
WINAPI
*
fnAVIStreamGetFrame
)(
PGETFRAME
pg
,
LONG
pos
);
HRESULT
(
WINAPI
*
fnAVIStreamGetFrameClose
)(
PGETFRAME
pg
);
#define XX(x) fn##x = (void*)GetProcAddress(avifil32,#x);assert(fn##x);
#ifdef UNICODE
# define XXT(x) fn##x = (void*)GetProcAddress(avifil32,#x"W");assert(fn##x);
#else
# define XXT(x) fn##x = (void*)GetProcAddress(avifil32,#x"A");assert(fn##x);
#endif
/* non character dependend routines: */
XX
(
AVIFileInit
);
XX
(
AVIFileExit
);
XX
(
AVIFileRelease
);
XX
(
AVIFileGetStream
);
XX
(
AVIStreamRelease
);
XX
(
AVIStreamReadFormat
);
XX
(
AVIStreamGetFrameOpen
);
XX
(
AVIStreamGetFrame
);
XX
(
AVIStreamGetFrameClose
);
/* A/W routines: */
XXT
(
AVIFileOpen
);
XXT
(
AVIFileInfo
);
XXT
(
AVIStreamInfo
);
#undef XX
#undef XXT
fnAVIFileInit
();
AVIFileInit
();
if
(
GetFileAttributes
(
cmdline
)
==
INVALID_FILE_ATTRIBUTES
)
{
fprintf
(
stderr
,
"Usage: aviplay <avifilename>
\n
"
);
exit
(
1
);
}
hres
=
fn
AVIFileOpen
(
&
avif
,
cmdline
,
OF_READ
,
NULL
);
hres
=
AVIFileOpen
(
&
avif
,
cmdline
,
OF_READ
,
NULL
);
if
(
hres
)
{
fprintf
(
stderr
,
"AVIFileOpen: 0x%08lx
\n
"
,
hres
);
exit
(
1
);
}
hres
=
fn
AVIFileInfo
(
avif
,
&
afi
,
sizeof
(
afi
));
hres
=
AVIFileInfo
(
avif
,
&
afi
,
sizeof
(
afi
));
if
(
hres
)
{
fprintf
(
stderr
,
"AVIFileInfo: 0x%08lx
\n
"
,
hres
);
exit
(
1
);
...
...
@@ -121,12 +82,12 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg);
char
buf
[
5
];
PAVISTREAM
ast
;
hres
=
fn
AVIFileGetStream
(
avif
,
&
ast
,
0
,
n
);
hres
=
AVIFileGetStream
(
avif
,
&
ast
,
0
,
n
);
if
(
hres
)
{
fprintf
(
stderr
,
"AVIFileGetStream %d: 0x%08lx
\n
"
,
n
,
hres
);
exit
(
1
);
}
hres
=
fn
AVIStreamInfo
(
ast
,
&
asi
,
sizeof
(
asi
));
hres
=
AVIStreamInfo
(
ast
,
&
asi
,
sizeof
(
asi
));
if
(
hres
)
{
fprintf
(
stderr
,
"AVIStreamInfo %d: 0x%08lx
\n
"
,
n
,
hres
);
exit
(
1
);
...
...
@@ -148,7 +109,7 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg);
type
[
4
]
=
'\0'
;
memcpy
(
type
,
&
(
asi
.
fccType
),
4
);
fprintf
(
stderr
,
"Unhandled streamtype %s
\n
"
,
type
);
fn
AVIStreamRelease
(
ast
);
AVIStreamRelease
(
ast
);
break
;
}
}
...
...
@@ -160,7 +121,7 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg);
}
cnt
=
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
);
bmi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cnt
);
hres
=
fn
AVIStreamReadFormat
(
vids
,
0
,
bmi
,
&
cnt
);
hres
=
AVIStreamReadFormat
(
vids
,
0
,
bmi
,
&
cnt
);
if
(
hres
)
{
fprintf
(
stderr
,
"AVIStreamReadFormat vids: 0x%08lx
\n
"
,
hres
);
exit
(
1
);
...
...
@@ -170,7 +131,7 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg);
/* recalculate the image size */
bmi
->
biSizeImage
=
((
bmi
->
biWidth
*
bmi
->
biBitCount
+
31
)
&~
0x1f
)
*
bmi
->
biPlanes
*
bmi
->
biHeight
/
8
;
bytesline
=
((
bmi
->
biWidth
*
bmi
->
biBitCount
+
31
)
&~
0x1f
)
*
bmi
->
biPlanes
/
8
;
vidgetframe
=
fn
AVIStreamGetFrameOpen
(
vids
,
bmi
);
vidgetframe
=
AVIStreamGetFrameOpen
(
vids
,
bmi
);
if
(
!
vidgetframe
)
{
fprintf
(
stderr
,
"AVIStreamGetFrameOpen: failed
\n
"
);
exit
(
1
);
...
...
@@ -224,7 +185,7 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg);
LPVOID
decodedbits
;
/* video stuff */
if
(
!
(
decodedframe
=
fn
AVIStreamGetFrame
(
vidgetframe
,
pos
++
)))
if
(
!
(
decodedframe
=
AVIStreamGetFrame
(
vidgetframe
,
pos
++
)))
break
;
lpbmi
=
(
LPBITMAPINFOHEADER
)
decodedframe
;
decodedbits
=
(
LPVOID
)(((
DWORD
)
decodedframe
)
+
lpbmi
->
biSize
);
...
...
@@ -270,15 +231,15 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg);
IDirectDrawSurface_Unlock
(
dsurf
,
dsdesc
.
lpSurface
);
}
tend
=
time
(
NULL
);
fn
AVIStreamGetFrameClose
(
vidgetframe
);
AVIStreamGetFrameClose
(
vidgetframe
);
IDirectDrawSurface_Release
(
dsurf
);
IDirectDraw_RestoreDisplayMode
(
ddraw
);
IDirectDraw_Release
(
ddraw
);
if
(
vids
)
fn
AVIStreamRelease
(
vids
);
if
(
auds
)
fn
AVIStreamRelease
(
auds
);
if
(
vids
)
AVIStreamRelease
(
vids
);
if
(
auds
)
AVIStreamRelease
(
auds
);
fprintf
(
stderr
,
"%d frames at %g frames/s
\n
"
,
pos
,
pos
*
1
.
0
/
(
tend
-
tstart
));
fn
AVIFileRelease
(
avif
);
fn
AVIFileExit
();
AVIFileRelease
(
avif
);
AVIFileExit
();
return
0
;
}
programs/avitools/icinfo.c
View file @
db70ec8e
...
...
@@ -27,21 +27,6 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
{
int
n
=
0
,
doabout
=
0
,
doconfigure
=
0
;
char
buf
[
128
],
type
[
5
],
handler
[
5
];
HMODULE
msvfw32
=
LoadLibrary
(
"msvfw32.dll"
);
BOOL
(
VFWAPI
*
fnICInfo
)(
DWORD
fccType
,
DWORD
fccHandler
,
ICINFO
*
lpicinfo
);
LRESULT
(
VFWAPI
*
fnICClose
)(
HIC
hic
);
HIC
(
VFWAPI
*
fnICOpen
)(
DWORD
fccType
,
DWORD
fccHandler
,
UINT
wMode
);
LRESULT
(
VFWAPI
*
fnICGetInfo
)(
HIC
hic
,
ICINFO
*
picinfo
,
DWORD
cb
);
LRESULT
(
VFWAPI
*
fnICSendMessage
)(
HIC
hic
,
UINT
msg
,
DWORD
dw1
,
DWORD
dw2
);
#define XX(x) fn##x = (void*)GetProcAddress(msvfw32,#x);
XX
(
ICInfo
);
XX
(
ICOpen
);
XX
(
ICClose
);
XX
(
ICGetInfo
);
XX
(
ICSendMessage
);
#undef XX
if
(
strstr
(
cmdline
,
"-about"
))
doabout
=
1
;
...
...
@@ -54,12 +39,12 @@ LRESULT (VFWAPI *fnICSendMessage)(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
HIC
hic
;
ii
.
dwSize
=
sizeof
(
ii
);
if
(
!
fn
ICInfo
(
ICTYPE_VIDEO
,
n
++
,
&
ii
))
if
(
!
ICInfo
(
ICTYPE_VIDEO
,
n
++
,
&
ii
))
break
;
if
(
!
(
hic
=
fn
ICOpen
(
ii
.
fccType
,
ii
.
fccHandler
,
ICMODE_QUERY
)))
if
(
!
(
hic
=
ICOpen
(
ii
.
fccType
,
ii
.
fccHandler
,
ICMODE_QUERY
)))
continue
;
if
(
!
fn
ICGetInfo
(
hic
,
&
ii
,
sizeof
(
ii
)))
{
fn
ICClose
(
hic
);
if
(
!
ICGetInfo
(
hic
,
&
ii
,
sizeof
(
ii
)))
{
ICClose
(
hic
);
continue
;
}
#define w2s(w,s) WideCharToMultiByte(0,0,w,-1,s,128,0,NULL)
...
...
@@ -87,8 +72,7 @@ LRESULT (VFWAPI *fnICSendMessage)(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
if
(
doabout
)
ICAbout
(
hic
,
0
);
if
(
doconfigure
&&
ICQueryConfigure
(
hic
))
ICConfigure
(
hic
,
0
);
fn
ICClose
(
hic
);
ICClose
(
hic
);
}
return
0
;
}
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