Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
59d99130
Commit
59d99130
authored
Apr 19, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GetProcAddress for mmio* functions to avoid importing winmm.dll.
parent
bc4b88ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
24 deletions
+38
-24
animate.c
dlls/comctl32/animate.c
+31
-24
animate.h
include/animate.h
+7
-0
No files found.
dlls/comctl32/animate.c
View file @
59d99130
...
...
@@ -25,7 +25,7 @@
#include "services.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
animate
)
DEFAULT_DEBUG_CHANNEL
(
animate
)
;
#define ANIMATE_GetInfoPtr(hWnd) ((ANIMATE_INFO *)GetWindowLongA(hWnd, 0))
...
...
@@ -60,7 +60,7 @@ static BOOL ANIMATE_LoadResA(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPSTR lpNam
mminfo
.
fccIOProc
=
FOURCC_MEM
;
mminfo
.
pchBuffer
=
(
LPSTR
)
lpAvi
;
mminfo
.
cchBuffer
=
SizeofResource
(
hInst
,
hrsrc
);
infoPtr
->
hMMio
=
mmioOpenA
(
NULL
,
&
mminfo
,
MMIO_READ
);
infoPtr
->
hMMio
=
infoPtr
->
fn
mmioOpenA
(
NULL
,
&
mminfo
,
MMIO_READ
);
if
(
!
infoPtr
->
hMMio
)
{
GlobalFree
((
HGLOBAL
)
lpAvi
);
...
...
@@ -73,7 +73,7 @@ static BOOL ANIMATE_LoadResA(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPSTR lpNam
static
BOOL
ANIMATE_LoadFileA
(
ANIMATE_INFO
*
infoPtr
,
LPSTR
lpName
)
{
infoPtr
->
hMMio
=
mmioOpenA
((
LPSTR
)
lpName
,
NULL
,
infoPtr
->
hMMio
=
infoPtr
->
fn
mmioOpenA
((
LPSTR
)
lpName
,
NULL
,
MMIO_ALLOCBUF
|
MMIO_READ
|
MMIO_DENYWRITE
);
if
(
!
infoPtr
->
hMMio
)
...
...
@@ -109,7 +109,7 @@ static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
{
if
(
infoPtr
->
hMMio
)
{
ANIMATE_DoStop
(
infoPtr
);
mmioClose
(
infoPtr
->
hMMio
,
0
);
infoPtr
->
fn
mmioClose
(
infoPtr
->
hMMio
,
0
);
if
(
infoPtr
->
hRes
)
{
FreeResource
(
infoPtr
->
hRes
);
infoPtr
->
hRes
=
0
;
...
...
@@ -168,8 +168,8 @@ static LRESULT ANIMATE_DrawFrame(ANIMATE_INFO* infoPtr)
EnterCriticalSection
(
&
infoPtr
->
cs
);
mmioSeek
(
infoPtr
->
hMMio
,
infoPtr
->
lpIndex
[
infoPtr
->
currFrame
],
SEEK_SET
);
mmioRead
(
infoPtr
->
hMMio
,
infoPtr
->
indata
,
infoPtr
->
ash
.
dwSuggestedBufferSize
);
infoPtr
->
fn
mmioSeek
(
infoPtr
->
hMMio
,
infoPtr
->
lpIndex
[
infoPtr
->
currFrame
],
SEEK_SET
);
infoPtr
->
fn
mmioRead
(
infoPtr
->
hMMio
,
infoPtr
->
indata
,
infoPtr
->
ash
.
dwSuggestedBufferSize
);
if
(
infoPtr
->
hic
&&
(
infoPtr
->
fnICDecompress
)(
infoPtr
->
hic
,
0
,
infoPtr
->
inbih
,
infoPtr
->
indata
,
...
...
@@ -261,7 +261,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
DWORD
numFrame
;
DWORD
insize
;
if
(
mmioDescend
(
infoPtr
->
hMMio
,
&
ckMainRIFF
,
NULL
,
0
)
!=
0
)
{
if
(
infoPtr
->
fn
mmioDescend
(
infoPtr
->
hMMio
,
&
ckMainRIFF
,
NULL
,
0
)
!=
0
)
{
WARN
(
"Can't find 'RIFF' chunk
\n
"
);
return
FALSE
;
}
...
...
@@ -273,18 +273,18 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
}
mmckHead
.
fccType
=
mmioFOURCC
(
'h'
,
'd'
,
'r'
,
'l'
);
if
(
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckHead
,
&
ckMainRIFF
,
MMIO_FINDLIST
)
!=
0
)
{
if
(
infoPtr
->
fn
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckHead
,
&
ckMainRIFF
,
MMIO_FINDLIST
)
!=
0
)
{
WARN
(
"Can't find 'hdrl' list
\n
"
);
return
FALSE
;
}
mmckInfo
.
ckid
=
mmioFOURCC
(
'a'
,
'v'
,
'i'
,
'h'
);
if
(
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
&
mmckHead
,
MMIO_FINDCHUNK
)
!=
0
)
{
if
(
infoPtr
->
fn
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
&
mmckHead
,
MMIO_FINDCHUNK
)
!=
0
)
{
WARN
(
"Can't find 'avih' chunk
\n
"
);
return
FALSE
;
}
mmioRead
(
infoPtr
->
hMMio
,
(
LPSTR
)
&
infoPtr
->
mah
,
sizeof
(
infoPtr
->
mah
));
infoPtr
->
fn
mmioRead
(
infoPtr
->
hMMio
,
(
LPSTR
)
&
infoPtr
->
mah
,
sizeof
(
infoPtr
->
mah
));
TRACE
(
"mah.dwMicroSecPerFrame=%ld
\n
"
,
infoPtr
->
mah
.
dwMicroSecPerFrame
);
TRACE
(
"mah.dwMaxBytesPerSec=%ld
\n
"
,
infoPtr
->
mah
.
dwMaxBytesPerSec
);
TRACE
(
"mah.dwPaddingGranularity=%ld
\n
"
,
infoPtr
->
mah
.
dwPaddingGranularity
);
...
...
@@ -295,21 +295,21 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
TRACE
(
"mah.dwSuggestedBufferSize=%ld
\n
"
,
infoPtr
->
mah
.
dwSuggestedBufferSize
);
TRACE
(
"mah.dwWidth=%ld
\n
"
,
infoPtr
->
mah
.
dwWidth
);
TRACE
(
"mah.dwHeight=%ld
\n
"
,
infoPtr
->
mah
.
dwHeight
);
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
0
);
infoPtr
->
fn
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
0
);
mmckList
.
fccType
=
mmioFOURCC
(
's'
,
't'
,
'r'
,
'l'
);
if
(
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckList
,
&
mmckHead
,
MMIO_FINDLIST
)
!=
0
)
{
if
(
infoPtr
->
fn
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckList
,
&
mmckHead
,
MMIO_FINDLIST
)
!=
0
)
{
WARN
(
"Can't find 'strl' list
\n
"
);
return
FALSE
;
}
mmckInfo
.
ckid
=
mmioFOURCC
(
's'
,
't'
,
'r'
,
'h'
);
if
(
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
&
mmckList
,
MMIO_FINDCHUNK
)
!=
0
)
{
if
(
infoPtr
->
fn
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
&
mmckList
,
MMIO_FINDCHUNK
)
!=
0
)
{
WARN
(
"Can't find 'strh' chunk
\n
"
);
return
FALSE
;
}
mmioRead
(
infoPtr
->
hMMio
,
(
LPSTR
)
&
infoPtr
->
ash
,
sizeof
(
infoPtr
->
ash
));
infoPtr
->
fn
mmioRead
(
infoPtr
->
hMMio
,
(
LPSTR
)
&
infoPtr
->
ash
,
sizeof
(
infoPtr
->
ash
));
TRACE
(
"ash.fccType='%c%c%c%c'
\n
"
,
LOBYTE
(
LOWORD
(
infoPtr
->
ash
.
fccType
)),
HIBYTE
(
LOWORD
(
infoPtr
->
ash
.
fccType
)),
LOBYTE
(
HIWORD
(
infoPtr
->
ash
.
fccType
)),
...
...
@@ -331,10 +331,10 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
TRACE
(
"ash.dwSampleSize=%ld
\n
"
,
infoPtr
->
ash
.
dwSampleSize
);
TRACE
(
"ash.rcFrame=(%d,%d,%d,%d)
\n
"
,
infoPtr
->
ash
.
rcFrame
.
top
,
infoPtr
->
ash
.
rcFrame
.
left
,
infoPtr
->
ash
.
rcFrame
.
bottom
,
infoPtr
->
ash
.
rcFrame
.
right
);
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
0
);
infoPtr
->
fn
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
0
);
mmckInfo
.
ckid
=
mmioFOURCC
(
's'
,
't'
,
'r'
,
'f'
);
if
(
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
&
mmckList
,
MMIO_FINDCHUNK
)
!=
0
)
{
if
(
infoPtr
->
fn
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
&
mmckList
,
MMIO_FINDCHUNK
)
!=
0
)
{
WARN
(
"Can't find 'strh' chunk
\n
"
);
return
FALSE
;
}
...
...
@@ -345,7 +345,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
return
FALSE
;
}
mmioRead
(
infoPtr
->
hMMio
,
(
LPSTR
)
infoPtr
->
inbih
,
mmckInfo
.
cksize
);
infoPtr
->
fn
mmioRead
(
infoPtr
->
hMMio
,
(
LPSTR
)
infoPtr
->
inbih
,
mmckInfo
.
cksize
);
TRACE
(
"bih.biSize=%ld
\n
"
,
infoPtr
->
inbih
->
biSize
);
TRACE
(
"bih.biWidth=%ld
\n
"
,
infoPtr
->
inbih
->
biWidth
);
TRACE
(
"bih.biHeight=%ld
\n
"
,
infoPtr
->
inbih
->
biHeight
);
...
...
@@ -357,27 +357,27 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
TRACE
(
"bih.biYPelsPerMeter=%ld
\n
"
,
infoPtr
->
inbih
->
biYPelsPerMeter
);
TRACE
(
"bih.biClrUsed=%ld
\n
"
,
infoPtr
->
inbih
->
biClrUsed
);
TRACE
(
"bih.biClrImportant=%ld
\n
"
,
infoPtr
->
inbih
->
biClrImportant
);
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
0
);
infoPtr
->
fn
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
0
);
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckList
,
0
);
infoPtr
->
fn
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckList
,
0
);
#if 0
/* an AVI has 0 or 1 video stream, and to be animated should not contain
* an audio stream, so only one strl is allowed
*/
mmckList.fccType = mmioFOURCC('s', 't', 'r', 'l');
if (mmioDescend(infoPtr->hMMio, &mmckList, &mmckHead, MMIO_FINDLIST) == 0) {
if (
infoPtr->fn
mmioDescend(infoPtr->hMMio, &mmckList, &mmckHead, MMIO_FINDLIST) == 0) {
WARN("There should be a single 'strl' list\n");
return FALSE;
}
#endif
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckHead
,
0
);
infoPtr
->
fn
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckHead
,
0
);
/* no need to read optional JUNK chunk */
mmckList
.
fccType
=
mmioFOURCC
(
'm'
,
'o'
,
'v'
,
'i'
);
if
(
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckList
,
&
ckMainRIFF
,
MMIO_FINDLIST
)
!=
0
)
{
if
(
infoPtr
->
fn
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckList
,
&
ckMainRIFF
,
MMIO_FINDLIST
)
!=
0
)
{
WARN
(
"Can't find 'movi' list
\n
"
);
return
FALSE
;
}
...
...
@@ -392,13 +392,13 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
}
numFrame
=
insize
=
0
;
while
(
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
&
mmckList
,
0
)
==
0
&&
while
(
infoPtr
->
fn
mmioDescend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
&
mmckList
,
0
)
==
0
&&
numFrame
<
infoPtr
->
mah
.
dwTotalFrames
)
{
infoPtr
->
lpIndex
[
numFrame
]
=
mmckInfo
.
dwDataOffset
;
if
(
insize
<
mmckInfo
.
cksize
)
insize
=
mmckInfo
.
cksize
;
numFrame
++
;
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
0
);
infoPtr
->
fn
mmioAscend
(
infoPtr
->
hMMio
,
&
mmckInfo
,
0
);
}
if
(
numFrame
!=
infoPtr
->
mah
.
dwTotalFrames
)
{
WARN
(
"Found %ld frames (/%ld)
\n
"
,
numFrame
,
infoPtr
->
mah
.
dwTotalFrames
);
...
...
@@ -581,6 +581,13 @@ static LRESULT ANIMATE_Create(HWND hWnd, WPARAM wParam, LPARAM lParam)
hModWinmm
=
LoadLibraryA
(
"WINMM"
);
infoPtr
->
fnmmioOpenA
=
(
void
*
)
GetProcAddress
(
hModWinmm
,
"mmioOpenA"
);
infoPtr
->
fnmmioClose
=
(
void
*
)
GetProcAddress
(
hModWinmm
,
"mmioClose"
);
infoPtr
->
fnmmioAscend
=
(
void
*
)
GetProcAddress
(
hModWinmm
,
"mmioAscend"
);
infoPtr
->
fnmmioDescend
=
(
void
*
)
GetProcAddress
(
hModWinmm
,
"mmioDescend"
);
infoPtr
->
fnmmioSeek
=
(
void
*
)
GetProcAddress
(
hModWinmm
,
"mmioSeek"
);
infoPtr
->
fnmmioRead
=
(
void
*
)
GetProcAddress
(
hModWinmm
,
"mmioRead"
);
InitializeCriticalSection
(
&
infoPtr
->
cs
);
return
0
;
...
...
include/animate.h
View file @
59d99130
...
...
@@ -24,6 +24,13 @@ typedef struct tagANIMATE_INFO
LRESULT
(
WINAPI
*
fnICSendMessage
)(
HIC
,
UINT
,
DWORD
,
DWORD
);
DWORD
(
WINAPIV
*
fnICDecompress
)(
HIC
,
DWORD
,
LPBITMAPINFOHEADER
,
LPVOID
,
LPBITMAPINFOHEADER
,
LPVOID
);
HMMIO
(
WINAPI
*
fnmmioOpenA
)(
LPSTR
,
MMIOINFO
*
,
DWORD
);
MMRESULT
(
WINAPI
*
fnmmioClose
)(
HMMIO
,
UINT
);
UINT
(
WINAPI
*
fnmmioAscend
)(
HMMIO
,
MMCKINFO
*
,
UINT
);
UINT
(
WINAPI
*
fnmmioDescend
)(
HMMIO
,
MMCKINFO
*
,
const
MMCKINFO
*
,
UINT
);
LONG
(
WINAPI
*
fnmmioSeek
)(
HMMIO
,
LONG
,
INT
);
LONG
(
WINAPI
*
fnmmioRead
)(
HMMIO
,
HPSTR
,
LONG
);
/* reference to input stream (file or resource) */
HGLOBAL
hRes
;
HMMIO
hMMio
;
/* handle to mmio stream */
...
...
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