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
35da52d9
Commit
35da52d9
authored
Jun 16, 2005
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Jun 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Implemented ICSeqCompressFrame{Start,,End}
- Modified ICCompressorFree to properly free the initialized variables from ICSeqCompressFrameStart.
parent
bae4a545
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
135 additions
and
10 deletions
+135
-10
msvideo_main.c
dlls/msvideo/msvideo_main.c
+135
-10
No files found.
dlls/msvideo/msvideo_main.c
View file @
35da52d9
...
...
@@ -747,20 +747,20 @@ void VFWAPI ICCompressorFree(PCOMPVARS pc)
ICClose
(
pc
->
hic
);
pc
->
hic
=
NULL
;
}
if
(
pc
->
lpbi
Out
!=
NULL
)
{
GlobalFreePtr
(
pc
->
lpbiOut
);
pc
->
lpbi
Out
=
NULL
;
if
(
pc
->
lpbi
In
!=
NULL
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpbiIn
);
pc
->
lpbi
In
=
NULL
;
}
if
(
pc
->
lpBitsOut
!=
NULL
)
{
GlobalFreePtr
(
pc
->
lpBitsOut
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpBitsOut
);
pc
->
lpBitsOut
=
NULL
;
}
if
(
pc
->
lpBitsPrev
!=
NULL
)
{
GlobalFreePtr
(
pc
->
lpBitsPrev
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpBitsPrev
);
pc
->
lpBitsPrev
=
NULL
;
}
if
(
pc
->
lpState
!=
NULL
)
{
GlobalFreePtr
(
pc
->
lpBitsPrev
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpState
);
pc
->
lpState
=
NULL
;
}
pc
->
dwFlags
=
0
;
...
...
@@ -1119,7 +1119,55 @@ err:
*/
LPVOID
VFWAPI
ICSeqCompressFrame
(
PCOMPVARS
pc
,
UINT
uiFlags
,
LPVOID
lpBits
,
BOOL
*
pfKey
,
LONG
*
plSize
)
{
FIXME
(
"(%p, 0x%08x, %p, %p, %p), stub!
\n
"
,
pc
,
uiFlags
,
lpBits
,
pfKey
,
plSize
);
ICCOMPRESS
*
icComp
=
(
ICCOMPRESS
*
)
pc
->
lpState
;
DWORD
ret
;
TRACE
(
"(%p, 0x%08x, %p, %p, %p)
\n
"
,
pc
,
uiFlags
,
lpBits
,
pfKey
,
plSize
);
if
(
pc
->
cbState
!=
sizeof
(
ICCOMPRESS
))
{
ERR
(
"Invalid cbState (%li should be %i)
\n
"
,
pc
->
cbState
,
sizeof
(
ICCOMPRESS
));
return
NULL
;
}
if
(
!
pc
->
lKeyCount
++
)
icComp
->
dwFlags
=
ICCOMPRESS_KEYFRAME
;
else
{
if
(
pc
->
lKey
&&
pc
->
lKeyCount
==
(
pc
->
lKey
-
1
))
/* No key frames if pc->lKey == 0 */
pc
->
lKeyCount
=
0
;
icComp
->
dwFlags
=
0
;
}
icComp
->
lpInput
=
lpBits
;
icComp
->
lFrameNum
=
pc
->
lFrame
++
;
icComp
->
lpOutput
=
pc
->
lpBitsOut
;
icComp
->
lpPrev
=
pc
->
lpBitsPrev
;
ret
=
ICSendMessage
(
pc
->
hic
,
ICM_COMPRESS
,
(
DWORD_PTR
)
icComp
,
sizeof
(
icComp
));
if
(
icComp
->
dwFlags
&
AVIIF_KEYFRAME
)
{
pc
->
lKeyCount
=
1
;
*
pfKey
=
TRUE
;
TRACE
(
"Key frame
\n
"
);
}
else
*
pfKey
=
FALSE
;
*
plSize
=
icComp
->
lpbiOutput
->
biSizeImage
;
TRACE
(
" -- 0x%08lx
\n
"
,
ret
);
if
(
ret
==
ICERR_OK
)
{
LPVOID
oldprev
,
oldout
;
/* We shift Prev and Out, so we don't have to allocate and release memory */
oldprev
=
pc
->
lpBitsPrev
;
oldout
=
pc
->
lpBitsOut
;
pc
->
lpBitsPrev
=
oldout
;
pc
->
lpBitsOut
=
oldprev
;
TRACE
(
"returning: %p
\n
"
,
icComp
->
lpOutput
);
return
icComp
->
lpOutput
;
}
return
NULL
;
}
...
...
@@ -1128,7 +1176,19 @@ LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL
*/
void
VFWAPI
ICSeqCompressFrameEnd
(
PCOMPVARS
pc
)
{
FIXME
(
"(%p), stub!
\n
"
,
pc
);
DWORD
ret
;
TRACE
(
"(%p)
\n
"
,
pc
);
ret
=
ICSendMessage
(
pc
->
hic
,
ICM_COMPRESS_END
,
0
,
0
);
TRACE
(
" -- %lx"
,
ret
);
if
(
pc
->
lpbiIn
)
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpbiIn
);
if
(
pc
->
lpBitsPrev
)
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpBitsPrev
);
if
(
pc
->
lpBitsOut
)
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpBitsOut
);
if
(
pc
->
lpState
)
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpState
);
pc
->
lpbiIn
=
pc
->
lpBitsPrev
=
pc
->
lpBitsOut
=
pc
->
lpState
=
NULL
;
}
/***********************************************************************
...
...
@@ -1136,8 +1196,73 @@ void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc)
*/
BOOL
VFWAPI
ICSeqCompressFrameStart
(
PCOMPVARS
pc
,
LPBITMAPINFO
lpbiIn
)
{
FIXME
(
"(%p, %p), stub!
\n
"
,
pc
,
lpbiIn
);
return
TRUE
;
/* I'm ignoring bmiColors as I don't know what to do with it,
* it doesn't appear to be used though
*/
DWORD
ret
;
pc
->
lpbiIn
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BITMAPINFO
));
if
(
!
pc
->
lpbiIn
)
return
FALSE
;
memcpy
(
pc
->
lpbiIn
,
lpbiIn
,
sizeof
(
BITMAPINFO
));
pc
->
lpBitsPrev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pc
->
lpbiIn
->
bmiHeader
.
biSizeImage
);
if
(
!
pc
->
lpBitsPrev
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpbiIn
);
return
FALSE
;
}
pc
->
lpState
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ICCOMPRESS
));
if
(
!
pc
->
lpState
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpbiIn
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpBitsPrev
);
return
FALSE
;
}
pc
->
cbState
=
sizeof
(
ICCOMPRESS
);
pc
->
lpBitsOut
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pc
->
lpbiOut
->
bmiHeader
.
biSizeImage
);
if
(
!
pc
->
lpBitsOut
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpbiIn
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpBitsPrev
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpState
);
return
FALSE
;
}
TRACE
(
"Compvars:
\n
"
"
\t
pc:
\n
"
"
\t
size: %li
\n
"
"
\t
flags: %li
\n
"
"
\t
hic: %p
\n
"
"
\t
type: %lx
\n
"
"
\t
handler: %lx
\n
"
"
\t
in/out: %p/%p
\n
"
"key/data/quality: %li/%li/%li
\n
"
,
pc
->
cbSize
,
pc
->
dwFlags
,
pc
->
hic
,
pc
->
fccType
,
pc
->
fccHandler
,
pc
->
lpbiIn
,
pc
->
lpbiOut
,
pc
->
lKey
,
pc
->
lDataRate
,
pc
->
lQ
);
ret
=
ICSendMessage
(
pc
->
hic
,
ICM_COMPRESS_BEGIN
,
(
DWORD
)
pc
->
lpbiIn
,
(
DWORD
)
pc
->
lpbiOut
);
TRACE
(
" -- %lx
\n
"
,
ret
);
if
(
ret
==
ICERR_OK
)
{
ICCOMPRESS
*
icComp
=
(
ICCOMPRESS
*
)
pc
->
lpState
;
/* Initialise some variables */
pc
->
lFrame
=
0
;
pc
->
lKeyCount
=
0
;
icComp
->
lpbiOutput
=
&
pc
->
lpbiOut
->
bmiHeader
;
icComp
->
lpbiInput
=
&
pc
->
lpbiIn
->
bmiHeader
;
icComp
->
lpckid
=
NULL
;
icComp
->
dwFrameSize
=
0
;
icComp
->
dwQuality
=
pc
->
lQ
;
icComp
->
lpbiPrev
=
&
pc
->
lpbiIn
->
bmiHeader
;
return
TRUE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpbiIn
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpBitsPrev
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpState
);
HeapFree
(
GetProcessHeap
(),
0
,
pc
->
lpBitsOut
);
pc
->
lpBitsPrev
=
pc
->
lpbiIn
=
pc
->
lpState
=
pc
->
lpBitsOut
=
NULL
;
return
FALSE
;
}
/***********************************************************************
...
...
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