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
0410e50e
Commit
0410e50e
authored
Oct 05, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
Oct 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Move BasePin implementation to strmbase.
parent
bb110c77
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
353 additions
and
263 deletions
+353
-263
pin.c
dlls/qcap/pin.c
+1
-101
pin.h
dlls/qcap/pin.h
+1
-23
vfwcapture.c
dlls/qcap/vfwcapture.c
+11
-11
dsoundrender.c
dlls/quartz/dsoundrender.c
+12
-12
filesource.c
dlls/quartz/filesource.c
+16
-15
nullrenderer.c
dlls/quartz/nullrenderer.c
+10
-10
parser.c
dlls/quartz/parser.c
+21
-23
pin.c
dlls/quartz/pin.c
+0
-0
pin.h
dlls/quartz/pin.h
+10
-28
quartz_private.h
dlls/quartz/quartz_private.h
+0
-4
transform.c
dlls/quartz/transform.c
+26
-25
videorenderer.c
dlls/quartz/videorenderer.c
+10
-10
Makefile.in
dlls/strmbase/Makefile.in
+2
-1
pin.c
dlls/strmbase/pin.c
+207
-0
strmbase.h
include/wine/strmbase.h
+26
-0
No files found.
dlls/qcap/pin.c
View file @
0410e50e
...
...
@@ -30,13 +30,13 @@
#include "dshow.h"
#include "qcap_main.h"
#include "pin.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include <assert.h>
#include "pin.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
qcap
);
...
...
@@ -54,103 +54,6 @@ static void Copy_PinInfo(PIN_INFO * pDest, const PIN_INFO * pSrc)
pDest
->
pFilter
=
pSrc
->
pFilter
;
}
HRESULT
WINAPI
IPinImpl_ConnectedTo
(
IPin
*
iface
,
IPin
**
ppPin
)
{
HRESULT
hr
;
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
/* TRACE("(%p)\n", ppPin);*/
EnterCriticalSection
(
This
->
pCritSec
);
{
if
(
This
->
pConnectedTo
)
{
*
ppPin
=
This
->
pConnectedTo
;
IPin_AddRef
(
*
ppPin
);
hr
=
S_OK
;
}
else
hr
=
VFW_E_NOT_CONNECTED
;
}
LeaveCriticalSection
(
This
->
pCritSec
);
return
hr
;
}
HRESULT
WINAPI
IPinImpl_ConnectionMediaType
(
IPin
*
iface
,
AM_MEDIA_TYPE
*
pmt
)
{
HRESULT
hr
;
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pmt
);
EnterCriticalSection
(
This
->
pCritSec
);
{
if
(
This
->
pConnectedTo
)
{
CopyMediaType
(
pmt
,
&
This
->
mtCurrent
);
hr
=
S_OK
;
}
else
{
ZeroMemory
(
pmt
,
sizeof
(
*
pmt
));
hr
=
VFW_E_NOT_CONNECTED
;
}
}
LeaveCriticalSection
(
This
->
pCritSec
);
return
hr
;
}
HRESULT
WINAPI
IPinImpl_QueryPinInfo
(
IPin
*
iface
,
PIN_INFO
*
pInfo
)
{
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pInfo
);
Copy_PinInfo
(
pInfo
,
&
This
->
pinInfo
);
IBaseFilter_AddRef
(
pInfo
->
pFilter
);
return
S_OK
;
}
HRESULT
WINAPI
IPinImpl_QueryDirection
(
IPin
*
iface
,
PIN_DIRECTION
*
pPinDir
)
{
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pPinDir
);
*
pPinDir
=
This
->
pinInfo
.
dir
;
return
S_OK
;
}
HRESULT
WINAPI
IPinImpl_QueryId
(
IPin
*
iface
,
LPWSTR
*
Id
)
{
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
Id
);
*
Id
=
CoTaskMemAlloc
((
strlenW
(
This
->
pinInfo
.
achName
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!*
Id
)
return
E_OUTOFMEMORY
;
strcpyW
(
*
Id
,
This
->
pinInfo
.
achName
);
return
S_OK
;
}
HRESULT
WINAPI
IPinImpl_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
{
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pmt
);
if
(
!
This
->
fnQueryAccept
)
return
S_OK
;
return
(
This
->
fnQueryAccept
(
This
->
pUserData
,
pmt
)
==
S_OK
?
S_OK
:
S_FALSE
);
}
/* Function called as a helper to IPin_Connect */
/* specific AM_MEDIA_TYPE - it cannot be NULL */
/* NOTE: not part of standard interface */
...
...
@@ -215,7 +118,6 @@ static HRESULT OutputPin_ConnectSpecific(IPin * iface, IPin * pReceivePin, const
}
HRESULT
OutputPin_Init
(
const
PIN_INFO
*
pPinInfo
,
const
ALLOCATOR_PROPERTIES
*
props
,
LPVOID
pUserData
,
QUERYACCEPTPROC
pQueryAccept
,
LPCRITICAL_SECTION
pCritSec
,
OutputPin
*
pPinImpl
)
{
TRACE
(
"
\n
"
);
...
...
@@ -223,8 +125,6 @@ HRESULT OutputPin_Init(const PIN_INFO * pPinInfo, const ALLOCATOR_PROPERTIES * p
/* Common attributes */
pPinImpl
->
pin
.
refCount
=
1
;
pPinImpl
->
pin
.
pConnectedTo
=
NULL
;
pPinImpl
->
pin
.
fnQueryAccept
=
pQueryAccept
;
pPinImpl
->
pin
.
pUserData
=
pUserData
;
pPinImpl
->
pin
.
pCritSec
=
pCritSec
;
Copy_PinInfo
(
&
pPinImpl
->
pin
.
pinInfo
,
pPinInfo
);
...
...
dlls/qcap/pin.h
View file @
0410e50e
...
...
@@ -35,22 +35,10 @@ typedef HRESULT (* QUERYACCEPTPROC)(LPVOID userdata, const AM_MEDIA_TYPE * pmt);
*/
typedef
HRESULT
(
*
PRECONNECTPROC
)(
IPin
*
iface
,
IPin
*
pConnectPin
);
typedef
struct
IPinImpl
{
const
struct
IPinVtbl
*
lpVtbl
;
LONG
refCount
;
LPCRITICAL_SECTION
pCritSec
;
PIN_INFO
pinInfo
;
IPin
*
pConnectedTo
;
AM_MEDIA_TYPE
mtCurrent
;
QUERYACCEPTPROC
fnQueryAccept
;
LPVOID
pUserData
;
}
IPinImpl
;
typedef
struct
OutputPin
{
/* inheritance C style! */
IPinImpl
pin
;
BasePin
pin
;
IMemInputPin
*
pMemInputPin
;
HRESULT
(
*
pConnectSpecific
)(
IPin
*
iface
,
IPin
*
pReceiver
,
const
AM_MEDIA_TYPE
*
pmt
);
...
...
@@ -59,18 +47,8 @@ typedef struct OutputPin
/*** Initializers ***/
HRESULT
OutputPin_Init
(
const
PIN_INFO
*
pPinInfo
,
const
ALLOCATOR_PROPERTIES
*
props
,
LPVOID
pUserData
,
QUERYACCEPTPROC
pQueryAccept
,
LPCRITICAL_SECTION
pCritSec
,
OutputPin
*
pPinImpl
);
/* Common */
HRESULT
WINAPI
IPinImpl_ConnectedTo
(
IPin
*
iface
,
IPin
**
ppPin
);
HRESULT
WINAPI
IPinImpl_ConnectionMediaType
(
IPin
*
iface
,
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
IPinImpl_QueryPinInfo
(
IPin
*
iface
,
PIN_INFO
*
pInfo
);
HRESULT
WINAPI
IPinImpl_QueryDirection
(
IPin
*
iface
,
PIN_DIRECTION
*
pPinDir
);
HRESULT
WINAPI
IPinImpl_QueryId
(
IPin
*
iface
,
LPWSTR
*
Id
);
HRESULT
WINAPI
IPinImpl_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
IPinImpl_EnumMediaTypes
(
IPin
*
iface
,
IEnumMediaTypes
**
ppEnum
);
/* Output Pin */
HRESULT
WINAPI
OutputPin_Connect
(
IPin
*
iface
,
IPin
*
pReceivePin
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
OutputPin_Disconnect
(
IPin
*
iface
);
...
...
dlls/qcap/vfwcapture.c
View file @
0410e50e
...
...
@@ -193,7 +193,7 @@ static ULONG WINAPI VfwCapture_Release(IBaseFilter * iface)
if
(
!
refCount
)
{
IPinImpl
*
pin
;
BasePin
*
pin
;
TRACE
(
"destroying everything
\n
"
);
if
(
This
->
init
)
...
...
@@ -202,7 +202,7 @@ static ULONG WINAPI VfwCapture_Release(IBaseFilter * iface)
qcap_driver_stop
(
This
->
driver_info
,
&
This
->
state
);
qcap_driver_destroy
(
This
->
driver_info
);
}
pin
=
(
IPinImpl
*
)
This
->
pOutputPin
;
pin
=
(
BasePin
*
)
This
->
pOutputPin
;
if
(
pin
->
pConnectedTo
!=
NULL
)
{
IPin_Disconnect
(
pin
->
pConnectedTo
);
...
...
@@ -414,7 +414,7 @@ AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt)
{
HRESULT
hr
;
ICOM_THIS_MULTI
(
VfwCapture
,
IAMStreamConfig_vtbl
,
iface
);
IPinImpl
*
pin
;
BasePin
*
pin
;
TRACE
(
"(%p): %p->%p
\n
"
,
iface
,
pmt
,
pmt
?
pmt
->
pbFormat
:
NULL
);
...
...
@@ -432,7 +432,7 @@ AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt)
dump_AM_MEDIA_TYPE
(
pmt
);
pin
=
(
IPinImpl
*
)
This
->
pOutputPin
;
pin
=
(
BasePin
*
)
This
->
pOutputPin
;
if
(
pin
->
pConnectedTo
!=
NULL
)
{
hr
=
IPin_QueryAccept
(
pin
->
pConnectedTo
,
pmt
);
...
...
@@ -806,7 +806,7 @@ VfwPin_Construct( IBaseFilter * pBaseFilter, LPCRITICAL_SECTION pCritSec,
lstrcpyW
(
piOutput
.
achName
,
wszOutputPinName
);
ObjectRefCount
(
TRUE
);
hr
=
OutputPin_Init
(
&
piOutput
,
&
ap
,
p
BaseFilter
,
NULL
,
p
CritSec
,
&
pPinImpl
->
pin
);
hr
=
OutputPin_Init
(
&
piOutput
,
&
ap
,
pCritSec
,
&
pPinImpl
->
pin
);
if
(
SUCCEEDED
(
hr
))
{
pPinImpl
->
KSP_VT
=
&
KSP_VTable
;
...
...
@@ -927,12 +927,12 @@ static const IPinVtbl VfwPin_Vtbl =
OutputPin_Connect
,
OutputPin_ReceiveConnection
,
OutputPin_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
I
PinImpl_QueryAccept
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
Base
PinImpl_QueryAccept
,
VfwPin_EnumMediaTypes
,
VfwPin_QueryInternalConnections
,
VfwPin_EndOfStream
,
...
...
dlls/quartz/dsoundrender.c
View file @
0410e50e
...
...
@@ -825,7 +825,7 @@ static HRESULT WINAPI DSoundRender_InputPin_ReceiveConnection(IPin * iface, IPin
if
(
This
->
pin
.
pConnectedTo
)
hr
=
VFW_E_ALREADY_CONNECTED
;
if
(
SUCCEEDED
(
hr
)
&&
This
->
pin
.
fnQueryAccept
(
This
->
pin
.
pUserData
,
pmt
)
!=
S_OK
)
if
(
SUCCEEDED
(
hr
)
&&
This
->
fnQueryAccept
(
This
->
pUserData
,
pmt
)
!=
S_OK
)
hr
=
VFW_E_TYPE_NOT_ACCEPTED
;
if
(
SUCCEEDED
(
hr
))
...
...
@@ -899,7 +899,7 @@ static HRESULT WINAPI DSoundRender_InputPin_ReceiveConnection(IPin * iface, IPin
static
HRESULT
WINAPI
DSoundRender_InputPin_Disconnect
(
IPin
*
iface
)
{
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
BasePin
*
This
=
(
BasePin
*
)
iface
;
DSoundRenderImpl
*
DSImpl
;
TRACE
(
"(%p)->()
\n
"
,
iface
);
...
...
@@ -909,7 +909,7 @@ static HRESULT WINAPI DSoundRender_InputPin_Disconnect(IPin * iface)
IDirectSoundBuffer_Release
(
DSImpl
->
dsbuffer
);
DSImpl
->
dsbuffer
=
NULL
;
return
I
PinImpl_Disconnect
(
iface
);
return
Base
PinImpl_Disconnect
(
iface
);
}
static
HRESULT
WINAPI
DSoundRender_InputPin_EndOfStream
(
IPin
*
iface
)
...
...
@@ -1012,19 +1012,19 @@ static HRESULT WINAPI DSoundRender_InputPin_EndFlush(IPin * iface)
static
const
IPinVtbl
DSoundRender_InputPin_Vtbl
=
{
InputPin_QueryInterface
,
I
PinImpl_AddRef
,
Base
PinImpl_AddRef
,
InputPin_Release
,
InputPin_Connect
,
DSoundRender_InputPin_ReceiveConnection
,
DSoundRender_InputPin_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
I
PinImpl
_QueryAccept
,
I
PinImpl_EnumMediaTypes
,
I
PinImpl_QueryInternalConnections
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
I
nputPin
_QueryAccept
,
Base
PinImpl_EnumMediaTypes
,
Base
PinImpl_QueryInternalConnections
,
DSoundRender_InputPin_EndOfStream
,
DSoundRender_InputPin_BeginFlush
,
DSoundRender_InputPin_EndFlush
,
...
...
dlls/quartz/filesource.c
View file @
0410e50e
...
...
@@ -794,17 +794,18 @@ static inline FileAsyncReader *impl_from_IAsyncReader( IAsyncReader *iface )
return
(
FileAsyncReader
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
FileAsyncReader
,
lpVtblAR
));
}
static
HRESULT
AcceptProcAFR
(
LPVOID
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
static
HRESULT
WINAPI
FileAsyncReaderPin_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
{
AsyncReader
*
This
=
iface
;
FileAsyncReader
*
This
=
(
FileAsyncReader
*
)
iface
;
AM_MEDIA_TYPE
*
pmt_filter
=
((
AsyncReader
*
)
This
->
pin
.
pin
.
pinInfo
.
pFilter
)
->
pmt
;
FIXME
(
"(%p, %p)
\n
"
,
iface
,
pmt
);
if
(
IsEqualGUID
(
&
pmt
->
majortype
,
&
This
->
pmt
->
majortype
)
&&
IsEqualGUID
(
&
pmt
->
subtype
,
&
This
->
pmt
->
subtype
)
&&
if
(
IsEqualGUID
(
&
pmt
->
majortype
,
&
pmt_filter
->
majortype
)
&&
IsEqualGUID
(
&
pmt
->
subtype
,
&
pmt_filter
->
subtype
)
&&
IsEqualGUID
(
&
pmt
->
formattype
,
&
FORMAT_None
))
return
S_OK
;
return
S_FALSE
;
}
...
...
@@ -883,19 +884,19 @@ static HRESULT WINAPI FileAsyncReaderPin_EnumMediaTypes(IPin * iface, IEnumMedia
static
const
IPinVtbl
FileAsyncReaderPin_Vtbl
=
{
FileAsyncReaderPin_QueryInterface
,
I
PinImpl_AddRef
,
Base
PinImpl_AddRef
,
FileAsyncReaderPin_Release
,
OutputPin_Connect
,
OutputPin_ReceiveConnection
,
I
PinImpl_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
IPinImpl
_QueryAccept
,
Base
PinImpl_Disconnect
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
FileAsyncReaderPin
_QueryAccept
,
FileAsyncReaderPin_EnumMediaTypes
,
I
PinImpl_QueryInternalConnections
,
Base
PinImpl_QueryInternalConnections
,
OutputPin_EndOfStream
,
OutputPin_BeginFlush
,
OutputPin_EndFlush
,
...
...
@@ -942,7 +943,7 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter
piOutput
.
dir
=
PINDIR_OUTPUT
;
piOutput
.
pFilter
=
pBaseFilter
;
strcpyW
(
piOutput
.
achName
,
wszOutputPinName
);
hr
=
OutputPin_Construct
(
&
FileAsyncReaderPin_Vtbl
,
sizeof
(
FileAsyncReader
),
&
piOutput
,
NULL
,
p
BaseFilter
,
AcceptProcAFR
,
p
CritSec
,
ppPin
);
hr
=
OutputPin_Construct
(
&
FileAsyncReaderPin_Vtbl
,
sizeof
(
FileAsyncReader
),
&
piOutput
,
NULL
,
pCritSec
,
ppPin
);
if
(
SUCCEEDED
(
hr
))
{
...
...
dlls/quartz/nullrenderer.c
View file @
0410e50e
...
...
@@ -553,19 +553,19 @@ static HRESULT WINAPI NullRenderer_InputPin_EndFlush(IPin * iface)
static
const
IPinVtbl
NullRenderer_InputPin_Vtbl
=
{
InputPin_QueryInterface
,
I
PinImpl_AddRef
,
Base
PinImpl_AddRef
,
InputPin_Release
,
InputPin_Connect
,
InputPin_ReceiveConnection
,
I
PinImpl_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
I
PinImpl
_QueryAccept
,
I
PinImpl_EnumMediaTypes
,
I
PinImpl_QueryInternalConnections
,
Base
PinImpl_Disconnect
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
I
nputPin
_QueryAccept
,
Base
PinImpl_EnumMediaTypes
,
Base
PinImpl_QueryInternalConnections
,
NullRenderer_InputPin_EndOfStream
,
InputPin_BeginFlush
,
NullRenderer_InputPin_EndFlush
,
...
...
dlls/quartz/parser.c
View file @
0410e50e
...
...
@@ -41,7 +41,6 @@ static const IMediaSeekingVtbl Parser_Seeking_Vtbl;
static
const
IPinVtbl
Parser_OutputPin_Vtbl
;
static
const
IPinVtbl
Parser_InputPin_Vtbl
;
static
HRESULT
Parser_OutputPin_QueryAccept
(
LPVOID
iface
,
const
AM_MEDIA_TYPE
*
pmt
);
static
HRESULT
Parser_ChangeCurrent
(
IBaseFilter
*
iface
);
static
HRESULT
Parser_ChangeStop
(
IBaseFilter
*
iface
);
static
HRESULT
Parser_ChangeRate
(
IBaseFilter
*
iface
);
...
...
@@ -492,7 +491,7 @@ HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PR
This
->
ppPins
=
CoTaskMemAlloc
((
This
->
cStreams
+
2
)
*
sizeof
(
IPin
*
));
memcpy
(
This
->
ppPins
,
ppOldPins
,
(
This
->
cStreams
+
1
)
*
sizeof
(
IPin
*
));
hr
=
OutputPin_Construct
(
&
Parser_OutputPin_Vtbl
,
sizeof
(
Parser_OutputPin
),
piOutput
,
props
,
NULL
,
Parser_OutputPin_QueryAccept
,
&
This
->
csFilter
,
This
->
ppPins
+
(
This
->
cStreams
+
1
));
hr
=
OutputPin_Construct
(
&
Parser_OutputPin_Vtbl
,
sizeof
(
Parser_OutputPin
),
piOutput
,
props
,
&
This
->
csFilter
,
This
->
ppPins
+
(
This
->
cStreams
+
1
));
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -502,7 +501,6 @@ HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PR
CopyMediaType
(
pin
->
pmt
,
amt
);
pin
->
dwSamplesProcessed
=
0
;
pin
->
pin
.
pin
.
pUserData
=
This
->
ppPins
[
This
->
cStreams
+
1
];
pin
->
pin
.
pin
.
pinInfo
.
pFilter
=
(
LPVOID
)
This
;
pin
->
pin
.
custom_allocator
=
1
;
This
->
cStreams
++
;
...
...
@@ -689,9 +687,9 @@ static HRESULT WINAPI Parser_OutputPin_Connect(IPin * iface, IPin * pReceivePin,
return
OutputPin_Connect
(
iface
,
pReceivePin
,
pmt
);
}
static
HRESULT
Parser_OutputPin_QueryAccept
(
LPVOID
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
static
HRESULT
WINAPI
Parser_OutputPin_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
{
Parser_OutputPin
*
This
=
iface
;
Parser_OutputPin
*
This
=
(
Parser_OutputPin
*
)
iface
;
TRACE
(
"()
\n
"
);
dump_AM_MEDIA_TYPE
(
pmt
);
...
...
@@ -702,19 +700,19 @@ static HRESULT Parser_OutputPin_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE *
static
const
IPinVtbl
Parser_OutputPin_Vtbl
=
{
Parser_OutputPin_QueryInterface
,
I
PinImpl_AddRef
,
Base
PinImpl_AddRef
,
Parser_OutputPin_Release
,
Parser_OutputPin_Connect
,
OutputPin_ReceiveConnection
,
OutputPin_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
IPinImpl
_QueryAccept
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
Parser_OutputPin
_QueryAccept
,
Parser_OutputPin_EnumMediaTypes
,
I
PinImpl_QueryInternalConnections
,
Base
PinImpl_QueryInternalConnections
,
OutputPin_EndOfStream
,
OutputPin_BeginFlush
,
OutputPin_EndFlush
,
...
...
@@ -768,7 +766,7 @@ static HRESULT WINAPI Parser_PullPin_ReceiveConnection(IPin * iface, IPin * pRec
hr
=
PullPin_ReceiveConnection
(
iface
,
pReceivePin
,
pmt
);
if
(
FAILED
(
hr
))
{
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
BasePin
*
This
=
(
BasePin
*
)
iface
;
EnterCriticalSection
(
This
->
pCritSec
);
Parser_RemoveOutputPins
((
ParserImpl
*
)
This
->
pinInfo
.
pFilter
);
...
...
@@ -781,19 +779,19 @@ static HRESULT WINAPI Parser_PullPin_ReceiveConnection(IPin * iface, IPin * pRec
static
const
IPinVtbl
Parser_InputPin_Vtbl
=
{
PullPin_QueryInterface
,
I
PinImpl_AddRef
,
Base
PinImpl_AddRef
,
PullPin_Release
,
InputPin_Connect
,
Parser_PullPin_ReceiveConnection
,
Parser_PullPin_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
IPinImpl
_QueryAccept
,
I
PinImpl_EnumMediaTypes
,
I
PinImpl_QueryInternalConnections
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
PullPin
_QueryAccept
,
Base
PinImpl_EnumMediaTypes
,
Base
PinImpl_QueryInternalConnections
,
PullPin_EndOfStream
,
PullPin_BeginFlush
,
PullPin_EndFlush
,
...
...
dlls/quartz/pin.c
View file @
0410e50e
This diff is collapsed.
Click to expand it.
dlls/quartz/pin.h
View file @
0410e50e
...
...
@@ -66,25 +66,15 @@ typedef HRESULT (* STOPPROCESSPROC) (LPVOID userdata);
#define ALIGNDOWN(value,boundary) ((value)/(boundary)*(boundary))
#define ALIGNUP(value,boundary) (ALIGNDOWN((value)+(boundary)-1, (boundary)))
typedef
struct
IPinImpl
{
const
struct
IPinVtbl
*
lpVtbl
;
LONG
refCount
;
LPCRITICAL_SECTION
pCritSec
;
PIN_INFO
pinInfo
;
IPin
*
pConnectedTo
;
AM_MEDIA_TYPE
mtCurrent
;
QUERYACCEPTPROC
fnQueryAccept
;
LPVOID
pUserData
;
}
IPinImpl
;
typedef
struct
InputPin
{
/* inheritance C style! */
IPinImpl
pin
;
BasePin
pin
;
LPVOID
pUserData
;
const
IMemInputPinVtbl
*
lpVtblMemInput
;
IMemAllocator
*
pAllocator
;
QUERYACCEPTPROC
fnQueryAccept
;
SAMPLEPROC_PUSH
fnSampleProc
;
CLEANUPPROC
fnCleanProc
;
REFERENCE_TIME
tStart
;
...
...
@@ -97,7 +87,7 @@ typedef struct InputPin
typedef
struct
OutputPin
{
/* inheritance C style! */
IPinImpl
pin
;
BasePin
pin
;
IMemInputPin
*
pMemInputPin
;
HRESULT
(
*
pConnectSpecific
)(
IPin
*
iface
,
IPin
*
pReceiver
,
const
AM_MEDIA_TYPE
*
pmt
);
...
...
@@ -110,11 +100,13 @@ typedef struct OutputPin
typedef
struct
PullPin
{
/* inheritance C style! */
IPinImpl
pin
;
BasePin
pin
;
LPVOID
pUserData
;
REFERENCE_TIME
rtStart
,
rtCurrent
,
rtNext
,
rtStop
;
IAsyncReader
*
pReader
;
IMemAllocator
*
pAlloc
;
QUERYACCEPTPROC
fnQueryAccept
;
SAMPLEPROC_PULL
fnSampleProc
;
PRECONNECTPROC
fnPreConnect
;
REQUESTPROC
fnCustomRequest
;
...
...
@@ -142,29 +134,18 @@ typedef struct PullPin
/*** Constructors ***/
HRESULT
InputPin_Construct
(
const
IPinVtbl
*
InputPin_Vtbl
,
const
PIN_INFO
*
pPinInfo
,
SAMPLEPROC_PUSH
pSampleProc
,
LPVOID
pUserData
,
QUERYACCEPTPROC
pQueryAccept
,
CLEANUPPROC
pCleanUp
,
LPCRITICAL_SECTION
pCritSec
,
IMemAllocator
*
,
IPin
**
ppPin
);
HRESULT
OutputPin_Construct
(
const
IPinVtbl
*
OutputPin_Vtbl
,
LONG
outputpin_size
,
const
PIN_INFO
*
pPinInfo
,
ALLOCATOR_PROPERTIES
*
props
,
LP
VOID
pUserData
,
QUERYACCEPTPROC
pQueryAccept
,
LP
CRITICAL_SECTION
pCritSec
,
IPin
**
ppPin
);
HRESULT
OutputPin_Construct
(
const
IPinVtbl
*
OutputPin_Vtbl
,
LONG
outputpin_size
,
const
PIN_INFO
*
pPinInfo
,
ALLOCATOR_PROPERTIES
*
props
,
LPCRITICAL_SECTION
pCritSec
,
IPin
**
ppPin
);
HRESULT
PullPin_Construct
(
const
IPinVtbl
*
PullPin_Vtbl
,
const
PIN_INFO
*
pPinInfo
,
SAMPLEPROC_PULL
pSampleProc
,
LPVOID
pUserData
,
QUERYACCEPTPROC
pQueryAccept
,
CLEANUPPROC
pCleanUp
,
STOPPROCESSPROC
,
REQUESTPROC
pCustomRequest
,
LPCRITICAL_SECTION
pCritSec
,
IPin
**
ppPin
);
/**************************/
/*** Pin Implementation ***/
/* Common */
ULONG
WINAPI
IPinImpl_AddRef
(
IPin
*
iface
);
HRESULT
WINAPI
IPinImpl_Disconnect
(
IPin
*
iface
);
HRESULT
WINAPI
IPinImpl_ConnectedTo
(
IPin
*
iface
,
IPin
**
ppPin
);
HRESULT
WINAPI
IPinImpl_ConnectionMediaType
(
IPin
*
iface
,
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
IPinImpl_QueryPinInfo
(
IPin
*
iface
,
PIN_INFO
*
pInfo
);
HRESULT
WINAPI
IPinImpl_QueryDirection
(
IPin
*
iface
,
PIN_DIRECTION
*
pPinDir
);
HRESULT
WINAPI
IPinImpl_QueryId
(
IPin
*
iface
,
LPWSTR
*
Id
);
HRESULT
WINAPI
IPinImpl_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
IPinImpl_EnumMediaTypes
(
IPin
*
iface
,
IEnumMediaTypes
**
ppEnum
);
HRESULT
WINAPI
IPinImpl_QueryInternalConnections
(
IPin
*
iface
,
IPin
**
apPin
,
ULONG
*
cPin
);
/* Input Pin */
HRESULT
WINAPI
InputPin_QueryInterface
(
IPin
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
);
ULONG
WINAPI
InputPin_Release
(
IPin
*
iface
);
HRESULT
WINAPI
InputPin_Connect
(
IPin
*
iface
,
IPin
*
pConnector
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
InputPin_ReceiveConnection
(
IPin
*
iface
,
IPin
*
pReceivePin
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
InputPin_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
InputPin_EndOfStream
(
IPin
*
iface
);
HRESULT
WINAPI
InputPin_BeginFlush
(
IPin
*
iface
);
HRESULT
WINAPI
InputPin_EndFlush
(
IPin
*
iface
);
...
...
@@ -193,6 +174,7 @@ HRESULT WINAPI PullPin_Disconnect(IPin * iface);
HRESULT
WINAPI
PullPin_QueryInterface
(
IPin
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
);
ULONG
WINAPI
PullPin_Release
(
IPin
*
iface
);
HRESULT
WINAPI
PullPin_EndOfStream
(
IPin
*
iface
);
HRESULT
WINAPI
PullPin_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
PullPin_BeginFlush
(
IPin
*
iface
);
HRESULT
WINAPI
PullPin_EndFlush
(
IPin
*
iface
);
HRESULT
WINAPI
PullPin_NewSegment
(
IPin
*
iface
,
REFERENCE_TIME
tStart
,
REFERENCE_TIME
tStop
,
double
dRate
);
...
...
dlls/quartz/quartz_private.h
View file @
0410e50e
...
...
@@ -84,8 +84,4 @@ typedef struct StdMediaSample2
LONGLONG
tMediaEnd
;
}
StdMediaSample2
;
HRESULT
WINAPI
BasePinImpl_GetMediaType
(
IPin
*
iface
,
int
iPosition
,
AM_MEDIA_TYPE
*
pmt
);
LONG
WINAPI
BasePinImpl_GetMediaTypeVersion
(
IPin
*
iface
);
#endif
/* __QUARTZ_PRIVATE_INCLUDED__ */
dlls/quartz/transform.c
View file @
0410e50e
...
...
@@ -49,7 +49,7 @@ static const IPinVtbl TransformFilter_OutputPin_Vtbl;
static
HRESULT
TransformFilter_Input_QueryAccept
(
LPVOID
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
{
TransformFilterImpl
*
This
=
(
TransformFilterImpl
*
)((
IPinImpl
*
)
iface
)
->
pinInfo
.
pFilter
;
TransformFilterImpl
*
This
=
(
TransformFilterImpl
*
)((
BasePin
*
)
iface
)
->
pinInfo
.
pFilter
;
TRACE
(
"%p
\n
"
,
iface
);
dump_AM_MEDIA_TYPE
(
pmt
);
...
...
@@ -61,9 +61,10 @@ static HRESULT TransformFilter_Input_QueryAccept(LPVOID iface, const AM_MEDIA_TY
}
static
HRESULT
TransformFilter_Output_QueryAccept
(
LPVOID
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
static
HRESULT
WINAPI
TransformFilter_Output_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
{
TransformFilterImpl
*
pTransformFilter
=
iface
;
BasePin
*
This
=
(
BasePin
*
)
iface
;
TransformFilterImpl
*
pTransformFilter
=
(
TransformFilterImpl
*
)
This
->
pinInfo
.
pFilter
;
AM_MEDIA_TYPE
*
outpmt
=
&
pTransformFilter
->
pmt
;
TRACE
(
"%p
\n
"
,
iface
);
...
...
@@ -114,9 +115,9 @@ HRESULT TransformFilter_Create(TransformFilterImpl* pTransformFilter, const CLSI
props
.
cbBuffer
=
0
;
/* Will be updated at connection time */
props
.
cBuffers
=
1
;
((
InputPin
*
)
pTransformFilter
->
ppPins
[
0
])
->
p
in
.
p
UserData
=
pTransformFilter
->
ppPins
[
0
];
((
InputPin
*
)
pTransformFilter
->
ppPins
[
0
])
->
pUserData
=
pTransformFilter
->
ppPins
[
0
];
hr
=
OutputPin_Construct
(
&
TransformFilter_OutputPin_Vtbl
,
sizeof
(
OutputPin
),
&
piOutput
,
&
props
,
pTransformFilter
,
TransformFilter_Output_QueryAccept
,
&
pTransformFilter
->
csFilter
,
&
pTransformFilter
->
ppPins
[
1
]);
hr
=
OutputPin_Construct
(
&
TransformFilter_OutputPin_Vtbl
,
sizeof
(
OutputPin
),
&
piOutput
,
&
props
,
&
pTransformFilter
->
csFilter
,
&
pTransformFilter
->
ppPins
[
1
]);
if
(
FAILED
(
hr
))
ERR
(
"Cannot create output pin (%x)
\n
"
,
hr
);
...
...
@@ -521,7 +522,7 @@ static HRESULT WINAPI TransformFilter_InputPin_Disconnect(IPin * iface)
pTransform
=
(
TransformFilterImpl
*
)
This
->
pin
.
pinInfo
.
pFilter
;
pTransform
->
pFuncsTable
->
pfnCleanup
(
This
);
return
I
PinImpl_Disconnect
(
iface
);
return
Base
PinImpl_Disconnect
(
iface
);
}
static
HRESULT
WINAPI
TransformFilter_InputPin_BeginFlush
(
IPin
*
iface
)
...
...
@@ -581,19 +582,19 @@ static HRESULT WINAPI TransformFilter_InputPin_NewSegment(IPin * iface, REFERENC
static
const
IPinVtbl
TransformFilter_InputPin_Vtbl
=
{
InputPin_QueryInterface
,
I
PinImpl_AddRef
,
Base
PinImpl_AddRef
,
InputPin_Release
,
InputPin_Connect
,
TransformFilter_InputPin_ReceiveConnection
,
TransformFilter_InputPin_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
I
PinImpl
_QueryAccept
,
I
PinImpl_EnumMediaTypes
,
I
PinImpl_QueryInternalConnections
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
I
nputPin
_QueryAccept
,
Base
PinImpl_EnumMediaTypes
,
Base
PinImpl_QueryInternalConnections
,
TransformFilter_InputPin_EndOfStream
,
TransformFilter_InputPin_BeginFlush
,
TransformFilter_InputPin_EndFlush
,
...
...
@@ -602,7 +603,7 @@ static const IPinVtbl TransformFilter_InputPin_Vtbl =
static
HRESULT
WINAPI
TransformFilter_Output_GetMediaType
(
IPin
*
iface
,
int
iPosition
,
AM_MEDIA_TYPE
*
pmt
)
{
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
BasePin
*
This
=
(
BasePin
*
)
iface
;
TransformFilterImpl
*
pTransform
=
(
TransformFilterImpl
*
)
This
->
pinInfo
.
pFilter
;
if
(
iPosition
<
0
)
...
...
@@ -615,7 +616,7 @@ static HRESULT WINAPI TransformFilter_Output_GetMediaType(IPin *iface, int iPosi
static
HRESULT
WINAPI
TransformFilter_Output_EnumMediaTypes
(
IPin
*
iface
,
IEnumMediaTypes
**
ppEnum
)
{
IPinImpl
*
This
=
(
IPinImpl
*
)
iface
;
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
ppEnum
);
return
EnumMediaTypes_Construct
(
iface
,
TransformFilter_Output_GetMediaType
,
BasePinImpl_GetMediaTypeVersion
,
ppEnum
);
...
...
@@ -624,19 +625,19 @@ static HRESULT WINAPI TransformFilter_Output_EnumMediaTypes(IPin * iface, IEnumM
static
const
IPinVtbl
TransformFilter_OutputPin_Vtbl
=
{
OutputPin_QueryInterface
,
I
PinImpl_AddRef
,
Base
PinImpl_AddRef
,
OutputPin_Release
,
OutputPin_Connect
,
OutputPin_ReceiveConnection
,
OutputPin_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
IPinImpl
_QueryAccept
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
TransformFilter_Output
_QueryAccept
,
TransformFilter_Output_EnumMediaTypes
,
I
PinImpl_QueryInternalConnections
,
Base
PinImpl_QueryInternalConnections
,
OutputPin_EndOfStream
,
OutputPin_BeginFlush
,
OutputPin_EndFlush
,
...
...
dlls/quartz/videorenderer.c
View file @
0410e50e
...
...
@@ -1069,19 +1069,19 @@ static HRESULT WINAPI VideoRenderer_InputPin_EndFlush(IPin * iface)
static
const
IPinVtbl
VideoRenderer_InputPin_Vtbl
=
{
InputPin_QueryInterface
,
I
PinImpl_AddRef
,
Base
PinImpl_AddRef
,
InputPin_Release
,
InputPin_Connect
,
InputPin_ReceiveConnection
,
I
PinImpl_Disconnect
,
I
PinImpl_ConnectedTo
,
I
PinImpl_ConnectionMediaType
,
I
PinImpl_QueryPinInfo
,
I
PinImpl_QueryDirection
,
I
PinImpl_QueryId
,
I
PinImpl
_QueryAccept
,
I
PinImpl_EnumMediaTypes
,
I
PinImpl_QueryInternalConnections
,
Base
PinImpl_Disconnect
,
Base
PinImpl_ConnectedTo
,
Base
PinImpl_ConnectionMediaType
,
Base
PinImpl_QueryPinInfo
,
Base
PinImpl_QueryDirection
,
Base
PinImpl_QueryId
,
I
nputPin
_QueryAccept
,
Base
PinImpl_EnumMediaTypes
,
Base
PinImpl_QueryInternalConnections
,
VideoRenderer_InputPin_EndOfStream
,
VideoRenderer_InputPin_BeginFlush
,
VideoRenderer_InputPin_EndFlush
,
...
...
dlls/strmbase/Makefile.in
View file @
0410e50e
...
...
@@ -2,6 +2,7 @@ MODULE = strmbase
C_SRCS
=
\
enumpins.c
\
mediatype.c
mediatype.c
\
pin.c
@MAKE_IMPLIB_RULES@
dlls/strmbase/pin.c
0 → 100644
View file @
0410e50e
/*
* Generic Implementation of IPin Interface
*
* Copyright 2003 Robert Shearman
* Copyright 2010 Aric Stewart, CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include "dshow.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/strmbase.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include <assert.h>
WINE_DEFAULT_DEBUG_CHANNEL
(
strmbase
);
static
void
Copy_PinInfo
(
PIN_INFO
*
pDest
,
const
PIN_INFO
*
pSrc
)
{
/* Tempting to just do a memcpy, but the name field is
128 characters long! We will probably never exceed 10
most of the time, so we are better off copying
each field manually */
strcpyW
(
pDest
->
achName
,
pSrc
->
achName
);
pDest
->
dir
=
pSrc
->
dir
;
pDest
->
pFilter
=
pSrc
->
pFilter
;
}
/*** Common Base Pin function */
HRESULT
WINAPI
BasePinImpl_GetMediaType
(
IPin
*
iface
,
int
iPosition
,
AM_MEDIA_TYPE
*
pmt
)
{
if
(
iPosition
<
0
)
return
E_INVALIDARG
;
return
VFW_S_NO_MORE_ITEMS
;
}
LONG
WINAPI
BasePinImpl_GetMediaTypeVersion
(
IPin
*
iface
)
{
return
1
;
}
ULONG
WINAPI
BasePinImpl_AddRef
(
IPin
*
iface
)
{
BasePin
*
This
=
(
BasePin
*
)
iface
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
refCount
);
TRACE
(
"(%p)->() AddRef from %d
\n
"
,
iface
,
refCount
-
1
);
return
refCount
;
}
HRESULT
WINAPI
BasePinImpl_Disconnect
(
IPin
*
iface
)
{
HRESULT
hr
;
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"()
\n
"
);
EnterCriticalSection
(
This
->
pCritSec
);
{
if
(
This
->
pConnectedTo
)
{
IPin_Release
(
This
->
pConnectedTo
);
This
->
pConnectedTo
=
NULL
;
FreeMediaType
(
&
This
->
mtCurrent
);
ZeroMemory
(
&
This
->
mtCurrent
,
sizeof
(
This
->
mtCurrent
));
hr
=
S_OK
;
}
else
hr
=
S_FALSE
;
}
LeaveCriticalSection
(
This
->
pCritSec
);
return
hr
;
}
HRESULT
WINAPI
BasePinImpl_ConnectedTo
(
IPin
*
iface
,
IPin
**
ppPin
)
{
HRESULT
hr
;
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
ppPin
);
EnterCriticalSection
(
This
->
pCritSec
);
{
if
(
This
->
pConnectedTo
)
{
*
ppPin
=
This
->
pConnectedTo
;
IPin_AddRef
(
*
ppPin
);
hr
=
S_OK
;
}
else
{
hr
=
VFW_E_NOT_CONNECTED
;
*
ppPin
=
NULL
;
}
}
LeaveCriticalSection
(
This
->
pCritSec
);
return
hr
;
}
HRESULT
WINAPI
BasePinImpl_ConnectionMediaType
(
IPin
*
iface
,
AM_MEDIA_TYPE
*
pmt
)
{
HRESULT
hr
;
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pmt
);
EnterCriticalSection
(
This
->
pCritSec
);
{
if
(
This
->
pConnectedTo
)
{
CopyMediaType
(
pmt
,
&
This
->
mtCurrent
);
hr
=
S_OK
;
}
else
{
ZeroMemory
(
pmt
,
sizeof
(
*
pmt
));
hr
=
VFW_E_NOT_CONNECTED
;
}
}
LeaveCriticalSection
(
This
->
pCritSec
);
return
hr
;
}
HRESULT
WINAPI
BasePinImpl_QueryPinInfo
(
IPin
*
iface
,
PIN_INFO
*
pInfo
)
{
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pInfo
);
Copy_PinInfo
(
pInfo
,
&
This
->
pinInfo
);
IBaseFilter_AddRef
(
pInfo
->
pFilter
);
return
S_OK
;
}
HRESULT
WINAPI
BasePinImpl_QueryDirection
(
IPin
*
iface
,
PIN_DIRECTION
*
pPinDir
)
{
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pPinDir
);
*
pPinDir
=
This
->
pinInfo
.
dir
;
return
S_OK
;
}
HRESULT
WINAPI
BasePinImpl_QueryId
(
IPin
*
iface
,
LPWSTR
*
Id
)
{
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
Id
);
*
Id
=
CoTaskMemAlloc
((
strlenW
(
This
->
pinInfo
.
achName
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!*
Id
)
return
E_OUTOFMEMORY
;
strcpyW
(
*
Id
,
This
->
pinInfo
.
achName
);
return
S_OK
;
}
HRESULT
WINAPI
BasePinImpl_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
)
{
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
pmt
);
return
S_OK
;
}
HRESULT
WINAPI
BasePinImpl_EnumMediaTypes
(
IPin
*
iface
,
IEnumMediaTypes
**
ppEnum
)
{
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
ppEnum
);
/* override this method to allow enumeration of your types */
return
EnumMediaTypes_Construct
(
iface
,
BasePinImpl_GetMediaType
,
BasePinImpl_GetMediaTypeVersion
,
ppEnum
);
}
HRESULT
WINAPI
BasePinImpl_QueryInternalConnections
(
IPin
*
iface
,
IPin
**
apPin
,
ULONG
*
cPin
)
{
BasePin
*
This
=
(
BasePin
*
)
iface
;
TRACE
(
"(%p/%p)->(%p, %p)
\n
"
,
This
,
iface
,
apPin
,
cPin
);
return
E_NOTIMPL
;
/* to tell caller that all input pins connected to all output pins */
}
include/wine/strmbase.h
View file @
0410e50e
...
...
@@ -34,3 +34,29 @@ typedef LONG (WINAPI *BaseFilter_GetPinVersion)(IBaseFilter* iface);
HRESULT
WINAPI
EnumMediaTypes_Construct
(
IPin
*
iface
,
BasePin_GetMediaType
enumFunc
,
BasePin_GetMediaTypeVersion
versionFunc
,
IEnumMediaTypes
**
ppEnum
);
HRESULT
WINAPI
EnumPins_Construct
(
IBaseFilter
*
base
,
BaseFilter_GetPin
receive_pin
,
BaseFilter_GetPinCount
receive_pincount
,
BaseFilter_GetPinVersion
receive_version
,
IEnumPins
**
ppEnum
);
/* Pin functions */
typedef
struct
BasePin
{
const
struct
IPinVtbl
*
lpVtbl
;
LONG
refCount
;
LPCRITICAL_SECTION
pCritSec
;
PIN_INFO
pinInfo
;
IPin
*
pConnectedTo
;
AM_MEDIA_TYPE
mtCurrent
;
}
BasePin
;
/* Base Pin */
HRESULT
WINAPI
BasePinImpl_GetMediaType
(
IPin
*
iface
,
int
iPosition
,
AM_MEDIA_TYPE
*
pmt
);
LONG
WINAPI
BasePinImpl_GetMediaTypeVersion
(
IPin
*
iface
);
ULONG
WINAPI
BasePinImpl_AddRef
(
IPin
*
iface
);
HRESULT
WINAPI
BasePinImpl_Disconnect
(
IPin
*
iface
);
HRESULT
WINAPI
BasePinImpl_ConnectedTo
(
IPin
*
iface
,
IPin
**
ppPin
);
HRESULT
WINAPI
BasePinImpl_ConnectionMediaType
(
IPin
*
iface
,
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
BasePinImpl_QueryPinInfo
(
IPin
*
iface
,
PIN_INFO
*
pInfo
);
HRESULT
WINAPI
BasePinImpl_QueryDirection
(
IPin
*
iface
,
PIN_DIRECTION
*
pPinDir
);
HRESULT
WINAPI
BasePinImpl_QueryId
(
IPin
*
iface
,
LPWSTR
*
Id
);
HRESULT
WINAPI
BasePinImpl_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
BasePinImpl_EnumMediaTypes
(
IPin
*
iface
,
IEnumMediaTypes
**
ppEnum
);
HRESULT
WINAPI
BasePinImpl_QueryInternalConnections
(
IPin
*
iface
,
IPin
**
apPin
,
ULONG
*
cPin
);
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