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
Lorenzo Ferrillo
wine
Commits
c567d1e4
Commit
c567d1e4
authored
14 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
avifil32: Avoid the forward declaration of the IAVIStream methods.
parent
1f8e505d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/avifil32/acmstream.c
+79
-98
79 additions, 98 deletions
dlls/avifil32/acmstream.c
with
79 additions
and
98 deletions
dlls/avifil32/acmstream.c
+
79
−
98
View file @
c567d1e4
...
...
@@ -36,38 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(avifile);
/***********************************************************************/
static
HRESULT
WINAPI
ACMStream_fnQueryInterface
(
IAVIStream
*
iface
,
REFIID
refiid
,
LPVOID
*
obj
);
static
ULONG
WINAPI
ACMStream_fnAddRef
(
IAVIStream
*
iface
);
static
ULONG
WINAPI
ACMStream_fnRelease
(
IAVIStream
*
iface
);
static
HRESULT
WINAPI
ACMStream_fnCreate
(
IAVIStream
*
iface
,
LPARAM
lParam1
,
LPARAM
lParam2
);
static
HRESULT
WINAPI
ACMStream_fnInfo
(
IAVIStream
*
iface
,
AVISTREAMINFOW
*
psi
,
LONG
size
);
static
LONG
WINAPI
ACMStream_fnFindSample
(
IAVIStream
*
iface
,
LONG
pos
,
LONG
flags
);
static
HRESULT
WINAPI
ACMStream_fnReadFormat
(
IAVIStream
*
iface
,
LONG
pos
,
LPVOID
format
,
LONG
*
formatsize
);
static
HRESULT
WINAPI
ACMStream_fnSetFormat
(
IAVIStream
*
iface
,
LONG
pos
,
LPVOID
format
,
LONG
formatsize
);
static
HRESULT
WINAPI
ACMStream_fnRead
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
,
LPVOID
buffer
,
LONG
buffersize
,
LONG
*
bytesread
,
LONG
*
samplesread
);
static
HRESULT
WINAPI
ACMStream_fnWrite
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
,
LPVOID
buffer
,
LONG
buffersize
,
DWORD
flags
,
LONG
*
sampwritten
,
LONG
*
byteswritten
);
static
HRESULT
WINAPI
ACMStream_fnDelete
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
);
static
HRESULT
WINAPI
ACMStream_fnReadData
(
IAVIStream
*
iface
,
DWORD
fcc
,
LPVOID
lp
,
LONG
*
lpread
);
static
HRESULT
WINAPI
ACMStream_fnWriteData
(
IAVIStream
*
iface
,
DWORD
fcc
,
LPVOID
lp
,
LONG
size
);
static
HRESULT
WINAPI
ACMStream_fnSetInfo
(
IAVIStream
*
iface
,
AVISTREAMINFOW
*
info
,
LONG
infolen
);
static
const
struct
IAVIStreamVtbl
iacmst
=
{
ACMStream_fnQueryInterface
,
ACMStream_fnAddRef
,
ACMStream_fnRelease
,
ACMStream_fnCreate
,
ACMStream_fnInfo
,
ACMStream_fnFindSample
,
ACMStream_fnReadFormat
,
ACMStream_fnSetFormat
,
ACMStream_fnRead
,
ACMStream_fnWrite
,
ACMStream_fnDelete
,
ACMStream_fnReadData
,
ACMStream_fnWriteData
,
ACMStream_fnSetInfo
};
typedef
struct
_IAVIStreamImpl
{
/* IUnknown stuff */
IAVIStream
IAVIStream_iface
;
...
...
@@ -102,28 +70,63 @@ typedef struct _IAVIStreamImpl {
&__bytes, ACM_STREAMSIZEF_DESTINATION); \
*(a) = __bytes / This->lpInFormat->nBlockAlign; } while(0)
static
HRESULT
AVIFILE_OpenCompressor
(
IAVIStreamImpl
*
This
);
HRESULT
AVIFILE_CreateACMStream
(
REFIID
riid
,
LPVOID
*
ppv
)
static
HRESULT
AVIFILE_OpenCompressor
(
IAVIStreamImpl
*
This
)
{
IAVIStreamImpl
*
pstream
;
HRESULT
hr
;
HRESULT
hr
;
assert
(
riid
!=
NULL
&&
ppv
!=
NULL
);
/* pre-conditions */
assert
(
This
!=
NULL
);
assert
(
This
->
pStream
!=
NULL
);
*
ppv
=
NULL
;
if
(
This
->
has
!=
NULL
)
return
AVIERR_OK
;
pstream
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IAVIStreamImpl
));
if
(
pstream
==
NULL
)
return
AVIERR_MEMORY
;
if
(
This
->
lpInFormat
==
NULL
)
{
/* decode or encode the data from pStream */
hr
=
AVIStreamFormatSize
(
This
->
pStream
,
This
->
sInfo
.
dwStart
,
&
This
->
cbInFormat
);
if
(
FAILED
(
hr
))
return
hr
;
This
->
lpInFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbInFormat
);
if
(
This
->
lpInFormat
==
NULL
)
return
AVIERR_MEMORY
;
pstream
->
IAVIStream_iface
.
lpVtbl
=
&
iacmst
;
hr
=
IAVIStream_ReadFormat
(
This
->
pStream
,
This
->
sInfo
.
dwStart
,
This
->
lpInFormat
,
&
This
->
cbInFormat
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IAVIStream_QueryInterface
(
&
pstream
->
IAVIStream_iface
,
riid
,
ppv
);
if
(
FAILED
(
hr
))
HeapFree
(
GetProcessHeap
(),
0
,
pstream
);
if
(
This
->
lpOutFormat
==
NULL
)
{
/* we must decode to default format */
This
->
cbOutFormat
=
sizeof
(
PCMWAVEFORMAT
);
This
->
lpOutFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbOutFormat
);
if
(
This
->
lpOutFormat
==
NULL
)
return
AVIERR_MEMORY
;
return
hr
;
This
->
lpOutFormat
->
wFormatTag
=
WAVE_FORMAT_PCM
;
if
(
acmFormatSuggest
(
NULL
,
This
->
lpInFormat
,
This
->
lpOutFormat
,
This
->
cbOutFormat
,
ACM_FORMATSUGGESTF_WFORMATTAG
)
!=
S_OK
)
return
AVIERR_NOCOMPRESSOR
;
}
}
else
if
(
This
->
lpOutFormat
==
NULL
)
return
AVIERR_ERROR
;
/* To what should I encode? */
if
(
acmStreamOpen
(
&
This
->
has
,
NULL
,
This
->
lpInFormat
,
This
->
lpOutFormat
,
NULL
,
0
,
0
,
ACM_STREAMOPENF_NONREALTIME
)
!=
S_OK
)
return
AVIERR_NOCOMPRESSOR
;
/* update AVISTREAMINFO structure */
This
->
sInfo
.
dwSampleSize
=
This
->
lpOutFormat
->
nBlockAlign
;
This
->
sInfo
.
dwScale
=
This
->
lpOutFormat
->
nBlockAlign
;
This
->
sInfo
.
dwRate
=
This
->
lpOutFormat
->
nAvgBytesPerSec
;
This
->
sInfo
.
dwQuality
=
(
DWORD
)
ICQUALITY_DEFAULT
;
SetRectEmpty
(
&
This
->
sInfo
.
rcFrame
);
/* convert positions and sizes to output format */
CONVERT_STREAM_to_THIS
(
&
This
->
sInfo
.
dwStart
);
CONVERT_STREAM_to_THIS
(
&
This
->
sInfo
.
dwLength
);
CONVERT_STREAM_to_THIS
(
&
This
->
sInfo
.
dwSuggestedBufferSize
);
return
AVIERR_OK
;
}
static
inline
IAVIStreamImpl
*
impl_from_IAVIStream
(
IAVIStream
*
iface
)
...
...
@@ -681,63 +684,41 @@ static HRESULT WINAPI ACMStream_fnSetInfo(IAVIStream *iface,
return
E_FAIL
;
}
/***********************************************************************/
static
const
struct
IAVIStreamVtbl
iacmst
=
{
ACMStream_fnQueryInterface
,
ACMStream_fnAddRef
,
ACMStream_fnRelease
,
ACMStream_fnCreate
,
ACMStream_fnInfo
,
ACMStream_fnFindSample
,
ACMStream_fnReadFormat
,
ACMStream_fnSetFormat
,
ACMStream_fnRead
,
ACMStream_fnWrite
,
ACMStream_fnDelete
,
ACMStream_fnReadData
,
ACMStream_fnWriteData
,
ACMStream_fnSetInfo
};
static
HRESULT
AVIFILE_
OpenCompressor
(
IAVIStreamImpl
*
This
)
HRESULT
AVIFILE_
CreateACMStream
(
REFIID
riid
,
LPVOID
*
ppv
)
{
HRESULT
hr
;
/* pre-conditions */
assert
(
This
!=
NULL
);
assert
(
This
->
pStream
!=
NULL
);
if
(
This
->
has
!=
NULL
)
return
AVIERR_OK
;
if
(
This
->
lpInFormat
==
NULL
)
{
/* decode or encode the data from pStream */
hr
=
AVIStreamFormatSize
(
This
->
pStream
,
This
->
sInfo
.
dwStart
,
&
This
->
cbInFormat
);
if
(
FAILED
(
hr
))
return
hr
;
This
->
lpInFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbInFormat
);
if
(
This
->
lpInFormat
==
NULL
)
return
AVIERR_MEMORY
;
hr
=
IAVIStream_ReadFormat
(
This
->
pStream
,
This
->
sInfo
.
dwStart
,
This
->
lpInFormat
,
&
This
->
cbInFormat
);
if
(
FAILED
(
hr
))
return
hr
;
IAVIStreamImpl
*
pstream
;
HRESULT
hr
;
if
(
This
->
lpOutFormat
==
NULL
)
{
/* we must decode to default format */
This
->
cbOutFormat
=
sizeof
(
PCMWAVEFORMAT
);
This
->
lpOutFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbOutFormat
);
if
(
This
->
lpOutFormat
==
NULL
)
return
AVIERR_MEMORY
;
assert
(
riid
!=
NULL
&&
ppv
!=
NULL
);
This
->
lpOutFormat
->
wFormatTag
=
WAVE_FORMAT_PCM
;
if
(
acmFormatSuggest
(
NULL
,
This
->
lpInFormat
,
This
->
lpOutFormat
,
This
->
cbOutFormat
,
ACM_FORMATSUGGESTF_WFORMATTAG
)
!=
S_OK
)
return
AVIERR_NOCOMPRESSOR
;
}
}
else
if
(
This
->
lpOutFormat
==
NULL
)
return
AVIERR_ERROR
;
/* To what should I encode? */
*
ppv
=
NULL
;
if
(
acmStreamOpen
(
&
This
->
has
,
NULL
,
This
->
lpInFormat
,
This
->
lpOutFormat
,
NULL
,
0
,
0
,
ACM_STREAMOPENF_NONREALTIME
)
!=
S_OK
)
return
AVIERR_
NOCOMPRESS
OR
;
pstream
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IAVIStreamImpl
));
if
(
pstream
==
NULL
)
return
AVIERR_
MEM
OR
Y
;
/* update AVISTREAMINFO structure */
This
->
sInfo
.
dwSampleSize
=
This
->
lpOutFormat
->
nBlockAlign
;
This
->
sInfo
.
dwScale
=
This
->
lpOutFormat
->
nBlockAlign
;
This
->
sInfo
.
dwRate
=
This
->
lpOutFormat
->
nAvgBytesPerSec
;
This
->
sInfo
.
dwQuality
=
(
DWORD
)
ICQUALITY_DEFAULT
;
SetRectEmpty
(
&
This
->
sInfo
.
rcFrame
);
pstream
->
IAVIStream_iface
.
lpVtbl
=
&
iacmst
;
/* convert positions and sizes to output format */
CONVERT_STREAM_to_THIS
(
&
This
->
sInfo
.
dwStart
);
CONVERT_STREAM_to_THIS
(
&
This
->
sInfo
.
dwLength
);
CONVERT_STREAM_to_THIS
(
&
This
->
sInfo
.
dwSuggestedBufferSize
);
hr
=
IAVIStream_QueryInterface
(
&
pstream
->
IAVIStream_iface
,
riid
,
ppv
);
if
(
FAILED
(
hr
))
HeapFree
(
GetProcessHeap
(),
0
,
pstream
);
return
AVIERR_OK
;
return
hr
;
}
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