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
e575ad29
Commit
e575ad29
authored
Sep 17, 2001
by
Hidenori Takeshima
Committed by
Alexandre Julliard
Sep 17, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented IMemAllocator.
parent
4ee65164
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
701 additions
and
37 deletions
+701
-37
Makefile.in
dlls/quartz/Makefile.in
+1
-0
complist.c
dlls/quartz/complist.c
+1
-0
devenum.c
dlls/quartz/devenum.c
+1
-0
enumunk.c
dlls/quartz/enumunk.c
+1
-0
fgclsid.c
dlls/quartz/fgclsid.c
+1
-0
fgidisp.c
dlls/quartz/fgidisp.c
+1
-0
fgraph.c
dlls/quartz/fgraph.c
+1
-0
fmap.c
dlls/quartz/fmap.c
+1
-0
fmap2.c
dlls/quartz/fmap2.c
+1
-0
ibasaud.c
dlls/quartz/ibasaud.c
+1
-0
ibasvid.c
dlls/quartz/ibasvid.c
+1
-0
ifgraph.c
dlls/quartz/ifgraph.c
+1
-0
ifmap.c
dlls/quartz/ifmap.c
+1
-0
ifmap3.c
dlls/quartz/ifmap3.c
+1
-0
igrver.c
dlls/quartz/igrver.c
+1
-0
imcntl.c
dlls/quartz/imcntl.c
+1
-0
imem.c
dlls/quartz/imem.c
+183
-10
imesink.c
dlls/quartz/imesink.c
+1
-0
imevent.c
dlls/quartz/imevent.c
+1
-0
imfilter.c
dlls/quartz/imfilter.c
+1
-0
impos.c
dlls/quartz/impos.c
+1
-0
imseek.c
dlls/quartz/imseek.c
+1
-0
irclock.c
dlls/quartz/irclock.c
+1
-1
ividwin.c
dlls/quartz/ividwin.c
+1
-0
main.c
dlls/quartz/main.c
+1
-0
memalloc.c
dlls/quartz/memalloc.c
+1
-0
memalloc.h
dlls/quartz/memalloc.h
+4
-0
sample.c
dlls/quartz/sample.c
+414
-0
sample.h
dlls/quartz/sample.h
+34
-0
seekpass.c
dlls/quartz/seekpass.c
+1
-0
sysclock.c
dlls/quartz/sysclock.c
+1
-0
Makefile.in
include/Makefile.in
+1
-0
dsound.h
include/dsound.h
+1
-26
strmif.h
include/strmif.h
+0
-0
obj_ksproperty.h
include/wine/obj_ksproperty.h
+37
-0
No files found.
dlls/quartz/Makefile.in
View file @
e575ad29
...
...
@@ -41,6 +41,7 @@ C_SRCS = \
memalloc.c
\
monprop.c
\
regsvr.c
\
sample.c
\
seekpass.c
\
sysclock.c
...
...
dlls/quartz/complist.c
View file @
e575ad29
...
...
@@ -9,6 +9,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
...
...
dlls/quartz/devenum.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/enumunk.c
View file @
e575ad29
...
...
@@ -9,6 +9,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/fgclsid.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/fgidisp.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/fgraph.c
View file @
e575ad29
...
...
@@ -9,6 +9,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/fmap.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/fmap2.c
View file @
e575ad29
...
...
@@ -12,6 +12,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "winerror.h"
#include "winuser.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
...
...
dlls/quartz/ibasaud.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/ibasvid.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/ifgraph.c
View file @
e575ad29
...
...
@@ -12,6 +12,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/ifmap.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
...
...
dlls/quartz/ifmap3.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
...
...
dlls/quartz/igrver.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/imcntl.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/imem.c
View file @
e575ad29
/*
* Implementation of CLSID_MemoryAllocator.
*
* FIXME -
stub
.
* FIXME -
not tested
.
*
* hidenori@a2.ctktv.ne.jp
*/
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
...
...
@@ -58,6 +59,7 @@ IMemAllocator_fnSetProperties(IMemAllocator* iface,ALLOCATOR_PROPERTIES* pPropRe
{
CMemoryAllocator_THIS
(
iface
,
memalloc
);
long
padding
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p,%p)
\n
"
,
This
,
pPropReq
,
pPropActual
);
...
...
@@ -72,8 +74,17 @@ IMemAllocator_fnSetProperties(IMemAllocator* iface,ALLOCATOR_PROPERTIES* pPropRe
if
(
(
pPropReq
->
cbAlign
&
(
pPropReq
->
cbAlign
-
1
)
)
!=
0
)
return
E_INVALIDARG
;
hr
=
NOERROR
;
EnterCriticalSection
(
&
This
->
csMem
);
if
(
This
->
pData
!=
NULL
||
This
->
ppSamples
!=
NULL
)
{
/* if commited, properties must not be changed. */
hr
=
E_UNEXPECTED
;
goto
end
;
}
This
->
prop
.
cBuffers
=
pPropReq
->
cBuffers
;
This
->
prop
.
cbBuffer
=
pPropReq
->
cbBuffer
;
This
->
prop
.
cbAlign
=
pPropReq
->
cbAlign
;
...
...
@@ -88,9 +99,10 @@ IMemAllocator_fnSetProperties(IMemAllocator* iface,ALLOCATOR_PROPERTIES* pPropRe
memcpy
(
pPropActual
,
&
This
->
prop
,
sizeof
(
ALLOCATOR_PROPERTIES
)
);
end:
LeaveCriticalSection
(
&
This
->
csMem
);
return
NOERROR
;
return
hr
;
}
static
HRESULT
WINAPI
...
...
@@ -116,27 +128,176 @@ static HRESULT WINAPI
IMemAllocator_fnCommit
(
IMemAllocator
*
iface
)
{
CMemoryAllocator_THIS
(
iface
,
memalloc
);
HRESULT
hr
;
LONG
lBufSize
;
LONG
i
;
BYTE
*
pCur
;
TRACE
(
"(%p)->()
\n
"
,
This
);
EnterCriticalSection
(
&
This
->
csMem
);
hr
=
NOERROR
;
if
(
This
->
pData
!=
NULL
||
This
->
ppSamples
!=
NULL
||
This
->
prop
.
cBuffers
<=
0
)
goto
end
;
lBufSize
=
This
->
prop
.
cBuffers
*
(
This
->
prop
.
cbBuffer
+
This
->
prop
.
cbPrefix
)
+
This
->
prop
.
cbAlign
;
if
(
lBufSize
<=
0
)
lBufSize
=
1
;
This
->
pData
=
(
BYTE
*
)
QUARTZ_AllocMem
(
lBufSize
);
if
(
This
->
pData
==
NULL
)
{
hr
=
E_OUTOFMEMORY
;
goto
end
;
}
This
->
ppSamples
=
(
CMemMediaSample
**
)
QUARTZ_AllocMem
(
sizeof
(
CMemMediaSample
*
)
*
This
->
prop
.
cBuffers
);
if
(
This
->
ppSamples
==
NULL
)
{
hr
=
E_OUTOFMEMORY
;
goto
end
;
}
for
(
i
=
0
;
i
<
This
->
prop
.
cBuffers
;
i
++
)
This
->
ppSamples
[
i
]
=
NULL
;
pCur
=
This
->
pData
+
This
->
prop
.
cbAlign
-
((
This
->
pData
-
(
BYTE
*
)
NULL
)
&
(
This
->
prop
.
cbAlign
-
1
));
for
(
i
=
0
;
i
<
This
->
prop
.
cBuffers
;
i
++
)
{
hr
=
QUARTZ_CreateMemMediaSample
(
pCur
,
(
This
->
prop
.
cbBuffer
+
This
->
prop
.
cbPrefix
),
iface
,
&
This
->
ppSamples
[
i
]
);
if
(
FAILED
(
hr
)
)
goto
end
;
pCur
+=
(
This
->
prop
.
cbBuffer
+
This
->
prop
.
cbPrefix
);
}
hr
=
NOERROR
;
end:
if
(
FAILED
(
hr
)
)
IMemAllocator_Decommit
(
iface
);
FIXME
(
"(%p)->() stub!
\n
"
,
This
);
return
E_NOTIMPL
;
LeaveCriticalSection
(
&
This
->
csMem
);
return
hr
;
}
static
HRESULT
WINAPI
IMemAllocator_fnDecommit
(
IMemAllocator
*
iface
)
{
CMemoryAllocator_THIS
(
iface
,
memalloc
);
HRESULT
hr
;
LONG
i
;
BOOL
bBlock
;
TRACE
(
"(%p)->()
\n
"
,
This
);
FIXME
(
"(%p)->() stub!
\n
"
,
This
);
return
E_NOTIMPL
;
EnterCriticalSection
(
&
This
->
csMem
);
hr
=
NOERROR
;
if
(
This
->
pData
==
NULL
&&
This
->
ppSamples
==
NULL
)
goto
end
;
while
(
1
)
{
bBlock
=
FALSE
;
i
=
0
;
ResetEvent
(
This
->
hEventSample
);
while
(
1
)
{
if
(
i
>=
This
->
prop
.
cBuffers
)
break
;
if
(
This
->
ppSamples
[
i
]
!=
NULL
)
{
if
(
This
->
ppSamples
[
i
]
->
ref
==
0
)
{
QUARTZ_DestroyMemMediaSample
(
This
->
ppSamples
[
i
]
);
This
->
ppSamples
[
i
]
=
NULL
;
}
else
{
bBlock
=
TRUE
;
}
}
i
++
;
}
if
(
!
bBlock
)
{
hr
=
NOERROR
;
break
;
}
WaitForSingleObject
(
This
->
hEventSample
,
INFINITE
);
}
end:
LeaveCriticalSection
(
&
This
->
csMem
);
return
hr
;
}
static
HRESULT
WINAPI
IMemAllocator_fnGetBuffer
(
IMemAllocator
*
iface
,
IMediaSample
**
ppSample
,
REFERENCE_TIME
*
prtStart
,
REFERENCE_TIME
*
prtEnd
,
DWORD
dwFlags
)
{
CMemoryAllocator_THIS
(
iface
,
memalloc
);
LONG
i
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p,%p,%p,%lu)
\n
"
,
This
,
ppSample
,
prtStart
,
prtEnd
,
dwFlags
);
if
(
ppSample
==
NULL
)
return
E_POINTER
;
EnterCriticalSection
(
&
This
->
csMem
);
FIXME
(
"(%p)->() stub!
\n
"
,
This
);
return
E_NOTIMPL
;
hr
=
NOERROR
;
if
(
This
->
pData
==
NULL
||
This
->
ppSamples
==
NULL
||
This
->
prop
.
cBuffers
<=
0
)
{
hr
=
E_FAIL
;
/* FIXME? */
goto
end
;
}
while
(
1
)
{
ResetEvent
(
This
->
hEventSample
);
for
(
i
=
0
;
i
<
This
->
prop
.
cBuffers
;
i
++
)
{
if
(
This
->
ppSamples
[
i
]
->
ref
==
0
)
{
*
ppSample
=
(
IMediaSample
*
)(
This
->
ppSamples
[
i
]);
IMediaSample_AddRef
(
*
ppSample
);
hr
=
NOERROR
;
goto
end
;
}
}
if
(
dwFlags
&
AM_GBF_NOWAIT
)
{
hr
=
E_FAIL
;
/* FIXME? */
goto
end
;
}
WaitForSingleObject
(
This
->
hEventSample
,
INFINITE
);
}
end:
LeaveCriticalSection
(
&
This
->
csMem
);
return
hr
;
}
static
HRESULT
WINAPI
...
...
@@ -144,8 +305,10 @@ IMemAllocator_fnReleaseBuffer(IMemAllocator* iface,IMediaSample* pSample)
{
CMemoryAllocator_THIS
(
iface
,
memalloc
);
FIXME
(
"(%p)->() stub!
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pSample
);
SetEvent
(
This
->
hEventSample
);
return
NOERROR
;
}
...
...
@@ -174,6 +337,13 @@ HRESULT CMemoryAllocator_InitIMemAllocator( CMemoryAllocator* pma )
ICOM_VTBL
(
&
pma
->
memalloc
)
=
&
imemalloc
;
ZeroMemory
(
&
pma
->
prop
,
sizeof
(
pma
->
prop
)
);
pma
->
hEventSample
=
(
HANDLE
)
NULL
;
pma
->
pData
=
NULL
;
pma
->
ppSamples
=
NULL
;
pma
->
hEventSample
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
NULL
);
if
(
pma
->
hEventSample
==
(
HANDLE
)
NULL
)
return
E_OUTOFMEMORY
;
InitializeCriticalSection
(
&
pma
->
csMem
);
...
...
@@ -187,4 +357,7 @@ void CMemoryAllocator_UninitIMemAllocator( CMemoryAllocator* pma )
IMemAllocator_Decommit
(
(
IMemAllocator
*
)(
&
pma
->
memalloc
)
);
DeleteCriticalSection
(
&
pma
->
csMem
);
if
(
pma
->
hEventSample
!=
(
HANDLE
)
NULL
)
CloseHandle
(
pma
->
hEventSample
);
}
dlls/quartz/imesink.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/imevent.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/imfilter.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/impos.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/imseek.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/irclock.c
View file @
e575ad29
...
...
@@ -213,7 +213,7 @@ IReferenceClock_fnGetTime(IReferenceClock* iface,REFERENCE_TIME* prtTime)
EnterCriticalSection
(
&
This
->
m_csClock
);
dwTimeCur
=
GetTickCount
();
This
->
m_rtLast
+=
(
REFERENCE_TIME
)(
DWORD
)(
dwTimeCur
-
This
->
m_dwTimeLast
);
This
->
m_rtLast
+=
(
REFERENCE_TIME
)(
DWORD
)(
dwTimeCur
-
This
->
m_dwTimeLast
)
*
(
REFERENCE_TIME
)
10000
;
This
->
m_dwTimeLast
=
dwTimeCur
;
...
...
dlls/quartz/ividwin.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
...
...
dlls/quartz/main.c
View file @
e575ad29
...
...
@@ -4,6 +4,7 @@
#include "winerror.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ole2.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
...
...
dlls/quartz/memalloc.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
...
...
dlls/quartz/memalloc.h
View file @
e575ad29
...
...
@@ -12,6 +12,7 @@
*/
#include "iunk.h"
#include "sample.h"
typedef
struct
MA_IMemAllocatorImpl
{
...
...
@@ -26,6 +27,9 @@ typedef struct CMemoryAllocator
/* IMemAllocator fields. */
CRITICAL_SECTION
csMem
;
ALLOCATOR_PROPERTIES
prop
;
HANDLE
hEventSample
;
BYTE
*
pData
;
CMemMediaSample
**
ppSamples
;
}
CMemoryAllocator
;
#define CMemoryAllocator_THIS(iface,member) CMemoryAllocator* This = ((CMemoryAllocator*)(((char*)iface)-offsetof(CMemoryAllocator,member)))
...
...
dlls/quartz/sample.c
0 → 100644
View file @
e575ad29
/*
* Implements IMediaSample2 for CMemMediaSample.
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
quartz
);
#include "quartz_private.h"
#include "sample.h"
static
HRESULT
WINAPI
IMediaSample2_fnQueryInterface
(
IMediaSample2
*
iface
,
REFIID
riid
,
void
**
ppobj
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
if
(
ppobj
==
NULL
)
return
E_POINTER
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IMediaSample
)
||
IsEqualGUID
(
riid
,
&
IID_IMediaSample2
)
)
{
*
ppobj
=
iface
;
IMediaSample2_AddRef
(
iface
);
return
NOERROR
;
}
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IMediaSample2_fnAddRef
(
IMediaSample2
*
iface
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
return
InterlockedExchangeAdd
(
&
(
This
->
ref
),
1
)
+
1
;
}
static
ULONG
WINAPI
IMediaSample2_fnRelease
(
IMediaSample2
*
iface
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
LONG
ref
;
TRACE
(
"(%p)->()
\n
"
,
This
);
ref
=
InterlockedExchangeAdd
(
&
(
This
->
ref
),
-
1
)
-
1
;
if
(
ref
>
0
)
return
(
ULONG
)
ref
;
IMemAllocator_ReleaseBuffer
(
This
->
pOwner
,(
IMediaSample
*
)
iface
);
return
0
;
}
static
HRESULT
WINAPI
IMediaSample2_fnGetPointer
(
IMediaSample2
*
iface
,
BYTE
**
ppData
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
if
(
ppData
==
NULL
)
return
E_POINTER
;
*
ppData
=
This
->
prop
.
pbBuffer
;
return
NOERROR
;
}
static
long
WINAPI
IMediaSample2_fnGetSize
(
IMediaSample2
*
iface
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
return
This
->
prop
.
cbBuffer
;
}
static
HRESULT
WINAPI
IMediaSample2_fnGetTime
(
IMediaSample2
*
iface
,
REFERENCE_TIME
*
prtStart
,
REFERENCE_TIME
*
prtEnd
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%p,%p)
\n
"
,
This
,
prtStart
,
prtEnd
);
if
(
prtStart
==
NULL
||
prtEnd
==
NULL
)
return
E_POINTER
;
if
(
(
This
->
prop
.
dwSampleFlags
&
AM_SAMPLE_TIMEVALID
)
&&
(
This
->
prop
.
dwSampleFlags
&
AM_SAMPLE_STOPVALID
)
)
{
*
prtStart
=
This
->
prop
.
tStart
;
*
prtEnd
=
This
->
prop
.
tStop
;
return
NOERROR
;
}
return
VFW_E_MEDIA_TIME_NOT_SET
;
}
static
HRESULT
WINAPI
IMediaSample2_fnSetTime
(
IMediaSample2
*
iface
,
REFERENCE_TIME
*
prtStart
,
REFERENCE_TIME
*
prtEnd
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%p,%p) stub!
\n
"
,
This
,
prtStart
,
prtEnd
);
This
->
prop
.
dwSampleFlags
&=
~
(
AM_SAMPLE_TIMEVALID
|
AM_SAMPLE_STOPVALID
);
if
(
prtStart
!=
NULL
)
{
This
->
prop
.
dwSampleFlags
|=
AM_SAMPLE_TIMEVALID
;
This
->
prop
.
tStart
=
*
prtStart
;
}
if
(
prtEnd
!=
NULL
)
{
This
->
prop
.
dwSampleFlags
|=
AM_SAMPLE_STOPVALID
;
This
->
prop
.
tStop
=
*
prtEnd
;
}
return
NOERROR
;
}
static
HRESULT
WINAPI
IMediaSample2_fnIsSyncPoint
(
IMediaSample2
*
iface
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
return
(
This
->
prop
.
dwSampleFlags
&
AM_SAMPLE_SPLICEPOINT
)
?
S_OK
:
S_FALSE
;
}
static
HRESULT
WINAPI
IMediaSample2_fnSetSyncPoint
(
IMediaSample2
*
iface
,
BOOL
bSync
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
bSync
);
if
(
bSync
)
This
->
prop
.
dwSampleFlags
|=
AM_SAMPLE_SPLICEPOINT
;
else
This
->
prop
.
dwSampleFlags
&=
~
AM_SAMPLE_SPLICEPOINT
;
return
NOERROR
;
}
static
HRESULT
WINAPI
IMediaSample2_fnIsPreroll
(
IMediaSample2
*
iface
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
return
(
This
->
prop
.
dwSampleFlags
&
AM_SAMPLE_PREROLL
)
?
S_OK
:
S_FALSE
;
}
static
HRESULT
WINAPI
IMediaSample2_fnSetPreroll
(
IMediaSample2
*
iface
,
BOOL
bPreroll
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
bPreroll
);
if
(
bPreroll
)
This
->
prop
.
dwSampleFlags
|=
AM_SAMPLE_PREROLL
;
else
This
->
prop
.
dwSampleFlags
&=
~
AM_SAMPLE_PREROLL
;
return
NOERROR
;
}
static
long
WINAPI
IMediaSample2_fnGetActualDataLength
(
IMediaSample2
*
iface
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
return
This
->
prop
.
lActual
;
}
static
HRESULT
WINAPI
IMediaSample2_fnSetActualDataLength
(
IMediaSample2
*
iface
,
long
lLength
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%ld)
\n
"
,
This
,
lLength
);
if
(
This
->
prop
.
cbBuffer
>
lLength
)
return
E_INVALIDARG
;
This
->
prop
.
lActual
=
lLength
;
return
NOERROR
;
}
static
HRESULT
WINAPI
IMediaSample2_fnGetMediaType
(
IMediaSample2
*
iface
,
AM_MEDIA_TYPE
**
ppmt
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ppmt
);
if
(
ppmt
==
NULL
)
return
E_POINTER
;
if
(
!
(
This
->
prop
.
dwSampleFlags
&
AM_SAMPLE_TYPECHANGED
)
)
return
S_FALSE
;
/* FIXME - not implemented! */
FIXME
(
"(%p)->(%p) not implemented!
\n
"
,
This
,
ppmt
);
/* return CoTaskMemAlloc-ed memory. */
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IMediaSample2_fnSetMediaType
(
IMediaSample2
*
iface
,
AM_MEDIA_TYPE
*
pmt
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
FIXME
(
"(%p)->() stub!
\n
"
,
This
);
/* FIXME - not implemented! */
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IMediaSample2_fnIsDiscontinuity
(
IMediaSample2
*
iface
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
return
(
This
->
prop
.
dwSampleFlags
&
AM_SAMPLE_DATADISCONTINUITY
)
?
S_OK
:
S_FALSE
;
}
static
HRESULT
WINAPI
IMediaSample2_fnSetDiscontinuity
(
IMediaSample2
*
iface
,
BOOL
bDiscontinuity
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
bDiscontinuity
);
if
(
bDiscontinuity
)
This
->
prop
.
dwSampleFlags
|=
AM_SAMPLE_DATADISCONTINUITY
;
else
This
->
prop
.
dwSampleFlags
&=
~
AM_SAMPLE_DATADISCONTINUITY
;
return
NOERROR
;
}
static
HRESULT
WINAPI
IMediaSample2_fnGetMediaTime
(
IMediaSample2
*
iface
,
LONGLONG
*
pTimeStart
,
LONGLONG
*
pTimeEnd
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
FIXME
(
"(%p)->() stub!
\n
"
,
This
);
if
(
pTimeStart
==
NULL
||
pTimeEnd
==
NULL
)
return
E_POINTER
;
if
(
!
This
->
fMediaTimeIsValid
)
return
VFW_E_MEDIA_TIME_NOT_SET
;
*
pTimeStart
=
This
->
llMediaTimeStart
;
*
pTimeEnd
=
This
->
llMediaTimeEnd
;
return
NOERROR
;
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IMediaSample2_fnSetMediaTime
(
IMediaSample2
*
iface
,
LONGLONG
*
pTimeStart
,
LONGLONG
*
pTimeEnd
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
if
(
pTimeStart
==
NULL
||
pTimeEnd
==
NULL
)
{
This
->
fMediaTimeIsValid
=
FALSE
;
}
else
{
This
->
fMediaTimeIsValid
=
TRUE
;
This
->
llMediaTimeStart
=
*
pTimeStart
;
This
->
llMediaTimeEnd
=
*
pTimeEnd
;
}
return
NOERROR
;
}
static
HRESULT
WINAPI
IMediaSample2_fnGetProperties
(
IMediaSample2
*
iface
,
DWORD
cbProp
,
BYTE
*
pbProp
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
TRACE
(
"(%p)->(%lu,%p)
\n
"
,
This
,
cbProp
,
pbProp
);
if
(
cbProp
<
0
||
cbProp
>
sizeof
(
AM_SAMPLE2_PROPERTIES
)
)
return
E_FAIL
;
memcpy
(
pbProp
,
&
This
->
prop
,
cbProp
);
return
NOERROR
;
}
static
HRESULT
WINAPI
IMediaSample2_fnSetProperties
(
IMediaSample2
*
iface
,
DWORD
cbProp
,
const
BYTE
*
pbProp
)
{
ICOM_THIS
(
CMemMediaSample
,
iface
);
FIXME
(
"(%p)->() stub!
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
ICOM_VTABLE
(
IMediaSample2
)
imediasample2
=
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IMediaSample2_fnQueryInterface
,
IMediaSample2_fnAddRef
,
IMediaSample2_fnRelease
,
/* IMediaSample fields */
IMediaSample2_fnGetPointer
,
IMediaSample2_fnGetSize
,
IMediaSample2_fnGetTime
,
IMediaSample2_fnSetTime
,
IMediaSample2_fnIsSyncPoint
,
IMediaSample2_fnSetSyncPoint
,
IMediaSample2_fnIsPreroll
,
IMediaSample2_fnSetPreroll
,
IMediaSample2_fnGetActualDataLength
,
IMediaSample2_fnSetActualDataLength
,
IMediaSample2_fnGetMediaType
,
IMediaSample2_fnSetMediaType
,
IMediaSample2_fnIsDiscontinuity
,
IMediaSample2_fnSetDiscontinuity
,
IMediaSample2_fnGetMediaTime
,
IMediaSample2_fnSetMediaTime
,
/* IMediaSample2 fields */
IMediaSample2_fnGetProperties
,
IMediaSample2_fnSetProperties
,
};
HRESULT
QUARTZ_CreateMemMediaSample
(
BYTE
*
pbData
,
DWORD
dwDataLength
,
IMemAllocator
*
pOwner
,
CMemMediaSample
**
ppSample
)
{
CMemMediaSample
*
pms
;
TRACE
(
"(%p,%08lx,%p,%p)
\n
"
,
pbData
,
dwDataLength
,
pOwner
,
ppSample
);
pms
=
(
CMemMediaSample
*
)
QUARTZ_AllocObj
(
sizeof
(
CMemMediaSample
)
);
if
(
pms
==
NULL
)
return
E_OUTOFMEMORY
;
ICOM_VTBL
(
pms
)
=
&
imediasample2
;
pms
->
ref
=
1
;
pms
->
pOwner
=
pOwner
;
pms
->
fMediaTimeIsValid
=
FALSE
;
pms
->
llMediaTimeStart
=
0
;
pms
->
llMediaTimeEnd
=
0
;
ZeroMemory
(
&
(
pms
->
prop
),
sizeof
(
pms
->
prop
)
);
pms
->
prop
.
cbData
=
sizeof
(
pms
->
prop
);
pms
->
prop
.
dwTypeSpecificFlags
=
0
;
pms
->
prop
.
dwSampleFlags
=
0
;
pms
->
prop
.
pbBuffer
=
pbData
;
pms
->
prop
.
cbBuffer
=
(
LONG
)
dwDataLength
;
pms
->
prop
.
lActual
=
(
LONG
)
dwDataLength
;
*
ppSample
=
pms
;
return
S_OK
;
}
void
QUARTZ_DestroyMemMediaSample
(
CMemMediaSample
*
pSample
)
{
QUARTZ_FreeObj
(
pSample
);
}
dlls/quartz/sample.h
0 → 100644
View file @
e575ad29
#ifndef WINE_DSHOW_SAMPLE_H
#define WINE_DSHOW_SAMPLE_H
/*
implements CMemMediaSample.
- At least, the following interfaces should be implemented:
IUnknown - IMediaSample - IMediaSample2
*/
typedef
struct
CMemMediaSample
{
ICOM_VFIELD
(
IMediaSample2
);
/* IUnknown fields */
ULONG
ref
;
/* IMediaSample2 fields */
IMemAllocator
*
pOwner
;
/* not addref-ed. */
BOOL
fMediaTimeIsValid
;
LONGLONG
llMediaTimeStart
;
LONGLONG
llMediaTimeEnd
;
AM_SAMPLE2_PROPERTIES
prop
;
}
CMemMediaSample
;
HRESULT
QUARTZ_CreateMemMediaSample
(
BYTE
*
pbData
,
DWORD
dwDataLength
,
IMemAllocator
*
pOwner
,
CMemMediaSample
**
ppSample
);
void
QUARTZ_DestroyMemMediaSample
(
CMemMediaSample
*
pSample
);
#endif
/* WINE_DSHOW_SAMPLE_H */
dlls/quartz/seekpass.c
View file @
e575ad29
...
...
@@ -9,6 +9,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
...
...
dlls/quartz/sysclock.c
View file @
e575ad29
...
...
@@ -11,6 +11,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
...
...
include/Makefile.in
View file @
e575ad29
...
...
@@ -144,6 +144,7 @@ INSTALLED_INCLUDES = \
wine/obj_errorinfo.h
\
wine/obj_extracticon.h
\
wine/obj_inplace.h
\
wine/obj_ksproperty.h
\
wine/obj_marshal.h
\
wine/obj_misc.h
\
wine/obj_moniker.h
\
...
...
include/dsound.h
View file @
e575ad29
...
...
@@ -4,6 +4,7 @@
#include "winbase.h"
/* for CRITICAL_SECTION */
#include "mmsystem.h"
#include "d3dtypes.h"
#include "wine/obj_ksproperty.h"
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -35,9 +36,6 @@ typedef struct IDirectSoundCapture IDirectSoundCapture,*LPDIRECTSOUNDCAPTURE;
DEFINE_GUID
(
IID_IDirectSoundCaptureBuffer
,
0xB0210782
,
0x89CD
,
0x11D0
,
0xAF
,
0x08
,
0x00
,
0xA0
,
0xC9
,
0x25
,
0xCD
,
0x16
);
typedef
struct
IDirectSoundCaptureBuffer
IDirectSoundCaptureBuffer
,
*
LPDIRECTSOUNDCAPTUREBUFFER
;
DEFINE_GUID
(
IID_IKsPropertySet
,
0x31EFAC30
,
0x515C
,
0x11D0
,
0xA9
,
0xAA
,
0x00
,
0xAA
,
0x00
,
0x61
,
0xBE
,
0x93
);
typedef
struct
IKsPropertySet
IKsPropertySet
,
*
LPKSPROPERTYSET
;
#define _FACDS 0x878
#define MAKE_DSHRESULT(code) MAKE_HRESULT(1,_FACDS,code)
...
...
@@ -554,29 +552,6 @@ ICOM_DEFINE(IDirectSound3DBuffer,IUnknown)
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) ICOM_CALL4(SetVelocity,p,a,b,c,d)
/*****************************************************************************
* IKsPropertySet interface
*/
#define KSPROPERTY_SUPPORT_GET 1
#define KSPROPERTY_SUPPORT_SET 2
#define ICOM_INTERFACE IKsPropertySet
#define IKsPropertySet_METHODS \
ICOM_METHOD7(HRESULT,Get,REFGUID,rgid,ULONG,x1,LPVOID,p1,ULONG,x2,LPVOID,p2,ULONG,x3,ULONG*,px4);\
ICOM_METHOD6(HRESULT,Set,REFGUID,rgid,ULONG,x1,LPVOID,p1,ULONG,x2,LPVOID,p2,ULONG,x3);\
ICOM_METHOD3(HRESULT,QuerySupport,REFGUID,rgid,ULONG,x1,ULONG*,px2);
#define IKsPropertySet_IMETHODS \
IUnknown_IMETHODS \
IKsPropertySet_METHODS
ICOM_DEFINE
(
IKsPropertySet
,
IUnknown
)
#undef ICOM_INTERFACE
#define IKsPropertySet_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IKsPropertySet_AddRef(p) ICOM_CALL (AddRef,p)
#define IKsPropertySet_Release(p) ICOM_CALL (Release,p)
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) ICOM_CALL7(Get,p,a,b,c,d,e,f,g)
#define IKsPropertySet_Set(p,a,b,c,d,e,f) ICOM_CALL6(Set,p,a,b,c,d,e,f)
#define IKsPropertySet_QuerySupport(p,a,b,c) ICOM_CALL3(QuerySupport,p,a,b,c)
#ifdef __cplusplus
}
/* extern "C" */
...
...
include/strmif.h
View file @
e575ad29
This diff is collapsed.
Click to expand it.
include/wine/obj_ksproperty.h
0 → 100644
View file @
e575ad29
#ifndef WINE_WINE_OBJ_KSPROPERTY_H
#define WINE_WINE_OBJ_KSPROPERTY_H
/* NOTE: IKsPropertySet is declared in both dsound.h and strmif.h */
DEFINE_GUID
(
IID_IKsPropertySet
,
0x31EFAC30
,
0x515C
,
0x11D0
,
0xA9
,
0xAA
,
0x00
,
0xAA
,
0x00
,
0x61
,
0xBE
,
0x93
);
typedef
struct
IKsPropertySet
IKsPropertySet
,
*
LPKSPROPERTYSET
;
/*****************************************************************************
* IKsPropertySet interface
*/
#define KSPROPERTY_SUPPORT_GET 1
#define KSPROPERTY_SUPPORT_SET 2
#define ICOM_INTERFACE IKsPropertySet
#define IKsPropertySet_METHODS \
ICOM_METHOD7(HRESULT,Get,REFGUID,rgid,ULONG,x1,LPVOID,p1,ULONG,x2,LPVOID,p2,ULONG,x3,ULONG*,px4);\
ICOM_METHOD6(HRESULT,Set,REFGUID,rgid,ULONG,x1,LPVOID,p1,ULONG,x2,LPVOID,p2,ULONG,x3);\
ICOM_METHOD3(HRESULT,QuerySupport,REFGUID,rgid,ULONG,x1,ULONG*,px2);
#define IKsPropertySet_IMETHODS \
IUnknown_IMETHODS \
IKsPropertySet_METHODS
ICOM_DEFINE
(
IKsPropertySet
,
IUnknown
)
#undef ICOM_INTERFACE
#define IKsPropertySet_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IKsPropertySet_AddRef(p) ICOM_CALL (AddRef,p)
#define IKsPropertySet_Release(p) ICOM_CALL (Release,p)
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) ICOM_CALL7(Get,p,a,b,c,d,e,f,g)
#define IKsPropertySet_Set(p,a,b,c,d,e,f) ICOM_CALL6(Set,p,a,b,c,d,e,f)
#define IKsPropertySet_QuerySupport(p,a,b,c) ICOM_CALL3(QuerySupport,p,a,b,c)
/* The real windows header declares 'QuerySupport' in dsound.h */
/* but 'QuerySupported' in strmif.h ! */
#define IKsPropertySet_QuerySupported(p,a,b,c) ICOM_CALL3(QuerySupport,p,a,b,c)
#endif
/* WINE_WINE_OBJ_KSPROPERTY_H */
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