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
5c12f6bd
Commit
5c12f6bd
authored
Mar 03, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Mar 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32: Merge IAVIStream into the WAVFile object.
parent
fbd740b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
80 deletions
+52
-80
wavfile.c
dlls/avifil32/wavfile.c
+52
-80
No files found.
dlls/avifil32/wavfile.c
View file @
5c12f6bd
...
...
@@ -165,26 +165,14 @@ static const struct IAVIStreamVtbl iwavst = {
IAVIStream_fnSetInfo
};
typedef
struct
_IAVIFileImpl
IAVIFileImpl
;
typedef
struct
_IAVIStreamImpl
{
/* IUnknown stuff */
const
IAVIStreamVtbl
*
lpVtbl
;
/* IAVIStream stuff */
IAVIFileImpl
*
paf
;
}
IAVIStreamImpl
;
struct
_IAVIFileImpl
{
typedef
struct
_IAVIFileImpl
{
IUnknown
IUnknown_inner
;
IAVIFile
IAVIFile_iface
;
IPersistFile
IPersistFile_iface
;
I
Unknown
IUnknown_inner
;
I
AVIStream
IAVIStream_iface
;
IUnknown
*
outer_unk
;
LONG
ref
;
/* IAVIFile, IAVIStream stuff... */
IAVIStreamImpl
iAVIStream
;
AVIFILEINFOW
fInfo
;
AVISTREAMINFOW
sInfo
;
...
...
@@ -200,7 +188,7 @@ struct _IAVIFileImpl {
LPWSTR
szFileName
;
UINT
uMode
;
BOOL
fDirty
;
};
}
IAVIFileImpl
;
/***********************************************************************/
...
...
@@ -224,7 +212,7 @@ static HRESULT WINAPI IUnknown_fnQueryInterface(IUnknown *iface, REFIID riid, vo
else
if
(
IsEqualGUID
(
&
IID_IAVIFile
,
riid
))
*
ret_iface
=
&
This
->
IAVIFile_iface
;
else
if
(
IsEqualGUID
(
&
IID_IAVIStream
,
riid
))
*
ret_iface
=
&
This
->
iAVIStream
;
*
ret_iface
=
&
This
->
IAVIStream_iface
;
else
if
(
IsEqualGUID
(
&
IID_IPersistFile
,
riid
))
*
ret_iface
=
&
This
->
IPersistFile_iface
;
else
{
...
...
@@ -299,15 +287,13 @@ HRESULT AVIFILE_CreateWAVFile(IUnknown *outer_unk, REFIID riid, void **ret_iface
pfile
->
IUnknown_inner
.
lpVtbl
=
&
unk_vtbl
;
pfile
->
IAVIFile_iface
.
lpVtbl
=
&
iwavft
;
pfile
->
IPersistFile_iface
.
lpVtbl
=
&
iwavpft
;
pfile
->
iAVIStream
.
lpVtbl
=
&
iwavst
;
pfile
->
IAVIStream_iface
.
lpVtbl
=
&
iwavst
;
pfile
->
ref
=
1
;
if
(
outer_unk
)
pfile
->
outer_unk
=
outer_unk
;
else
pfile
->
outer_unk
=
&
pfile
->
IUnknown_inner
;
pfile
->
iAVIStream
.
paf
=
pfile
;
hr
=
IUnknown_QueryInterface
(
&
pfile
->
IUnknown_inner
,
riid
,
ret_iface
);
IUnknown_Release
(
&
pfile
->
IUnknown_inner
);
...
...
@@ -392,8 +378,8 @@ static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, IAVIStream **avis, D
if
(
fccType
!=
0
&&
fccType
!=
streamtypeAUDIO
)
return
AVIERR_NODATA
;
*
avis
=
(
PAVISTREAM
)
&
This
->
iAVIStream
;
IAVIFile_AddRef
(
iface
);
*
avis
=
&
This
->
IAVIStream_iface
;
IAVIFile_AddRef
(
*
avis
);
return
AVIERR_OK
;
}
...
...
@@ -443,8 +429,8 @@ static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile *iface, IAVIStream **avis
This
->
ckData
.
dwDataOffset
=
0
;
This
->
ckData
.
cksize
=
0
;
*
avis
=
(
PAVISTREAM
)
&
This
->
iAVIStream
;
IAVIFile_AddRef
(
iface
);
*
avis
=
&
This
->
IAVIStream_iface
;
IAVIFile_AddRef
(
*
avis
);
return
AVIERR_OK
;
}
...
...
@@ -689,32 +675,30 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface, LPOLESTR *p
/***********************************************************************/
static
HRESULT
WINAPI
IAVIStream_fnQueryInterface
(
IAVIStream
*
iface
,
REFIID
refiid
,
LPVOID
*
obj
)
static
inline
IAVIFileImpl
*
impl_from_IAVIStream
(
IAVIStream
*
iface
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
return
CONTAINING_RECORD
(
iface
,
IAVIFileImpl
,
IAVIStream_iface
);
}
assert
(
This
->
paf
!=
NULL
);
static
HRESULT
WINAPI
IAVIStream_fnQueryInterface
(
IAVIStream
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
);
return
IAVIFile_QueryInterface
((
PAVIFILE
)
This
->
paf
,
refiid
,
obj
);
return
IUnknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ret_iface
);
}
static
ULONG
WINAPI
IAVIStream_fnAddRef
(
IAVIStream
*
iface
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
assert
(
This
->
paf
!=
NULL
);
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
);
return
IAVIFile_AddRef
((
PAVIFILE
)
This
->
paf
);
return
IUnknown_AddRef
(
This
->
outer_unk
);
}
static
ULONG
WINAPI
IAVIStream_fnRelease
(
IAVIStream
*
iface
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
assert
(
This
->
paf
!=
NULL
);
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
);
return
IAVIFile_Release
((
PAVIFILE
)
This
->
paf
);
return
IUnknown_Release
(
This
->
outer_unk
);
}
static
HRESULT
WINAPI
IAVIStream_fnCreate
(
IAVIStream
*
iface
,
LPARAM
lParam1
,
...
...
@@ -726,10 +710,9 @@ static HRESULT WINAPI IAVIStream_fnCreate(IAVIStream *iface, LPARAM lParam1,
return
AVIERR_UNSUPPORTED
;
}
static
HRESULT
WINAPI
IAVIStream_fnInfo
(
IAVIStream
*
iface
,
LPAVISTREAMINFOW
psi
,
LONG
size
)
static
HRESULT
WINAPI
IAVIStream_fnInfo
(
IAVIStream
*
iface
,
AVISTREAMINFOW
*
psi
,
LONG
size
)
{
IAVI
StreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
IAVI
FileImpl
*
This
=
impl_from_IAVIStream
(
iface
)
;
TRACE
(
"(%p,%p,%d)
\n
"
,
iface
,
psi
,
size
);
...
...
@@ -738,17 +721,16 @@ static HRESULT WINAPI IAVIStream_fnInfo(IAVIStream *iface,LPAVISTREAMINFOW psi,
if
(
size
<
0
)
return
AVIERR_BADSIZE
;
memcpy
(
psi
,
&
This
->
paf
->
sInfo
,
min
((
DWORD
)
size
,
sizeof
(
This
->
paf
->
sInfo
)));
memcpy
(
psi
,
&
This
->
sInfo
,
min
((
DWORD
)
size
,
sizeof
(
This
->
sInfo
)));
if
((
DWORD
)
size
<
sizeof
(
This
->
paf
->
sInfo
))
if
((
DWORD
)
size
<
sizeof
(
This
->
sInfo
))
return
AVIERR_BUFFERTOOSMALL
;
return
AVIERR_OK
;
}
static
LONG
WINAPI
IAVIStream_fnFindSample
(
IAVIStream
*
iface
,
LONG
pos
,
LONG
flags
)
static
LONG
WINAPI
IAVIStream_fnFindSample
(
IAVIStream
*
iface
,
LONG
pos
,
LONG
flags
)
{
IAVIFileImpl
*
This
=
((
IAVIStreamImpl
*
)
iface
)
->
paf
;
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
)
;
TRACE
(
"(%p,%d,0x%08X)
\n
"
,
iface
,
pos
,
flags
);
...
...
@@ -782,10 +764,10 @@ static LONG WINAPI IAVIStream_fnFindSample(IAVIStream *iface, LONG pos,
return
pos
;
}
static
HRESULT
WINAPI
IAVIStream_fnReadFormat
(
IAVIStream
*
iface
,
LONG
pos
,
LPVOID
format
,
LONG
*
formatsize
)
static
HRESULT
WINAPI
IAVIStream_fnReadFormat
(
IAVIStream
*
iface
,
LONG
pos
,
void
*
format
,
LONG
*
formatsize
)
{
IAVI
StreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
IAVI
FileImpl
*
This
=
impl_from_IAVIStream
(
iface
)
;
TRACE
(
"(%p,%d,%p,%p)
\n
"
,
iface
,
pos
,
format
,
formatsize
);
...
...
@@ -794,26 +776,26 @@ static HRESULT WINAPI IAVIStream_fnReadFormat(IAVIStream *iface, LONG pos,
/* only interested in needed buffersize? */
if
(
format
==
NULL
||
*
formatsize
<=
0
)
{
*
formatsize
=
This
->
paf
->
cbFormat
;
*
formatsize
=
This
->
cbFormat
;
return
AVIERR_OK
;
}
/* copy initial format (only as much as will fit) */
memcpy
(
format
,
This
->
paf
->
lpFormat
,
min
(
*
formatsize
,
This
->
paf
->
cbFormat
));
if
(
*
formatsize
<
This
->
paf
->
cbFormat
)
{
*
formatsize
=
This
->
paf
->
cbFormat
;
memcpy
(
format
,
This
->
lpFormat
,
min
(
*
formatsize
,
This
->
cbFormat
));
if
(
*
formatsize
<
This
->
cbFormat
)
{
*
formatsize
=
This
->
cbFormat
;
return
AVIERR_BUFFERTOOSMALL
;
}
*
formatsize
=
This
->
paf
->
cbFormat
;
*
formatsize
=
This
->
cbFormat
;
return
AVIERR_OK
;
}
static
HRESULT
WINAPI
IAVIStream_fnSetFormat
(
IAVIStream
*
iface
,
LONG
pos
,
LPVOID
format
,
LONG
formatsize
)
static
HRESULT
WINAPI
IAVIStream_fnSetFormat
(
IAVIStream
*
iface
,
LONG
pos
,
void
*
format
,
LONG
formatsize
)
{
IAVIFileImpl
*
This
=
((
IAVIStreamImpl
*
)
iface
)
->
paf
;
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
)
;
TRACE
(
"(%p,%d,%p,%d)
\n
"
,
iface
,
pos
,
format
,
formatsize
);
...
...
@@ -865,12 +847,10 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
return
AVIERR_OK
;
}
static
HRESULT
WINAPI
IAVIStream_fnRead
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
,
LPVOID
buffer
,
LONG
buffersize
,
LPLONG
bytesread
,
LPLONG
samplesread
)
static
HRESULT
WINAPI
IAVIStream_fnRead
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
,
void
*
buffer
,
LONG
buffersize
,
LONG
*
bytesread
,
LONG
*
samplesread
)
{
IAVIFileImpl
*
This
=
((
IAVIStreamImpl
*
)
iface
)
->
paf
;
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
)
;
TRACE
(
"(%p,%d,%d,%p,%d,%p,%p)
\n
"
,
iface
,
start
,
samples
,
buffer
,
buffersize
,
bytesread
,
samplesread
);
...
...
@@ -938,13 +918,10 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
return
AVIERR_OK
;
}
static
HRESULT
WINAPI
IAVIStream_fnWrite
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
,
LPVOID
buffer
,
LONG
buffersize
,
DWORD
flags
,
LPLONG
sampwritten
,
LPLONG
byteswritten
)
static
HRESULT
WINAPI
IAVIStream_fnWrite
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
,
void
*
buffer
,
LONG
buffersize
,
DWORD
flags
,
LONG
*
sampwritten
,
LONG
*
byteswritten
)
{
IAVIFileImpl
*
This
=
((
IAVIStreamImpl
*
)
iface
)
->
paf
;
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
)
;
TRACE
(
"(%p,%d,%d,%p,%d,0x%08X,%p,%p)
\n
"
,
iface
,
start
,
samples
,
buffer
,
buffersize
,
flags
,
sampwritten
,
byteswritten
);
...
...
@@ -995,10 +972,9 @@ static HRESULT WINAPI IAVIStream_fnWrite(IAVIStream *iface, LONG start,
return
AVIERR_OK
;
}
static
HRESULT
WINAPI
IAVIStream_fnDelete
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
)
static
HRESULT
WINAPI
IAVIStream_fnDelete
(
IAVIStream
*
iface
,
LONG
start
,
LONG
samples
)
{
IAVIFileImpl
*
This
=
((
IAVIStreamImpl
*
)
iface
)
->
paf
;
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
)
;
TRACE
(
"(%p,%d,%d)
\n
"
,
iface
,
start
,
samples
);
...
...
@@ -1041,22 +1017,18 @@ static HRESULT WINAPI IAVIStream_fnDelete(IAVIStream *iface, LONG start,
return
AVIERR_OK
;
}
static
HRESULT
WINAPI
IAVIStream_fnReadData
(
IAVIStream
*
iface
,
DWORD
fcc
,
LPVOID
lp
,
LPLONG
lpread
)
static
HRESULT
WINAPI
IAVIStream_fnReadData
(
IAVIStream
*
iface
,
DWORD
fcc
,
void
*
lp
,
LONG
*
lpread
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
assert
(
This
->
paf
!=
NULL
);
IAVIFileImpl
*
This
=
impl_from_IAVIStream
(
iface
);
return
IAVIFile_ReadData
(
(
PAVIFILE
)
This
->
paf
,
fcc
,
lp
,
lpread
);
return
IAVIFile_ReadData
(
&
This
->
IAVIFile_iface
,
fcc
,
lp
,
lpread
);
}
static
HRESULT
WINAPI
IAVIStream_fnWriteData
(
IAVIStream
*
iface
,
DWORD
fcc
,
LPVOID
lp
,
LONG
size
)
static
HRESULT
WINAPI
IAVIStream_fnWriteData
(
IAVIStream
*
iface
,
DWORD
fcc
,
void
*
lp
,
LONG
size
)
{
IAVI
StreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
IAVI
FileImpl
*
This
=
impl_from_IAVIStream
(
iface
)
;
return
IAVIFile_WriteData
(
(
PAVIFILE
)
This
->
paf
,
fcc
,
lp
,
size
);
return
IAVIFile_WriteData
(
&
This
->
IAVIFile_iface
,
fcc
,
lp
,
size
);
}
static
HRESULT
WINAPI
IAVIStream_fnSetInfo
(
IAVIStream
*
iface
,
...
...
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