Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
3a42dd25
Commit
3a42dd25
authored
21 years ago
by
Christian Costa
Committed by
Alexandre Julliard
21 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added support for video compressor/decompressor dynamic installation.
parent
e8d97785
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/msvideo/msvfw32.spec
+2
-2
2 additions, 2 deletions
dlls/msvideo/msvfw32.spec
dlls/msvideo/msvideo_main.c
+166
-30
166 additions, 30 deletions
dlls/msvideo/msvideo_main.c
dlls/msvideo/msvideo_private.h
+1
-0
1 addition, 0 deletions
dlls/msvideo/msvideo_private.h
with
169 additions
and
32 deletions
dlls/msvideo/msvfw32.spec
+
2
−
2
View file @
3a42dd25
...
...
@@ -34,12 +34,12 @@
@ stdcall ICImageCompress(long long ptr ptr ptr long ptr)
@ stdcall ICImageDecompress(long long ptr ptr ptr)
@ stdcall ICInfo(long long ptr)
@ st
ub
ICInstall
@ st
dcall
ICInstall
(long long ptr str long)
@ stdcall ICLocate(long long ptr ptr long)
@ stub ICMThunk
@ stdcall ICOpen(long long long)
@ stdcall ICOpenFunction(long long long ptr)
@ st
ub
ICRemove
@ st
dcall
ICRemove
(long long long)
@ stdcall ICSendMessage(long long long long)
@ stub ICSeqCompressFrame
@ stub ICSeqCompressFrameEnd
...
...
This diff is collapsed.
Click to expand it.
dlls/msvideo/msvideo_main.c
+
166
−
30
View file @
3a42dd25
...
...
@@ -47,6 +47,35 @@ LRESULT (CALLBACK *pFnCallTo16)(HDRVR, HIC, UINT, LPARAM, LPARAM) = NULL;
static
WINE_HIC
*
MSVIDEO_FirstHic
/* = NULL */
;
typedef
struct
_reg_driver
reg_driver
;
struct
_reg_driver
{
DWORD
fccType
;
DWORD
fccHandler
;
DRIVERPROC
proc
;
char
*
name
;
reg_driver
*
next
;
};
static
reg_driver
*
reg_driver_list
=
NULL
;
static
int
compare_fourcc
(
DWORD
fcc1
,
DWORD
fcc2
)
{
char
fcc_str1
[
5
];
char
fcc_str2
[
5
];
fcc_str1
[
0
]
=
LOBYTE
(
LOWORD
(
fcc1
));
fcc_str1
[
1
]
=
HIBYTE
(
LOWORD
(
fcc1
));
fcc_str1
[
2
]
=
LOBYTE
(
HIWORD
(
fcc1
));
fcc_str1
[
3
]
=
HIBYTE
(
HIWORD
(
fcc1
));
fcc_str1
[
4
]
=
0
;
fcc_str2
[
0
]
=
LOBYTE
(
LOWORD
(
fcc2
));
fcc_str2
[
1
]
=
HIBYTE
(
LOWORD
(
fcc2
));
fcc_str2
[
2
]
=
LOBYTE
(
HIWORD
(
fcc2
));
fcc_str2
[
3
]
=
HIBYTE
(
HIWORD
(
fcc2
));
fcc_str2
[
4
]
=
0
;
return
strcasecmp
(
fcc_str1
,
fcc_str2
);
}
/******************************************************************
* MSVIDEO_GetHicPtr
*
...
...
@@ -129,6 +158,88 @@ BOOL VFWAPI ICInfo(
static
DWORD
IC_HandleRef
=
1
;
/***********************************************************************
* ICInstall [MSVFW32.@]
*/
BOOL
VFWAPI
ICInstall
(
DWORD
fccType
,
DWORD
fccHandler
,
LPARAM
lParam
,
LPSTR
szDesc
,
UINT
wFlags
)
{
reg_driver
*
driver
;
TRACE
(
"(%s,%s,%p,%p,0x%08x)
\n
"
,
wine_dbgstr_fcc
(
fccType
),
wine_dbgstr_fcc
(
fccHandler
),
(
void
*
)
lParam
,
szDesc
,
wFlags
);
/* Check if a driver is already registered */
driver
=
reg_driver_list
;
while
(
driver
)
if
(
!
compare_fourcc
(
fccType
,
driver
->
fccType
)
&&
!
compare_fourcc
(
fccHandler
,
driver
->
fccHandler
))
break
;
else
driver
=
driver
->
next
;
if
(
driver
)
return
FALSE
;
/* Register the driver */
driver
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
reg_driver
));
driver
->
fccType
=
fccType
;
driver
->
fccHandler
=
fccHandler
;
switch
(
wFlags
)
{
case
ICINSTALL_FUNCTION
:
driver
->
proc
=
(
DRIVERPROC
)
lParam
;
driver
->
name
=
NULL
;
break
;
case
ICINSTALL_DRIVER
:
driver
->
proc
=
NULL
;
driver
->
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
((
char
*
)
lParam
));
strcpy
(
driver
->
name
,
(
char
*
)
lParam
);
break
;
default:
ERR
(
"Invalid flags!
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
driver
);
return
FALSE
;
}
/* Insert our driver in the list*/
driver
->
next
=
reg_driver_list
;
reg_driver_list
=
driver
;
return
TRUE
;
}
/***********************************************************************
* ICRemove [MSVFW32.@]
*/
BOOL
VFWAPI
ICRemove
(
DWORD
fccType
,
DWORD
fccHandler
,
UINT
wFlags
)
{
reg_driver
*
driver
;
reg_driver
**
previous
;
TRACE
(
"(%s,%s,0x%08x)
\n
"
,
wine_dbgstr_fcc
(
fccType
),
wine_dbgstr_fcc
(
fccHandler
),
wFlags
);
/* Check if a driver is already registered */
driver
=
reg_driver_list
;
previous
=
&
reg_driver_list
;
while
(
driver
)
if
(
!
compare_fourcc
(
fccType
,
driver
->
fccType
)
&&
!
compare_fourcc
(
fccHandler
,
driver
->
fccHandler
))
break
;
else
{
previous
=
&
(
driver
->
next
);
driver
=
driver
->
next
;
}
if
(
!
driver
)
return
FALSE
;
/* Remove the driver from the list */
*
previous
=
driver
->
next
;
if
(
driver
->
name
)
HeapFree
(
GetProcessHeap
(),
0
,
driver
->
name
);
HeapFree
(
GetProcessHeap
(),
0
,
driver
);
return
TRUE
;
}
/***********************************************************************
* ICOpen [MSVFW32.@]
* Opens an installable compressor. Return special handle.
...
...
@@ -140,20 +251,23 @@ HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
HDRVR
hdrv
;
WINE_HIC
*
whic
;
BOOL
bIs16
;
reg_driver
*
driver
;
TRACE
(
"(%s,%s,0x%08x)
\n
"
,
wine_dbgstr_fcc
(
fccType
),
wine_dbgstr_fcc
(
fccHandler
),
wMode
);
codecname
[
0
]
=
LOBYTE
(
LOWORD
(
fccType
));
codecname
[
1
]
=
HIBYTE
(
LOWORD
(
fccType
));
codecname
[
2
]
=
LOBYTE
(
HIWORD
(
fccType
));
codecname
[
3
]
=
HIBYTE
(
HIWORD
(
fccType
));
codecname
[
4
]
=
'.'
;
codecname
[
5
]
=
LOBYTE
(
LOWORD
(
fccHandler
));
codecname
[
6
]
=
HIBYTE
(
LOWORD
(
fccHandler
));
codecname
[
7
]
=
LOBYTE
(
HIWORD
(
fccHandler
));
codecname
[
8
]
=
HIBYTE
(
HIWORD
(
fccHandler
));
codecname
[
9
]
=
'\0'
;
/* Check if there is a registered driver that matches */
driver
=
reg_driver_list
;
while
(
driver
)
if
(
!
compare_fourcc
(
fccType
,
driver
->
fccType
)
&&
!
compare_fourcc
(
fccHandler
,
driver
->
fccHandler
))
break
;
else
driver
=
driver
->
next
;
if
(
driver
&&
driver
->
proc
)
/* The driver has been registered at runtime with its driverproc */
return
MSVIDEO_OpenFunction
(
fccType
,
fccHandler
,
wMode
,
(
DRIVERPROC
)
driver
->
proc
,
(
DWORD
)
NULL
);
/* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
* same layout as ICOPEN
*/
...
...
@@ -166,22 +280,41 @@ HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
icopen
.
pV1Reserved
=
NULL
;
icopen
.
pV2Reserved
=
NULL
;
icopen
.
dnDevNode
=
0
;
/* FIXME */
hdrv
=
OpenDriverA
(
codecname
,
"drivers32"
,
(
LPARAM
)
&
icopen
);
if
(
!
hdrv
)
{
if
(
fccType
==
streamtypeVIDEO
)
if
(
!
driver
)
{
/* The driver is registered in the registry */
codecname
[
0
]
=
LOBYTE
(
LOWORD
(
fccType
));
codecname
[
1
]
=
HIBYTE
(
LOWORD
(
fccType
));
codecname
[
2
]
=
LOBYTE
(
HIWORD
(
fccType
));
codecname
[
3
]
=
HIBYTE
(
HIWORD
(
fccType
));
codecname
[
4
]
=
'.'
;
codecname
[
5
]
=
LOBYTE
(
LOWORD
(
fccHandler
));
codecname
[
6
]
=
HIBYTE
(
LOWORD
(
fccHandler
));
codecname
[
7
]
=
LOBYTE
(
HIWORD
(
fccHandler
));
codecname
[
8
]
=
HIBYTE
(
HIWORD
(
fccHandler
));
codecname
[
9
]
=
'\0'
;
hdrv
=
OpenDriverA
(
codecname
,
"drivers32"
,
(
LPARAM
)
&
icopen
);
if
(
!
hdrv
)
{
codecname
[
0
]
=
'v'
;
codecname
[
1
]
=
'i'
;
codecname
[
2
]
=
'd'
;
codecname
[
3
]
=
'c'
;
fccType
=
ICTYPE_VIDEO
;
hdrv
=
OpenDriverA
(
codecname
,
"drivers32"
,
(
LPARAM
)
&
icopen
);
}
if
(
!
hdrv
)
return
0
;
if
(
fccType
==
streamtypeVIDEO
)
{
codecname
[
0
]
=
'v'
;
codecname
[
1
]
=
'i'
;
codecname
[
2
]
=
'd'
;
codecname
[
3
]
=
'c'
;
fccType
=
ICTYPE_VIDEO
;
hdrv
=
OpenDriverA
(
codecname
,
"drivers32"
,
(
LPARAM
)
&
icopen
);
}
if
(
!
hdrv
)
return
0
;
}
}
else
{
/* The driver has been registered at runtime with its name */
hdrv
=
OpenDriverA
(
driver
->
name
,
NULL
,
(
LPARAM
)
&
icopen
);
if
(
!
hdrv
)
return
0
;
}
bIs16
=
GetDriverFlags
(
hdrv
)
&
WINE_GDF_16BIT
;
...
...
@@ -256,9 +389,11 @@ HIC MSVIDEO_OpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode,
/* return value is not checked */
MSVIDEO_SendMessage
(
whic
,
DRV_ENABLE
,
0L
,
0L
);
whic
->
hdrv
=
(
HDRVR
)
MSVIDEO_SendMessage
(
whic
,
DRV_OPEN
,
0
,
(
DWORD
)
&
icopen
);
if
(
whic
->
hdrv
==
0
)
whic
->
driverId
=
(
DWORD
)
MSVIDEO_SendMessage
(
whic
,
DRV_OPEN
,
0
,
(
DWORD
)
&
icopen
);
/* FIXME: What should we put here? */
whic
->
hdrv
=
(
HDRVR
)
0
;
if
(
whic
->
driverId
==
0
)
{
WARN
(
"DRV_OPEN failed for hic %p
\n
"
,
whic
->
hic
);
MSVIDEO_FirstHic
=
whic
->
next
;
...
...
@@ -621,7 +756,8 @@ LRESULT MSVIDEO_SendMessage(WINE_HIC* whic, UINT msg, DWORD lParam1, DWORD lPara
#undef XX
if
(
whic
->
driverproc
)
{
ret
=
whic
->
driverproc
((
DWORD
)
whic
->
hic
,
whic
->
hdrv
,
msg
,
lParam1
,
lParam2
);
/* dwDriverId parameter is the value returned by the DRV_OPEN */
ret
=
whic
->
driverproc
(
whic
->
driverId
,
whic
->
hdrv
,
msg
,
lParam1
,
lParam2
);
}
else
{
ret
=
SendDriverMessage
(
whic
->
hdrv
,
msg
,
lParam1
,
lParam2
);
}
...
...
This diff is collapsed.
Click to expand it.
dlls/msvideo/msvideo_private.h
+
1
−
0
View file @
3a42dd25
...
...
@@ -40,6 +40,7 @@ typedef struct tagWINE_HIC {
/* 26: */
DWORD
driverproc16
;
/* Wine specific flags */
HIC
hic
;
DWORD
driverId
;
struct
tagWINE_HIC
*
next
;
}
WINE_HIC
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment