ReactOS 0.4.15-dev-7994-gb388cb6
CInputPin Class Reference
Inheritance diagram for CInputPin:
Collaboration diagram for CInputPin:

Public Types

typedef std::vector< IUnknown * > ProxyPluginVector
 
- Public Types inherited from IPin
typedef struct IPin::_PinInfo PIN_INFO
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from ISpecifyPropertyPages
typedef ISpecifyPropertyPagesLPSPECIFYPROPERTYPAGES
 
typedef struct ISpecifyPropertyPages::tagCAUUID CAUUID
 
typedef struct ISpecifyPropertyPages::tagCAUUIDLPCAUUID
 

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
HRESULT STDMETHODCALLTYPE KsGetPinFramingCache (PKSALLOCATOR_FRAMING_EX *FramingEx, PFRAMING_PROP FramingProp, FRAMING_CACHE_OPS Option)
 
HRESULT STDMETHODCALLTYPE KsSetPinFramingCache (PKSALLOCATOR_FRAMING_EX FramingEx, PFRAMING_PROP FramingProp, FRAMING_CACHE_OPS Option)
 
IPin *STDMETHODCALLTYPE KsGetConnectedPin ()
 
IKsAllocatorEx *STDMETHODCALLTYPE KsGetPipe (KSPEEKOPERATION Operation)
 
HRESULT STDMETHODCALLTYPE KsSetPipe (IKsAllocatorEx *KsAllocator)
 
ULONG STDMETHODCALLTYPE KsGetPipeAllocatorFlag ()
 
HRESULT STDMETHODCALLTYPE KsSetPipeAllocatorFlag (ULONG Flag)
 
GUID STDMETHODCALLTYPE KsGetPinBusCache ()
 
HRESULT STDMETHODCALLTYPE KsSetPinBusCache (GUID Bus)
 
PWCHAR STDMETHODCALLTYPE KsGetPinName ()
 
PWCHAR STDMETHODCALLTYPE KsGetFilterName ()
 
HRESULT STDMETHODCALLTYPE Connect (IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
 
HRESULT STDMETHODCALLTYPE ReceiveConnection (IPin *pConnector, const AM_MEDIA_TYPE *pmt)
 
HRESULT STDMETHODCALLTYPE Disconnect ()
 
HRESULT STDMETHODCALLTYPE ConnectedTo (IPin **pPin)
 
HRESULT STDMETHODCALLTYPE ConnectionMediaType (AM_MEDIA_TYPE *pmt)
 
HRESULT STDMETHODCALLTYPE QueryPinInfo (PIN_INFO *pInfo)
 
HRESULT STDMETHODCALLTYPE QueryDirection (PIN_DIRECTION *pPinDir)
 
HRESULT STDMETHODCALLTYPE QueryId (LPWSTR *Id)
 
HRESULT STDMETHODCALLTYPE QueryAccept (const AM_MEDIA_TYPE *pmt)
 
HRESULT STDMETHODCALLTYPE EnumMediaTypes (IEnumMediaTypes **ppEnum)
 
HRESULT STDMETHODCALLTYPE QueryInternalConnections (IPin **apPin, ULONG *nPin)
 
HRESULT STDMETHODCALLTYPE EndOfStream ()
 
HRESULT STDMETHODCALLTYPE BeginFlush ()
 
HRESULT STDMETHODCALLTYPE EndFlush ()
 
HRESULT STDMETHODCALLTYPE NewSegment (REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
 
HRESULT STDMETHODCALLTYPE GetPages (CAUUID *pPages)
 
HANDLE STDMETHODCALLTYPE KsGetObjectHandle ()
 
HRESULT STDMETHODCALLTYPE Set (REFGUID guidPropSet, DWORD dwPropID, LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData)
 
HRESULT STDMETHODCALLTYPE Get (REFGUID guidPropSet, DWORD dwPropID, LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData, DWORD *pcbReturned)
 
HRESULT STDMETHODCALLTYPE QuerySupported (REFGUID guidPropSet, DWORD dwPropID, DWORD *pTypeSupport)
 
HRESULT STDMETHODCALLTYPE KsProperty (PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG *BytesReturned)
 
HRESULT STDMETHODCALLTYPE KsMethod (PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, ULONG DataLength, ULONG *BytesReturned)
 
HRESULT STDMETHODCALLTYPE KsEvent (PKSEVENT Event, ULONG EventLength, LPVOID EventData, ULONG DataLength, ULONG *BytesReturned)
 
HRESULT STDMETHODCALLTYPE KsQueryMediums (PKSMULTIPLE_ITEM *MediumList)
 
HRESULT STDMETHODCALLTYPE KsQueryInterfaces (PKSMULTIPLE_ITEM *InterfaceList)
 
HRESULT STDMETHODCALLTYPE KsCreateSinkPinHandle (KSPIN_INTERFACE &Interface, KSPIN_MEDIUM &Medium)
 
HRESULT STDMETHODCALLTYPE KsGetCurrentCommunication (KSPIN_COMMUNICATION *Communication, KSPIN_INTERFACE *Interface, KSPIN_MEDIUM *Medium)
 
HRESULT STDMETHODCALLTYPE KsPropagateAcquire ()
 
HRESULT STDMETHODCALLTYPE KsDeliver (IMediaSample *Sample, ULONG Flags)
 
HRESULT STDMETHODCALLTYPE KsMediaSamplesCompleted (PKSSTREAM_SEGMENT StreamSegment)
 
IMemAllocator *STDMETHODCALLTYPE KsPeekAllocator (KSPEEKOPERATION Operation)
 
HRESULT STDMETHODCALLTYPE KsReceiveAllocator (IMemAllocator *MemAllocator)
 
HRESULT STDMETHODCALLTYPE KsRenegotiateAllocator ()
 
LONG STDMETHODCALLTYPE KsIncrementPendingIoCount ()
 
LONG STDMETHODCALLTYPE KsDecrementPendingIoCount ()
 
HRESULT STDMETHODCALLTYPE KsQualityNotify (ULONG Proportion, REFERENCE_TIME TimeDelta)
 
VOID STDMETHODCALLTYPE KsNotifyError (IMediaSample *Sample, HRESULT hr)
 
HRESULT STDMETHODCALLTYPE GetAllocator (IMemAllocator **ppAllocator)
 
HRESULT STDMETHODCALLTYPE NotifyAllocator (IMemAllocator *pAllocator, BOOL bReadOnly)
 
HRESULT STDMETHODCALLTYPE GetAllocatorRequirements (ALLOCATOR_PROPERTIES *pProps)
 
HRESULT STDMETHODCALLTYPE Receive (IMediaSample *pSample)
 
HRESULT STDMETHODCALLTYPE ReceiveMultiple (IMediaSample **pSamples, long nSamples, long *nSamplesProcessed)
 
HRESULT STDMETHODCALLTYPE ReceiveCanBlock (void)
 
HRESULT STDMETHODCALLTYPE KsPinFactory (ULONG *PinFactory)
 
HRESULT STDMETHODCALLTYPE Render (IPin *ppinOut, IGraphBuilder *pGraph)
 
HRESULT STDMETHODCALLTYPE Backout (IPin *ppinOut, IGraphBuilder *pGraph)
 
HRESULT STDMETHODCALLTYPE KsAddAggregate (IN REFGUID AggregateClass)
 
HRESULT STDMETHODCALLTYPE KsRemoveAggregate (REFGUID AggregateClass)
 
HRESULT STDMETHODCALLTYPE Notify (IBaseFilter *pSelf, Quality q)
 
HRESULT STDMETHODCALLTYPE SetSink (IQualityControl *piqc)
 
HRESULT STDMETHODCALLTYPE CheckFormat (const AM_MEDIA_TYPE *pmt)
 
HRESULT STDMETHODCALLTYPE CreatePin (const AM_MEDIA_TYPE *pmt)
 
HRESULT STDMETHODCALLTYPE CreatePinHandle (PKSPIN_MEDIUM Medium, PKSPIN_INTERFACE Interface, const AM_MEDIA_TYPE *pmt)
 
HRESULT STDMETHODCALLTYPE GetSupportedSets (LPGUID *pOutGuid, PULONG NumGuids)
 
HRESULT STDMETHODCALLTYPE LoadProxyPlugins (LPGUID pGuids, ULONG NumGuids)
 
 CInputPin (IBaseFilter *ParentFilter, LPCWSTR PinName, ULONG PinId, KSPIN_COMMUNICATION Communication)
 
virtual ~CInputPin ()
 
- Public Member Functions inherited from IPin
HRESULT Connect ([in] IPin *pReceivePin, [in] const AM_MEDIA_TYPE *pmt)
 
HRESULT ReceiveConnection ([in] IPin *pConnector, [in] const AM_MEDIA_TYPE *pmt)
 
HRESULT Disconnect (void)
 
HRESULT ConnectedTo ([out] IPin **pPin)
 
HRESULT ConnectionMediaType ([out] AM_MEDIA_TYPE *pmt)
 
HRESULT QueryPinInfo ([out] PIN_INFO *pInfo)
 
HRESULT QueryDirection ([out] PIN_DIRECTION *pPinDir)
 
HRESULT QueryId ([out] LPWSTR *Id)
 
HRESULT QueryAccept ([in] const AM_MEDIA_TYPE *pmt)
 
HRESULT EnumMediaTypes ([out] IEnumMediaTypes **ppEnum)
 
HRESULT QueryInternalConnections ([out] IPin **apPin, [in, out] ULONG *nPin)
 
HRESULT EndOfStream (void)
 
HRESULT BeginFlush (void)
 
HRESULT EndFlush (void)
 
HRESULT NewSegment ([in] REFERENCE_TIME tStart, [in] REFERENCE_TIME tStop, [in] double dRate)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT Set ([in] REFGUID guidPropSet, [in] DWORD dwPropID, [in, size_is(cbInstanceData)] LPVOID pInstanceData, [in] DWORD cbInstanceData, [in, size_is(cbPropData)] LPVOID pPropData, [in] DWORD cbPropData)
 
HRESULT Get ([in] REFGUID guidPropSet, [in] DWORD dwPropID, [in, size_is(cbInstanceData)] LPVOID pInstanceData, [in] DWORD cbInstanceData, [out, size_is(cbPropData)] LPVOID pPropData, [in] DWORD cbPropData, [out] DWORD *pcbReturned)
 
HRESULT QuerySupported ([in] REFGUID guidPropSet, [in] DWORD dwPropID, [out] DWORD *pTypeSupport)
 
- Public Member Functions inherited from IKsControl
HRESULT KsProperty ([in] PKSPROPERTY Property, [in] ULONG PropertyLength, [in, out] void *PropertyData, [in] ULONG DataLength, [out] ULONG *BytesReturned)
 
HRESULT KsMethod ([in] PKSMETHOD Method, [in] ULONG MethodLength, [in, out] void *MethodData, [in] ULONG DataLength, [out] ULONG *BytesReturned)
 
HRESULT KsEvent ([in] PKSEVENT Event, [in] ULONG EventLength, [in, out] void *EventData, [in] ULONG DataLength, [out] ULONG *BytesReturned)
 
HRESULT GetAllocator ([out] IMemAllocator **ppAllocator)
 
HRESULT NotifyAllocator ([in] IMemAllocator *pAllocator, [in] BOOL bReadOnly)
 
HRESULT GetAllocatorRequirements ([out] ALLOCATOR_PROPERTIES *pProps)
 
HRESULT Receive ([in] IMediaSample *pSample)
 
HRESULT ReceiveMultiple ([in, size_is(nSamples)] IMediaSample **pSamples, [in] long nSamples, [out] long *nSamplesProcessed)
 
HRESULT ReceiveCanBlock ()
 
HRESULT Render ([in] IPin *ppinOut, [in] IGraphBuilder *pGraph)
 
HRESULT Backout ([in] IPin *ppinOut, [in] IGraphBuilder *pGraph)
 
HRESULT Notify ([in] IBaseFilter *pSelf, [in] Quality q)
 
HRESULT SetSink ([in] IQualityControl *piqc)
 
HRESULT GetPages ([out] CAUUID *pPages)
 

Protected Attributes

LONG m_Ref
 
IBaseFilterm_ParentFilter
 
LPCWSTR m_PinName
 
HANDLE m_hPin
 
ULONG m_PinId
 
IMemAllocatorm_MemAllocator
 
LONG m_IoCount
 
KSPIN_COMMUNICATION m_Communication
 
KSPIN_INTERFACE m_Interface
 
KSPIN_MEDIUM m_Medium
 
AM_MEDIA_TYPE m_MediaFormat
 
IPinm_Pin
 
BOOL m_ReadOnly
 
IKsInterfaceHandler * m_InterfaceHandler
 
IKsAllocatorEx * m_KsAllocatorEx
 
ULONG m_PipeAllocatorFlag
 
BOOL m_bPinBusCacheInitialized
 
GUID m_PinBusCache
 
LPWSTR m_FilterName
 
FRAMING_PROP m_FramingProp [4]
 
PKSALLOCATOR_FRAMING_EX m_FramingEx [4]
 
ProxyPluginVector m_Plugins
 

Detailed Description

Definition at line 28 of file input_pin.cpp.

Member Typedef Documentation

◆ ProxyPluginVector

typedef std::vector<IUnknown *> CInputPin::ProxyPluginVector

Definition at line 42 of file input_pin.cpp.

Constructor & Destructor Documentation

◆ CInputPin()

CInputPin::CInputPin ( IBaseFilter ParentFilter,
LPCWSTR  PinName,
ULONG  PinId,
KSPIN_COMMUNICATION  Communication 
)

Definition at line 182 of file input_pin.cpp.

186 : m_Ref(0),
187 m_ParentFilter(ParentFilter),
188 m_PinName(PinName),
190 m_PinId(PinId),
192 m_IoCount(0),
193 m_Communication(Communication),
194 m_Pin(0),
195 m_ReadOnly(0),
200 m_FilterName(0),
201 m_Plugins()
202{
205
206 HRESULT hr;
207 IKsObject * KsObjectParent;
208 HANDLE hFilter;
209
210 hr = m_ParentFilter->QueryInterface(IID_IKsObject, (LPVOID*)&KsObjectParent);
211 assert(hr == S_OK);
212
213 hFilter = KsObjectParent->KsGetObjectHandle();
214 assert(hFilter);
215
216 KsObjectParent->Release();
217
218
220 hr = KsGetMediaType(0, &m_MediaFormat, hFilter, m_PinId);
221 assert(hr == S_OK);
222}
LPWSTR m_FilterName
Definition: input_pin.cpp:176
FRAMING_PROP m_FramingProp[4]
Definition: input_pin.cpp:177
ULONG m_PinId
Definition: input_pin.cpp:162
IKsInterfaceHandler * m_InterfaceHandler
Definition: input_pin.cpp:171
PKSALLOCATOR_FRAMING_EX m_FramingEx[4]
Definition: input_pin.cpp:178
LONG m_IoCount
Definition: input_pin.cpp:164
AM_MEDIA_TYPE m_MediaFormat
Definition: input_pin.cpp:168
LPCWSTR m_PinName
Definition: input_pin.cpp:160
IKsAllocatorEx * m_KsAllocatorEx
Definition: input_pin.cpp:172
IMemAllocator * m_MemAllocator
Definition: input_pin.cpp:163
ProxyPluginVector m_Plugins
Definition: input_pin.cpp:179
IPin * m_Pin
Definition: input_pin.cpp:169
KSPIN_COMMUNICATION m_Communication
Definition: input_pin.cpp:165
IBaseFilter * m_ParentFilter
Definition: input_pin.cpp:159
BOOL m_bPinBusCacheInitialized
Definition: input_pin.cpp:174
ULONG m_PipeAllocatorFlag
Definition: input_pin.cpp:173
BOOL m_ReadOnly
Definition: input_pin.cpp:170
HANDLE m_hPin
Definition: input_pin.cpp:161
LONG m_Ref
Definition: input_pin.cpp:158
const GUID IID_IKsObject
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define assert(x)
Definition: debug.h:53
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
nsrefcnt Release()
#define S_OK
Definition: intsafe.h:52
KSDDKAPI HRESULT WINAPI KsGetMediaType(int Position, AM_MEDIA_TYPE *AmMediaType, HANDLE FilterHandle, ULONG PinFactoryId)
Definition: ksproxy.cpp:250
HRESULT hr
Definition: shlfolder.c:183
#define ZeroMemory
Definition: winbase.h:1712

◆ ~CInputPin()

virtual CInputPin::~CInputPin ( )
inlinevirtual

Definition at line 155 of file input_pin.cpp.

155{};

Member Function Documentation

◆ Backout()

HRESULT STDMETHODCALLTYPE CInputPin::Backout ( IPin ppinOut,
IGraphBuilder pGraph 
)

Implements IStreamBuilder.

Definition at line 405 of file input_pin.cpp.

408{
409#ifdef KSPROXY_TRACE
410 OutputDebugStringW(L"CInputPin::Backout\n");
411#endif
412
413 return S_OK;
414}
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define L(x)
Definition: ntvdm.h:50

◆ BeginFlush()

HRESULT STDMETHODCALLTYPE CInputPin::BeginFlush ( void  )

Implements IPin.

Definition at line 1293 of file input_pin.cpp.

1294{
1295#ifdef KSPROXY_TRACE
1296 OutputDebugStringW(L"CInputPin::BeginFlush NotImplemented\n");
1297#endif
1298 return E_NOTIMPL;
1299}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CheckFormat()

HRESULT STDMETHODCALLTYPE CInputPin::CheckFormat ( const AM_MEDIA_TYPE pmt)

Definition at line 1323 of file input_pin.cpp.

1325{
1326 PKSMULTIPLE_ITEM MultipleItem;
1328 HRESULT hr;
1329 IKsObject * KsObjectParent;
1330 HANDLE hFilter;
1331
1332 if (!pmt)
1333 return E_POINTER;
1334
1335 hr = m_ParentFilter->QueryInterface(IID_IKsObject, (LPVOID*)&KsObjectParent);
1336 if (FAILED(hr))
1337 return hr;
1338
1339 hFilter = KsObjectParent->KsGetObjectHandle();
1340
1341 KsObjectParent->Release();
1342
1343 if (!hFilter)
1344 return E_HANDLE;
1345
1346
1348 if (FAILED(hr))
1349 return S_FALSE;
1350
1351 DataFormat = (PKSDATAFORMAT)(MultipleItem + 1);
1352 for(ULONG Index = 0; Index < MultipleItem->Count; Index++)
1353 {
1354 if (IsEqualGUID(pmt->majortype, DataFormat->MajorFormat) &&
1355 IsEqualGUID(pmt->subtype, DataFormat->SubFormat) &&
1356 IsEqualGUID(pmt->formattype, DataFormat->Specifier))
1357 {
1358 // format is supported
1359 CoTaskMemFree(MultipleItem);
1360#ifdef KSPROXY_TRACE
1361 OutputDebugStringW(L"CInputPin::CheckFormat format OK\n");
1362#endif
1363 return S_OK;
1364 }
1366 }
1367 //format is not supported
1368 CoTaskMemFree(MultipleItem);
1369 return S_FALSE;
1370}
KSDATAFORMAT * PKSDATAFORMAT
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define FAILED(hr)
Definition: intsafe.h:51
@ KSPROPERTY_PIN_DATARANGES
Definition: ks.h:628
KSDDKAPI HRESULT WINAPI KsGetMultiplePinFactoryItems(HANDLE FilterHandle, ULONG PinFactoryId, ULONG PropertyId, PVOID *Items)
Definition: ksproxy.cpp:154
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
ULONG Count
Definition: ks.h:1980
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index
#define S_FALSE
Definition: winerror.h:2357
#define E_HANDLE
Definition: winerror.h:2850
#define E_POINTER
Definition: winerror.h:2365

Referenced by QueryAccept(), and ReceiveConnection().

◆ Connect()

HRESULT STDMETHODCALLTYPE CInputPin::Connect ( IPin pReceivePin,
const AM_MEDIA_TYPE pmt 
)

Definition at line 1086 of file input_pin.cpp.

1087{
1088#ifdef KSPROXY_TRACE
1089 OutputDebugStringW(L"CInputPin::Connect NotImplemented\n");
1090#endif
1091 return NOERROR;
1092}
#define NOERROR
Definition: winerror.h:2354

◆ ConnectedTo()

HRESULT STDMETHODCALLTYPE CInputPin::ConnectedTo ( IPin **  pPin)

Implements IPin.

Definition at line 1149 of file input_pin.cpp.

1150{
1151 if (!pPin)
1152 return E_POINTER;
1153
1154 if (m_Pin)
1155 {
1156 // increment reference count
1157 m_Pin->AddRef();
1158 *pPin = m_Pin;
1159 return S_OK;
1160 }
1161
1162 *pPin = NULL;
1163 return VFW_E_NOT_CONNECTED;
1164}
#define NULL
Definition: types.h:112
ULONG AddRef()
#define VFW_E_NOT_CONNECTED
Definition: vfwmsgs.h:48

◆ ConnectionMediaType()

HRESULT STDMETHODCALLTYPE CInputPin::ConnectionMediaType ( AM_MEDIA_TYPE pmt)

Definition at line 1167 of file input_pin.cpp.

1168{
1169 if (!m_Pin)
1170 return VFW_E_NOT_CONNECTED;
1171
1172#ifdef KSPROXY_TRACE
1173 OutputDebugStringW(L"CInputPin::ConnectionMediaType NotImplemented\n");
1174#endif
1175
1176 return E_NOTIMPL;
1177}

◆ CreatePin()

HRESULT STDMETHODCALLTYPE CInputPin::CreatePin ( const AM_MEDIA_TYPE pmt)

Definition at line 1374 of file input_pin.cpp.

1376{
1377 PKSMULTIPLE_ITEM MediumList;
1379 PKSPIN_MEDIUM Medium;
1381 IKsInterfaceHandler * InterfaceHandler;
1382 HRESULT hr;
1383
1384 // query for pin medium
1385 hr = KsQueryMediums(&MediumList);
1386 if (FAILED(hr))
1387 return hr;
1388
1389 // query for pin interface
1391 if (FAILED(hr))
1392 {
1393 // failed
1394 CoTaskMemFree(MediumList);
1395 return hr;
1396 }
1397
1398 if (MediumList->Count)
1399 {
1400 //use first available medium
1401 Medium = (PKSPIN_MEDIUM)(MediumList + 1);
1402 }
1403 else
1404 {
1405 // default to standard medium
1406 Medium = &StandardPinMedium;
1407 }
1408
1409 if (InterfaceList->Count)
1410 {
1411 //use first available interface
1413 }
1414 else
1415 {
1416 // default to standard interface
1418 }
1419
1421 {
1422 if (!m_InterfaceHandler)
1423 {
1424 // now load the IKsInterfaceHandler plugin
1425 hr = CoCreateInstance(Interface->Set, NULL, CLSCTX_INPROC_SERVER, IID_IKsInterfaceHandler, (void**)&InterfaceHandler);
1426 if (FAILED(hr))
1427 {
1428 // failed to load interface handler plugin
1429#ifdef KSPROXY_TRACE
1430 OutputDebugStringW(L"CInputPin::CreatePin failed to load InterfaceHandlerPlugin\n");
1431#endif
1432 CoTaskMemFree(MediumList);
1434
1435 return hr;
1436 }
1437
1438 // now set the pin
1439 hr = InterfaceHandler->KsSetPin((IKsPin*)this);
1440 if (FAILED(hr))
1441 {
1442 // failed to load interface handler plugin
1443#ifdef KSPROXY_TRACE
1444 OutputDebugStringW(L"CInputPin::CreatePin failed to initialize InterfaceHandlerPlugin\n");
1445#endif
1446 InterfaceHandler->Release();
1447 CoTaskMemFree(MediumList);
1449 return hr;
1450 }
1451
1452 // store interface handler
1453 m_InterfaceHandler = InterfaceHandler;
1454 }
1455
1456 // now create pin
1457 hr = CreatePinHandle(Medium, Interface, pmt);
1458 if (FAILED(hr))
1459 {
1460 m_InterfaceHandler->Release();
1461 m_InterfaceHandler = InterfaceHandler;
1462 }
1463 }
1464 else
1465 {
1466#ifdef KSPROXY_TRACE
1467 WCHAR Buffer[100];
1468 swprintf(Buffer, L"CInputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName);
1470#endif
1471 hr = E_FAIL;
1472 }
1473
1474 // free medium / interface / dataformat
1475 CoTaskMemFree(MediumList);
1477
1478 return hr;
1479}
Definition: bufpool.h:45
HRESULT STDMETHODCALLTYPE KsQueryMediums(PKSMULTIPLE_ITEM *MediumList)
Definition: input_pin.cpp:713
HRESULT STDMETHODCALLTYPE CreatePinHandle(PKSPIN_MEDIUM Medium, PKSPIN_INTERFACE Interface, const AM_MEDIA_TYPE *pmt)
Definition: input_pin.cpp:1483
HRESULT STDMETHODCALLTYPE KsQueryInterfaces(PKSMULTIPLE_ITEM *InterfaceList)
Definition: input_pin.cpp:736
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define swprintf
Definition: precomp.h:40
KSPIN_MEDIUM StandardPinMedium
Definition: input_pin.cpp:21
KSPIN_INTERFACE StandardPinInterface
Definition: input_pin.cpp:14
@ KSPIN_COMMUNICATION_BRIDGE
Definition: ks.h:1258
@ KSPIN_COMMUNICATION_NONE
Definition: ks.h:1254
KSIDENTIFIER * PKSPIN_INTERFACE
Definition: ks.h:243
KSIDENTIFIER * PKSPIN_MEDIUM
Definition: ks.h:244
_In_ PUSBD_INTERFACE_LIST_ENTRY InterfaceList
Definition: usbdlib.h:181
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by KsCreateSinkPinHandle(), QueryInterface(), and ReceiveConnection().

◆ CreatePinHandle()

HRESULT STDMETHODCALLTYPE CInputPin::CreatePinHandle ( PKSPIN_MEDIUM  Medium,
PKSPIN_INTERFACE  Interface,
const AM_MEDIA_TYPE pmt 
)

Definition at line 1483 of file input_pin.cpp.

1487{
1488 PKSPIN_CONNECT PinConnect;
1490 ULONG Length;
1491 HRESULT hr;
1492 IKsObject * KsObjectParent;
1493 HANDLE hFilter;
1494
1495 if (!pmt)
1496 return E_POINTER;
1497
1498 hr = m_ParentFilter->QueryInterface(IID_IKsObject, (LPVOID*)&KsObjectParent);
1499 if (FAILED(hr))
1500 return hr;
1501
1502 hFilter = KsObjectParent->KsGetObjectHandle();
1503
1504 KsObjectParent->Release();
1505
1506 if (!hFilter)
1507 return E_HANDLE;
1508
1509
1511 {
1512 // pin already exists
1513 //CloseHandle(m_hPin);
1514 //m_hPin = INVALID_HANDLE_VALUE;
1515 return S_OK;
1516 }
1517
1518
1519 // calc format size
1520 Length = sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT) + pmt->cbFormat;
1521
1522 // allocate pin connect
1523 PinConnect = (PKSPIN_CONNECT)CoTaskMemAlloc(Length);
1524 if (!PinConnect)
1525 {
1526 // failed
1527 return E_OUTOFMEMORY;
1528 }
1529
1530 // setup request
1531 CopyMemory(&PinConnect->Interface, Interface, sizeof(KSPIN_INTERFACE));
1532 CopyMemory(&PinConnect->Medium, Medium, sizeof(KSPIN_MEDIUM));
1533 PinConnect->PinId = m_PinId;
1534 PinConnect->PinToHandle = NULL;
1537
1538 // get dataformat offset
1539 DataFormat = (PKSDATAFORMAT)(PinConnect + 1);
1540
1541 // copy data format
1542 DataFormat->FormatSize = sizeof(KSDATAFORMAT) + pmt->cbFormat;
1543 DataFormat->Flags = 0;
1544 DataFormat->SampleSize = pmt->lSampleSize;
1545 DataFormat->Reserved = 0;
1546 CopyMemory(&DataFormat->MajorFormat, &pmt->majortype, sizeof(GUID));
1547 CopyMemory(&DataFormat->SubFormat, &pmt->subtype, sizeof(GUID));
1548 CopyMemory(&DataFormat->Specifier, &pmt->formattype, sizeof(GUID));
1549
1550 if (pmt->cbFormat)
1551 {
1552 // copy extended format
1553 CopyMemory((DataFormat + 1), pmt->pbFormat, pmt->cbFormat);
1554 }
1555
1556 // create pin
1557 hr = KsCreatePin(hFilter, PinConnect, GENERIC_WRITE, &m_hPin);
1558
1559 if (SUCCEEDED(hr))
1560 {
1561 // store current interface / medium
1562 CopyMemory(&m_Medium, Medium, sizeof(KSPIN_MEDIUM));
1564 CopyMemory(&m_MediaFormat, pmt, sizeof(AM_MEDIA_TYPE));
1565
1566#ifdef KSPROXY_TRACE
1567 LPOLESTR pMajor, pSub, pFormat;
1568 StringFromIID(m_MediaFormat.majortype, &pMajor);
1569 StringFromIID(m_MediaFormat.subtype , &pSub);
1570 StringFromIID(m_MediaFormat.formattype, &pFormat);
1571
1572 WCHAR Buffer[200];
1573 swprintf(Buffer, L"CInputPin::CreatePinHandle Major %s SubType %s Format %s pbFormat %p cbFormat %u\n", pMajor, pSub, pFormat, pmt->pbFormat, pmt->cbFormat);
1574 CoTaskMemFree(pMajor);
1575 CoTaskMemFree(pSub);
1576 CoTaskMemFree(pFormat);
1578#endif
1579
1580 if (pmt->cbFormat)
1581 {
1582 m_MediaFormat.pbFormat = (BYTE*)CoTaskMemAlloc(pmt->cbFormat);
1583 if (!m_MediaFormat.pbFormat)
1584 {
1585 CoTaskMemFree(PinConnect);
1586 m_MediaFormat.pbFormat = NULL;
1587 m_MediaFormat.cbFormat = 0;
1588 return E_OUTOFMEMORY;
1589 }
1590 CopyMemory(m_MediaFormat.pbFormat, pmt->pbFormat, pmt->cbFormat);
1591 }
1592
1593 LPGUID pGuid;
1594 ULONG NumGuids = 0;
1595
1596 // get all supported sets
1597 hr = GetSupportedSets(&pGuid, &NumGuids);
1598 if (FAILED(hr))
1599 {
1600#ifdef KSPROXY_TRACE
1601 OutputDebugStringW(L"CInputPin::CreatePinHandle GetSupportedSets failed\n");
1602#endif
1603 return hr;
1604 }
1605
1606 // load all proxy plugins
1607 hr = LoadProxyPlugins(pGuid, NumGuids);
1608 if (FAILED(hr))
1609 {
1610#ifdef KSPROXY_TRACE
1611 OutputDebugStringW(L"CInputPin::CreatePinHandle LoadProxyPlugins failed\n");
1612#endif
1613 return hr;
1614 }
1615
1616 // free sets
1617 CoTaskMemFree(pGuid);
1618
1619
1620 //TODO
1621 // connect pin pipes
1622
1623 }
1624
1625 // free pin connect
1626 CoTaskMemFree(PinConnect);
1627
1628 return hr;
1629}
HRESULT STDMETHODCALLTYPE GetSupportedSets(LPGUID *pOutGuid, PULONG NumGuids)
Definition: input_pin.cpp:1633
KSPIN_INTERFACE m_Interface
Definition: input_pin.cpp:166
KSPIN_MEDIUM m_Medium
Definition: input_pin.cpp:167
HRESULT STDMETHODCALLTYPE LoadProxyPlugins(LPGUID pGuids, ULONG NumGuids)
Definition: input_pin.cpp:1716
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define KSPRIORITY_NORMAL
Definition: ks.h:1386
struct KSPIN_CONNECT * PKSPIN_CONNECT
KSDDKAPI DWORD NTAPI KsCreatePin(HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle)
Definition: ksuser.c:192
static LPOLESTR
Definition: stg_prop.c:27
#define GENERIC_WRITE
Definition: nt_native.h:90
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_Check_return_ HRESULT WINAPI StringFromIID(_In_ REFIID rclsid, _Outptr_ LPOLESTR *lplpsz)
ULONG PinId
Definition: ks.h:2603
KSPIN_MEDIUM Medium
Definition: ks.h:2602
KSPRIORITY Priority
Definition: ks.h:2605
KSPIN_INTERFACE Interface
Definition: ks.h:2601
HANDLE PinToHandle
Definition: ks.h:2604
ULONG PriorityClass
Definition: ks.h:1391
ULONG PrioritySubClass
Definition: ks.h:1392
#define CopyMemory
Definition: winbase.h:1710
unsigned char BYTE
Definition: xxhash.c:193

Referenced by CreatePin().

◆ Disconnect()

HRESULT STDMETHODCALLTYPE CInputPin::Disconnect ( void  )

Implements IPin.

Definition at line 1127 of file input_pin.cpp.

1128{
1129 if (!m_Pin)
1130 {
1131 // pin was not connected
1132 return S_FALSE;
1133 }
1134
1135 //FIXME
1136 //check if filter is active
1137
1138 m_Pin->Release();
1139 m_Pin = NULL;
1140
1141#ifdef KSPROXY_TRACE
1142 OutputDebugStringW(L"CInputPin::Disconnect\n");
1143#endif
1144
1145 return S_OK;
1146}
ULONG Release()

◆ EndFlush()

HRESULT STDMETHODCALLTYPE CInputPin::EndFlush ( void  )

Implements IPin.

Definition at line 1302 of file input_pin.cpp.

1303{
1304#ifdef KSPROXY_TRACE
1305 OutputDebugStringW(L"CInputPin::EndFlush NotImplemented\n");
1306#endif
1307 return E_NOTIMPL;
1308}

◆ EndOfStream()

HRESULT STDMETHODCALLTYPE CInputPin::EndOfStream ( void  )

Implements IPin.

Definition at line 1284 of file input_pin.cpp.

1285{
1286#ifdef KSPROXY_TRACE
1287 OutputDebugStringW(L"CInputPin::EndOfStream NotImplemented\n");
1288#endif
1289 return E_NOTIMPL;
1290}

◆ EnumMediaTypes()

HRESULT STDMETHODCALLTYPE CInputPin::EnumMediaTypes ( IEnumMediaTypes **  ppEnum)

Implements IPin.

Definition at line 1222 of file input_pin.cpp.

1223{
1224 HRESULT hr;
1225 ULONG MediaTypeCount = 0, Index;
1226 AM_MEDIA_TYPE * MediaTypes;
1227 IKsObject * KsObjectParent;
1228 HANDLE hFilter;
1229
1230 hr = m_ParentFilter->QueryInterface(IID_IKsObject, (LPVOID*)&KsObjectParent);
1231 if (FAILED(hr))
1232 return hr;
1233
1234 hFilter = KsObjectParent->KsGetObjectHandle();
1235
1236 KsObjectParent->Release();
1237
1238 if (!hFilter)
1239 return E_HANDLE;
1240
1241
1242 // query media type count
1243 hr = KsGetMediaTypeCount(hFilter, m_PinId, &MediaTypeCount);
1244 if (FAILED(hr) || !MediaTypeCount)
1245 return hr;
1246
1247 // allocate media types
1248 MediaTypes = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE) * MediaTypeCount);
1249 if (!MediaTypes)
1250 {
1251 // not enough memory
1252 return E_OUTOFMEMORY;
1253 }
1254
1255 // zero media types
1256 ZeroMemory(MediaTypes, sizeof(AM_MEDIA_TYPE) * MediaTypeCount);
1257
1258 for(Index = 0; Index < MediaTypeCount; Index++)
1259 {
1260 // get media type
1261 hr = KsGetMediaType(Index, &MediaTypes[Index], hFilter, m_PinId);
1262 if (FAILED(hr))
1263 {
1264 // failed
1265 CoTaskMemFree(MediaTypes);
1266 return hr;
1267 }
1268 }
1269
1270 return CEnumMediaTypes_fnConstructor(MediaTypeCount, MediaTypes, IID_IEnumMediaTypes, (void**)ppEnum);
1271}
HRESULT WINAPI CEnumMediaTypes_fnConstructor(ULONG MediaTypeCount, AM_MEDIA_TYPE *MediaTypes, REFIID riid, LPVOID *ppv)
KSDDKAPI HRESULT WINAPI KsGetMediaTypeCount(HANDLE FilterHandle, ULONG PinFactoryId, ULONG *MediaTypeCount)
Definition: ksproxy.cpp:216

◆ Get()

HRESULT STDMETHODCALLTYPE CInputPin::Get ( REFGUID  guidPropSet,
DWORD  dwPropID,
LPVOID  pInstanceData,
DWORD  cbInstanceData,
LPVOID  pPropData,
DWORD  cbPropData,
DWORD pcbReturned 
)

Implements IKsPropertySet.

Definition at line 1012 of file input_pin.cpp.

1020{
1022
1023 if (cbInstanceData)
1024 {
1025 PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
1026 if (!Property)
1027 return E_OUTOFMEMORY;
1028
1029 Property->Set = guidPropSet;
1030 Property->Id = dwPropID;
1032
1033 CopyMemory((Property+1), pInstanceData, cbInstanceData);
1034
1035 HRESULT hr = KsProperty(Property, sizeof(KSPROPERTY) + cbInstanceData, pPropData, cbPropData, &BytesReturned);
1037 return hr;
1038 }
1039 else
1040 {
1042
1043 Property.Set = guidPropSet;
1044 Property.Id = dwPropID;
1046
1047 HRESULT hr = KsProperty(&Property, sizeof(KSPROPERTY), pPropData, cbPropData, &BytesReturned);
1048 return hr;
1049 }
1050}
HRESULT STDMETHODCALLTYPE KsProperty(PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG *BytesReturned)
Definition: input_pin.cpp:924
struct KSIDENTIFIER * PKSPROPERTY
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052

◆ GetAllocator()

HRESULT STDMETHODCALLTYPE CInputPin::GetAllocator ( IMemAllocator **  ppAllocator)

Implements IMemInputPin.

Definition at line 602 of file input_pin.cpp.

603{
604#ifdef KSPROXY_TRACE
605 OutputDebugStringW(L"CInputPin::GetAllocator\n");
606#endif
607
608 return VFW_E_NO_ALLOCATOR;
609}
#define VFW_E_NO_ALLOCATOR
Definition: vfwmsgs.h:49

◆ GetAllocatorRequirements()

HRESULT STDMETHODCALLTYPE CInputPin::GetAllocatorRequirements ( ALLOCATOR_PROPERTIES pProps)

Implements IMemInputPin.

Definition at line 643 of file input_pin.cpp.

644{
645 KSALLOCATOR_FRAMING Framing;
647 HRESULT hr;
649
653
654 hr = KsProperty(&Property, sizeof(KSPROPERTY), (PVOID)&Framing, sizeof(KSALLOCATOR_FRAMING), &BytesReturned);
655 if (SUCCEEDED(hr))
656 {
657 pProps->cBuffers = Framing.Frames;
658 pProps->cbBuffer = Framing.FrameSize;
659 pProps->cbAlign = Framing.FileAlignment;
660 pProps->cbPrefix = 0;
661 }
662 else
663 hr = E_NOTIMPL;
664
665#ifdef KSPROXY_TRACE
666 WCHAR Buffer[100];
667 swprintf(Buffer, L"CInputPin::GetAllocatorRequirements hr %lx m_hPin %p cBuffers %u cbBuffer %u cbAlign %u cbPrefix %u\n", hr, m_hPin, pProps->cBuffers, pProps->cbBuffer, pProps->cbAlign, pProps->cbPrefix);
669#endif
670
671 return hr;
672}
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
@ KSPROPERTY_CONNECTION_ALLOCATORFRAMING
Definition: ks.h:352
#define KSPROPSETID_Connection
Definition: ks.h:346

◆ GetPages()

HRESULT STDMETHODCALLTYPE CInputPin::GetPages ( CAUUID pPages)

Implements ISpecifyPropertyPages.

Definition at line 584 of file input_pin.cpp.

585{
586 if (!pPages)
587 return E_POINTER;
588
589 pPages->cElems = 0;
590 pPages->pElems = NULL;
591
592 return S_OK;
593}

◆ GetSupportedSets()

HRESULT STDMETHODCALLTYPE CInputPin::GetSupportedSets ( LPGUID pOutGuid,
PULONG  NumGuids 
)

Definition at line 1633 of file input_pin.cpp.

1636{
1638 LPGUID pGuid;
1639 ULONG NumProperty = 0;
1640 ULONG NumMethods = 0;
1641 ULONG NumEvents = 0;
1642 ULONG Length;
1644 HRESULT hr;
1645
1646 Property.Set = GUID_NULL;
1647 Property.Id = 0;
1649
1653
1654 Length = NumProperty + NumMethods + NumEvents;
1655
1656 assert(Length);
1657
1658 // allocate guid buffer
1659 pGuid = (LPGUID)CoTaskMemAlloc(Length);
1660 if (!pGuid)
1661 {
1662 // failed
1663 return E_OUTOFMEMORY;
1664 }
1665
1666 NumProperty /= sizeof(GUID);
1667 NumMethods /= sizeof(GUID);
1668 NumEvents /= sizeof(GUID);
1669
1670#ifdef KSPROXY_TRACE
1671 WCHAR Buffer[200];
1672 swprintf(Buffer, L"CInputPin::GetSupportedSets NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents);
1674#endif
1675
1676 // get all properties
1678 if (FAILED(hr))
1679 {
1680 CoTaskMemFree(pGuid);
1681 return E_FAIL;
1682 }
1684
1685 // get all methods
1686 if (Length && NumMethods)
1687 {
1689 if (FAILED(hr))
1690 {
1691 CoTaskMemFree(pGuid);
1692 return E_FAIL;
1693 }
1695 }
1696
1697 // get all events
1698 if (Length && NumEvents)
1699 {
1701 if (FAILED(hr))
1702 {
1703 CoTaskMemFree(pGuid);
1704 return E_FAIL;
1705 }
1707 }
1708
1709 *pOutGuid = pGuid;
1710 *NumGuids = NumProperty+NumEvents+NumMethods;
1711 return S_OK;
1712}
#define KSPROPERTY_TYPE_SETSUPPORT
Definition: dmksctrl.h:44
#define GUID_NULL
Definition: ks.h:106
#define IOCTL_KS_METHOD
Definition: ks.h:136
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:130
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
@ NumMethods
Definition: actctx.c:1556
GUID * LPGUID
Definition: guiddef.h:81

Referenced by CreatePinHandle().

◆ KsAddAggregate()

HRESULT STDMETHODCALLTYPE CInputPin::KsAddAggregate ( IN REFGUID  AggregateClass)

Definition at line 367 of file input_pin.cpp.

369{
370#ifdef KSPROXY_TRACE
371 OutputDebugStringW(L"CInputPin::KsAddAggregate NotImplemented\n");
372#endif
373
374 return E_NOTIMPL;
375}

◆ KsCreateSinkPinHandle()

HRESULT STDMETHODCALLTYPE CInputPin::KsCreateSinkPinHandle ( KSPIN_INTERFACE Interface,
KSPIN_MEDIUM Medium 
)

Definition at line 759 of file input_pin.cpp.

762{
763 return CreatePin(&m_MediaFormat);
764}
HRESULT STDMETHODCALLTYPE CreatePin(const AM_MEDIA_TYPE *pmt)
Definition: input_pin.cpp:1374

◆ KsDecrementPendingIoCount()

LONG STDMETHODCALLTYPE CInputPin::KsDecrementPendingIoCount ( )

Definition at line 885 of file input_pin.cpp.

886{
887 return InterlockedDecrement((volatile LONG*)&m_IoCount);
888}
#define InterlockedDecrement
Definition: armddk.h:52
long LONG
Definition: pedump.c:60

◆ KsDeliver()

HRESULT STDMETHODCALLTYPE CInputPin::KsDeliver ( IMediaSample Sample,
ULONG  Flags 
)

Definition at line 823 of file input_pin.cpp.

826{
827 return E_FAIL;
828}

◆ KsEvent()

HRESULT STDMETHODCALLTYPE CInputPin::KsEvent ( PKSEVENT  Event,
ULONG  EventLength,
LPVOID  EventData,
ULONG  DataLength,
ULONG BytesReturned 
)

Definition at line 950 of file input_pin.cpp.

956{
958
959 if (EventLength)
961 else
963}
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1444
#define IOCTL_KS_DISABLE_EVENT
Definition: ks.h:133

◆ KsGetConnectedPin()

IPin *STDMETHODCALLTYPE CInputPin::KsGetConnectedPin ( )

Definition at line 491 of file input_pin.cpp.

492{
493 return m_Pin;
494}

◆ KsGetCurrentCommunication()

HRESULT STDMETHODCALLTYPE CInputPin::KsGetCurrentCommunication ( KSPIN_COMMUNICATION Communication,
KSPIN_INTERFACE Interface,
KSPIN_MEDIUM Medium 
)

Definition at line 768 of file input_pin.cpp.

772{
773 if (Communication)
774 {
775 *Communication = m_Communication;
776 }
777
778 if (Interface)
779 {
780 if (!m_hPin)
781 return VFW_E_NOT_CONNECTED;
782
784 }
785
786 if (Medium)
787 {
788 if (!m_hPin)
789 return VFW_E_NOT_CONNECTED;
790
791 CopyMemory(Medium, &m_Medium, sizeof(KSPIN_MEDIUM));
792 }
793 return NOERROR;
794}

◆ KsGetFilterName()

PWCHAR STDMETHODCALLTYPE CInputPin::KsGetFilterName ( )

Definition at line 573 of file input_pin.cpp.

574{
575 return m_FilterName;
576}

◆ KsGetObjectHandle()

HANDLE STDMETHODCALLTYPE CInputPin::KsGetObjectHandle ( )

Definition at line 1075 of file input_pin.cpp.

1076{
1077 assert(m_hPin);
1078 return m_hPin;
1079}

◆ KsGetPinBusCache()

GUID STDMETHODCALLTYPE CInputPin::KsGetPinBusCache ( )

Definition at line 543 of file input_pin.cpp.

544{
546 {
549 }
550
551 return m_PinBusCache;
552}
GUID m_PinBusCache
Definition: input_pin.cpp:175
#define TRUE
Definition: types.h:120
GUID Set
Definition: dmksctrl.h:76

◆ KsGetPinFramingCache()

HRESULT STDMETHODCALLTYPE CInputPin::KsGetPinFramingCache ( PKSALLOCATOR_FRAMING_EX FramingEx,
PFRAMING_PROP  FramingProp,
FRAMING_CACHE_OPS  Option 
)

Definition at line 439 of file input_pin.cpp.

443{
444 if (Option > Framing_Cache_Write || Option < Framing_Cache_ReadLast)
445 {
446 // invalid argument
447 return E_INVALIDARG;
448 }
449
450 // get framing properties
451 *FramingProp = m_FramingProp[Option];
452 *FramingEx = m_FramingEx[Option];
453
454 return NOERROR;
455}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ KsGetPinName()

PWCHAR STDMETHODCALLTYPE CInputPin::KsGetPinName ( )

Definition at line 565 of file input_pin.cpp.

566{
567 return (PWCHAR)m_PinName;
568}
uint16_t * PWCHAR
Definition: typedefs.h:56

◆ KsGetPipe()

IKsAllocatorEx *STDMETHODCALLTYPE CInputPin::KsGetPipe ( KSPEEKOPERATION  Operation)

Definition at line 498 of file input_pin.cpp.

500{
501 if (Operation == KsPeekOperation_AddRef)
502 {
503 if (m_KsAllocatorEx)
504 m_KsAllocatorEx->AddRef();
505 }
506 return m_KsAllocatorEx;
507}
FP_OP Operation
Definition: fpcontrol.c:150

◆ KsGetPipeAllocatorFlag()

ULONG STDMETHODCALLTYPE CInputPin::KsGetPipeAllocatorFlag ( )

Definition at line 526 of file input_pin.cpp.

527{
528 return m_PipeAllocatorFlag;
529}

◆ KsIncrementPendingIoCount()

LONG STDMETHODCALLTYPE CInputPin::KsIncrementPendingIoCount ( )

Definition at line 878 of file input_pin.cpp.

879{
880 return InterlockedIncrement((volatile LONG*)&m_IoCount);
881}
#define InterlockedIncrement
Definition: armddk.h:53

◆ KsMediaSamplesCompleted()

HRESULT STDMETHODCALLTYPE CInputPin::KsMediaSamplesCompleted ( PKSSTREAM_SEGMENT  StreamSegment)

Definition at line 832 of file input_pin.cpp.

833{
834 return NOERROR;
835}

◆ KsMethod()

HRESULT STDMETHODCALLTYPE CInputPin::KsMethod ( PKSMETHOD  Method,
ULONG  MethodLength,
LPVOID  MethodData,
ULONG  DataLength,
ULONG BytesReturned 
)

Definition at line 937 of file input_pin.cpp.

943{
945 return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_METHOD, (PVOID)Method, MethodLength, (PVOID)MethodData, DataLength, BytesReturned);
946}

◆ KsNotifyError()

VOID STDMETHODCALLTYPE CInputPin::KsNotifyError ( IMediaSample Sample,
HRESULT  hr 
)

Definition at line 909 of file input_pin.cpp.

912{
913#ifdef KSPROXY_TRACE
914 OutputDebugStringW(L"CInputPin::KsNotifyError NotImplemented\n");
915#endif
916}

◆ KsPeekAllocator()

IMemAllocator *STDMETHODCALLTYPE CInputPin::KsPeekAllocator ( KSPEEKOPERATION  Operation)

Definition at line 839 of file input_pin.cpp.

840{
841 if (Operation == KsPeekOperation_AddRef)
842 {
843 // add reference on allocator
845 }
846
847 return m_MemAllocator;
848}

◆ KsPinFactory()

HRESULT STDMETHODCALLTYPE CInputPin::KsPinFactory ( ULONG PinFactory)

Definition at line 422 of file input_pin.cpp.

424{
425#ifdef KSPROXY_TRACE
426 OutputDebugStringW(L"CInputPin::KsPinFactory\n");
427#endif
428
429 *PinFactory = m_PinId;
430 return S_OK;
431}

◆ KsPropagateAcquire()

HRESULT STDMETHODCALLTYPE CInputPin::KsPropagateAcquire ( )

Definition at line 798 of file input_pin.cpp.

799{
803 HRESULT hr;
804
806
810
812
814
815 //TODO
816 //propagate to connected pin on the pipe
817
818 return hr;
819}
@ KSPROPERTY_CONNECTION_STATE
Definition: ks.h:349
KSSTATE
Definition: ks.h:1214
@ KSSTATE_ACQUIRE
Definition: ks.h:1216

◆ KsProperty()

HRESULT STDMETHODCALLTYPE CInputPin::KsProperty ( PKSPROPERTY  Property,
ULONG  PropertyLength,
LPVOID  PropertyData,
ULONG  DataLength,
ULONG BytesReturned 
)

Definition at line 924 of file input_pin.cpp.

930{
933}
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData

Referenced by Get(), GetAllocatorRequirements(), KsPropagateAcquire(), QuerySupported(), and Set().

◆ KsQualityNotify()

HRESULT STDMETHODCALLTYPE CInputPin::KsQualityNotify ( ULONG  Proportion,
REFERENCE_TIME  TimeDelta 
)

Definition at line 892 of file input_pin.cpp.

895{
896#ifdef KSPROXY_TRACE
897 OutputDebugStringW(L"CInputPin::KsQualityNotify NotImplemented\n");
898#endif
899
900 return E_NOTIMPL;
901}

◆ KsQueryInterfaces()

HRESULT STDMETHODCALLTYPE CInputPin::KsQueryInterfaces ( PKSMULTIPLE_ITEM InterfaceList)

Definition at line 736 of file input_pin.cpp.

738{
739 HRESULT hr;
740 IKsObject * KsObjectParent;
741 HANDLE hFilter;
742
743 hr = m_ParentFilter->QueryInterface(IID_IKsObject, (LPVOID*)&KsObjectParent);
744 if (FAILED(hr))
745 return hr;
746
747 hFilter = KsObjectParent->KsGetObjectHandle();
748
749 KsObjectParent->Release();
750
751 if (!hFilter)
752 return E_HANDLE;
753
755}
@ KSPROPERTY_PIN_INTERFACES
Definition: ks.h:630

Referenced by CreatePin().

◆ KsQueryMediums()

HRESULT STDMETHODCALLTYPE CInputPin::KsQueryMediums ( PKSMULTIPLE_ITEM MediumList)

Definition at line 713 of file input_pin.cpp.

715{
716 HRESULT hr;
717 IKsObject * KsObjectParent;
718 HANDLE hFilter;
719
720 hr = m_ParentFilter->QueryInterface(IID_IKsObject, (LPVOID*)&KsObjectParent);
721 if (FAILED(hr))
722 return hr;
723
724 hFilter = KsObjectParent->KsGetObjectHandle();
725
726 KsObjectParent->Release();
727
728 if (!hFilter)
729 return E_HANDLE;
730
732}
@ KSPROPERTY_PIN_MEDIUMS
Definition: ks.h:631

Referenced by CreatePin().

◆ KsReceiveAllocator()

HRESULT STDMETHODCALLTYPE CInputPin::KsReceiveAllocator ( IMemAllocator MemAllocator)

Definition at line 852 of file input_pin.cpp.

853{
854
855 if (MemAllocator)
856 {
857 MemAllocator->AddRef();
858 }
859
860 if (m_MemAllocator)
861 {
863 }
864
865 m_MemAllocator = MemAllocator;
866 return NOERROR;
867}

◆ KsRemoveAggregate()

HRESULT STDMETHODCALLTYPE CInputPin::KsRemoveAggregate ( REFGUID  AggregateClass)

Definition at line 379 of file input_pin.cpp.

381{
382#ifdef KSPROXY_TRACE
383 OutputDebugStringW(L"CInputPin::KsRemoveAggregate NotImplemented\n");
384#endif
385
386 return E_NOTIMPL;
387}

◆ KsRenegotiateAllocator()

HRESULT STDMETHODCALLTYPE CInputPin::KsRenegotiateAllocator ( )

Definition at line 871 of file input_pin.cpp.

872{
873 return E_FAIL;
874}

◆ KsSetPinBusCache()

HRESULT STDMETHODCALLTYPE CInputPin::KsSetPinBusCache ( GUID  Bus)

Definition at line 556 of file input_pin.cpp.

558{
559 CopyMemory(&m_PinBusCache, &Bus, sizeof(GUID));
560 return NOERROR;
561}

◆ KsSetPinFramingCache()

HRESULT STDMETHODCALLTYPE CInputPin::KsSetPinFramingCache ( PKSALLOCATOR_FRAMING_EX  FramingEx,
PFRAMING_PROP  FramingProp,
FRAMING_CACHE_OPS  Option 
)

Definition at line 459 of file input_pin.cpp.

463{
464 ULONG Index;
465 ULONG RefCount = 0;
466
467 if (m_FramingEx[Option])
468 {
469 for(Index = 1; Index < 4; Index++)
470 {
471 if (m_FramingEx[Index] == m_FramingEx[Option])
472 RefCount++;
473 }
474
475 if (RefCount == 1)
476 {
477 // existing framing is only used once
478 CoTaskMemFree(m_FramingEx[Option]);
479 }
480 }
481
482 // store framing
483 m_FramingEx[Option] = FramingEx;
484 m_FramingProp[Option] = *FramingProp;
485
486 return S_OK;
487}

◆ KsSetPipe()

HRESULT STDMETHODCALLTYPE CInputPin::KsSetPipe ( IKsAllocatorEx *  KsAllocator)

Definition at line 511 of file input_pin.cpp.

513{
514 if (KsAllocator)
515 KsAllocator->AddRef();
516
517 if (m_KsAllocatorEx)
518 m_KsAllocatorEx->Release();
519
520 m_KsAllocatorEx = KsAllocator;
521 return NOERROR;
522}

◆ KsSetPipeAllocatorFlag()

HRESULT STDMETHODCALLTYPE CInputPin::KsSetPipeAllocatorFlag ( ULONG  Flag)

Definition at line 534 of file input_pin.cpp.

536{
538 return NOERROR;
539}
Definition: xml2sdb.h:80

◆ LoadProxyPlugins()

HRESULT STDMETHODCALLTYPE CInputPin::LoadProxyPlugins ( LPGUID  pGuids,
ULONG  NumGuids 
)

Definition at line 1716 of file input_pin.cpp.

1719{
1720 ULONG Index;
1721 LPOLESTR pStr;
1722 HKEY hKey, hSubKey;
1723 HRESULT hr;
1725
1726 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\MediaInterfaces", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
1727 {
1728 OutputDebugStringW(L"CInputPin::LoadProxyPlugins failed to open MediaInterfaces key\n");
1729 return E_FAIL;
1730 }
1731
1732 // enumerate all sets
1733 for(Index = 0; Index < NumGuids; Index++)
1734 {
1735 // convert to string
1736 hr = StringFromCLSID(pGuids[Index], &pStr);
1737 if (FAILED(hr))
1738 return E_FAIL;
1739
1740 // now try open class key
1741 if (RegOpenKeyExW(hKey, pStr, 0, KEY_READ, &hSubKey) != ERROR_SUCCESS)
1742 {
1743 // no plugin for that set exists
1744 CoTaskMemFree(pStr);
1745 continue;
1746 }
1747
1748 // try load plugin
1749 hr = CoCreateInstance(pGuids[Index], (IBaseFilter*)this, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pUnknown);
1750 if (SUCCEEDED(hr))
1751 {
1752 // store plugin
1753 m_Plugins.push_back(pUnknown);
1754 }
1755 // close key
1756 RegCloseKey(hSubKey);
1757 }
1758
1759 // close media interfaces key
1761 return S_OK;
1762}
const GUID IID_IUnknown
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
FxAutoRegKey hKey
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CreatePinHandle().

◆ NewSegment()

HRESULT STDMETHODCALLTYPE CInputPin::NewSegment ( REFERENCE_TIME  tStart,
REFERENCE_TIME  tStop,
double  dRate 
)

Implements IPin.

Definition at line 1311 of file input_pin.cpp.

1312{
1313#ifdef KSPROXY_TRACE
1314 OutputDebugStringW(L"CInputPin::NewSegment NotImplemented\n");
1315#endif
1316 return E_NOTIMPL;
1317}

◆ Notify()

HRESULT STDMETHODCALLTYPE CInputPin::Notify ( IBaseFilter pSelf,
Quality  q 
)

Implements IQualityControl.

Definition at line 338 of file input_pin.cpp.

341{
342#ifdef KSPROXY_TRACE
343 OutputDebugStringW(L"CInputPin::Notify NotImplemented\n");
344#endif
345
346 return E_NOTIMPL;
347}

◆ NotifyAllocator()

HRESULT STDMETHODCALLTYPE CInputPin::NotifyAllocator ( IMemAllocator pAllocator,
BOOL  bReadOnly 
)

Implements IMemInputPin.

Definition at line 613 of file input_pin.cpp.

614{
615 HRESULT hr;
616 ALLOCATOR_PROPERTIES Properties;
617
618 hr = pAllocator->GetProperties(&Properties);
619
620#ifdef KSPROXY_TRACE
621 WCHAR Buffer[100];
622 swprintf(Buffer, L"CInputPin::NotifyAllocator hr %lx bReadOnly, %u cbAlign %u cbBuffer %u cbPrefix %u cBuffers %u\n", hr, bReadOnly, Properties.cbAlign, Properties.cbBuffer, Properties.cbPrefix, Properties.cBuffers);
624#endif
625
626 if (pAllocator)
627 {
628 pAllocator->AddRef();
629 }
630
631 if (m_MemAllocator)
632 {
634 }
635
636 m_MemAllocator = pAllocator;
637 m_ReadOnly = bReadOnly;
638 return NOERROR;
639}
HRESULT GetProperties([out] ALLOCATOR_PROPERTIES *pProps)

◆ QueryAccept()

HRESULT STDMETHODCALLTYPE CInputPin::QueryAccept ( const AM_MEDIA_TYPE pmt)

Definition at line 1215 of file input_pin.cpp.

1217{
1218 return CheckFormat(pmt);
1219}
HRESULT STDMETHODCALLTYPE CheckFormat(const AM_MEDIA_TYPE *pmt)
Definition: input_pin.cpp:1323

◆ QueryDirection()

HRESULT STDMETHODCALLTYPE CInputPin::QueryDirection ( PIN_DIRECTION pPinDir)

Implements IPin.

Definition at line 1191 of file input_pin.cpp.

1192{
1193 if (pPinDir)
1194 {
1195 *pPinDir = PINDIR_INPUT;
1196 return S_OK;
1197 }
1198
1199 return E_POINTER;
1200}
@ PINDIR_INPUT
Definition: axcore.idl:41

◆ QueryId()

HRESULT STDMETHODCALLTYPE CInputPin::QueryId ( LPWSTR Id)

Implements IPin.

Definition at line 1203 of file input_pin.cpp.

1204{
1205 *Id = (LPWSTR)CoTaskMemAlloc((wcslen(m_PinName)+1)*sizeof(WCHAR));
1206 if (!*Id)
1207 return E_OUTOFMEMORY;
1208
1209 wcscpy(*Id, m_PinName);
1210 return S_OK;
1211}
DWORD Id
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ QueryInterface()

HRESULT STDMETHODCALLTYPE CInputPin::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

Definition at line 226 of file input_pin.cpp.

229{
230 WCHAR Buffer[100];
231
232 *Output = NULL;
233
234 if (IsEqualGUID(refiid, IID_IUnknown) ||
235 IsEqualGUID(refiid, IID_IPin))
236 {
237 *Output = PVOID(this);
238 reinterpret_cast<IUnknown*>(*Output)->AddRef();
239 return NOERROR;
240 }
241 else if (IsEqualGUID(refiid, IID_IMemInputPin))
242 {
244 {
246 if (FAILED(hr))
247 return hr;
248 }
249
250 *Output = (IMemInputPin*)(this);
251 reinterpret_cast<IMemInputPin*>(*Output)->AddRef();
252 return NOERROR;
253 }
254 else if (IsEqualGUID(refiid, IID_IKsObject))
255 {
256 *Output = (IKsObject*)(this);
257 reinterpret_cast<IKsObject*>(*Output)->AddRef();
258 return NOERROR;
259 }
260 else if (IsEqualGUID(refiid, IID_IKsPropertySet))
261 {
263 {
265 if (FAILED(hr))
266 return hr;
267 }
268
269 *Output = (IKsPropertySet*)(this);
270 reinterpret_cast<IKsPropertySet*>(*Output)->AddRef();
271 return NOERROR;
272 }
273 else if (IsEqualGUID(refiid, IID_IKsControl))
274 {
275 *Output = (IKsControl*)(this);
276 reinterpret_cast<IKsControl*>(*Output)->AddRef();
277 return NOERROR;
278 }
279 else if (IsEqualGUID(refiid, IID_IKsPin) ||
280 IsEqualGUID(refiid, IID_IKsPinEx))
281 {
282 *Output = (IKsPinEx*)(this);
283 reinterpret_cast<IKsPinEx*>(*Output)->AddRef();
284 return NOERROR;
285 }
286 else if (IsEqualGUID(refiid, IID_IKsPinPipe))
287 {
288 *Output = (IKsPinPipe*)(this);
289 reinterpret_cast<IKsPinPipe*>(*Output)->AddRef();
290 return NOERROR;
291 }
292 else if (IsEqualGUID(refiid, IID_IKsPinFactory))
293 {
294 *Output = (IKsPinFactory*)(this);
295 reinterpret_cast<IKsPinFactory*>(*Output)->AddRef();
296 return NOERROR;
297 }
298#if 0
299 else if (IsEqualGUID(refiid, IID_IStreamBuilder))
300 {
301 *Output = (IStreamBuilder*)(this);
302 reinterpret_cast<IStreamBuilder*>(*Output)->AddRef();
303 return NOERROR;
304 }
305#endif
306 else if (IsEqualGUID(refiid, IID_IKsAggregateControl))
307 {
308 *Output = (IKsAggregateControl*)(this);
309 reinterpret_cast<IKsAggregateControl*>(*Output)->AddRef();
310 return NOERROR;
311 }
312 else if (IsEqualGUID(refiid, IID_IQualityControl))
313 {
314 *Output = (IQualityControl*)(this);
315 reinterpret_cast<IQualityControl*>(*Output)->AddRef();
316 return NOERROR;
317 }
318 else if (IsEqualGUID(refiid, IID_ISpecifyPropertyPages))
319 {
320 *Output = (ISpecifyPropertyPages*)(this);
321 reinterpret_cast<ISpecifyPropertyPages*>(*Output)->AddRef();
322 return NOERROR;
323 }
324
326 StringFromCLSID(refiid, &lpstr);
327 swprintf(Buffer, L"CInputPin::QueryInterface: NoInterface for %s\n", lpstr);
330
331 return E_NOINTERFACE;
332}
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
const GUID IID_IKsPinFactory
const GUID IID_IKsAggregateControl
Definition: proxy.cpp:16
const GUID IID_IKsControl
Definition: filter.c:44
const GUID IID_IKsPinEx
Definition: input_pin.cpp:12
const GUID IID_IKsPinPipe
Definition: input_pin.cpp:11
static LPCSTR lpstr
Definition: font.c:51
const GUID IID_IPin
Definition: pincontrol.cpp:15
const GUID IID_ISpecifyPropertyPages
Definition: proxy.cpp:12
@ Output
Definition: arc.h:85
void * PVOID
Definition: typedefs.h:50
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ QueryInternalConnections()

HRESULT STDMETHODCALLTYPE CInputPin::QueryInternalConnections ( IPin **  apPin,
ULONG nPin 
)

Implements IPin.

Definition at line 1275 of file input_pin.cpp.

1276{
1277#ifdef KSPROXY_TRACE
1278 OutputDebugStringW(L"CInputPin::QueryInternalConnections NotImplemented\n");
1279#endif
1280 return E_NOTIMPL;
1281}

◆ QueryPinInfo()

HRESULT STDMETHODCALLTYPE CInputPin::QueryPinInfo ( PIN_INFO pInfo)

Implements IPin.

Definition at line 1180 of file input_pin.cpp.

1181{
1182 wcscpy(pInfo->achName, m_PinName);
1183 pInfo->dir = PINDIR_INPUT;
1184 pInfo->pFilter = m_ParentFilter;
1186
1187 return S_OK;
1188}

◆ QuerySupported()

HRESULT STDMETHODCALLTYPE CInputPin::QuerySupported ( REFGUID  guidPropSet,
DWORD  dwPropID,
DWORD pTypeSupport 
)

Implements IKsPropertySet.

Definition at line 1054 of file input_pin.cpp.

1058{
1061
1062 Property.Set = guidPropSet;
1063 Property.Id = dwPropID;
1065
1066 return KsProperty(&Property, sizeof(KSPROPERTY), pTypeSupport, sizeof(DWORD), &BytesReturned);
1067}
unsigned long DWORD
Definition: ntddk_ex.h:95

◆ Receive()

HRESULT STDMETHODCALLTYPE CInputPin::Receive ( IMediaSample pSample)

Implements IMemInputPin.

Definition at line 676 of file input_pin.cpp.

677{
678#ifdef KSPROXY_TRACE
679 OutputDebugStringW(L"CInputPin::Receive NotImplemented\n");
680#endif
681
682 return E_NOTIMPL;
683}

◆ ReceiveCanBlock()

HRESULT STDMETHODCALLTYPE CInputPin::ReceiveCanBlock ( void  )

Implements IMemInputPin.

Definition at line 698 of file input_pin.cpp.

699{
700#ifdef KSPROXY_TRACE
701 OutputDebugStringW(L"CInputPin::ReceiveCanBlock NotImplemented\n");
702#endif
703
704 return S_FALSE;
705}

◆ ReceiveConnection()

HRESULT STDMETHODCALLTYPE CInputPin::ReceiveConnection ( IPin pConnector,
const AM_MEDIA_TYPE pmt 
)

Definition at line 1096 of file input_pin.cpp.

1097{
1098 HRESULT hr;
1099
1100 if (m_Pin)
1101 {
1102 // already connected
1104 }
1105
1106 // first check format
1107 hr = CheckFormat(pmt);
1108 if (FAILED(hr))
1109 {
1110 // format is not supported
1111 return hr;
1112 }
1113
1114 hr = CreatePin(pmt);
1115 if (FAILED(hr))
1116 {
1117 return hr;
1118 }
1119
1120 m_Pin = pConnector;
1121 m_Pin->AddRef();
1122
1123 return S_OK;
1124}
#define VFW_E_ALREADY_CONNECTED
Definition: vfwmsgs.h:43

◆ ReceiveMultiple()

HRESULT STDMETHODCALLTYPE CInputPin::ReceiveMultiple ( IMediaSample **  pSamples,
long  nSamples,
long nSamplesProcessed 
)

Implements IMemInputPin.

Definition at line 687 of file input_pin.cpp.

688{
689#ifdef KSPROXY_TRACE
690 OutputDebugStringW(L"CInputPin::ReceiveMultiple NotImplemented\n");
691#endif
692
693 return E_NOTIMPL;
694}

◆ Render()

HRESULT STDMETHODCALLTYPE CInputPin::Render ( IPin ppinOut,
IGraphBuilder pGraph 
)

Implements IStreamBuilder.

Definition at line 395 of file input_pin.cpp.

398{
399 OutputDebugStringW(L"CInputPin::Render\n");
400 return S_OK;
401}

◆ Set()

HRESULT STDMETHODCALLTYPE CInputPin::Set ( REFGUID  guidPropSet,
DWORD  dwPropID,
LPVOID  pInstanceData,
DWORD  cbInstanceData,
LPVOID  pPropData,
DWORD  cbPropData 
)

Implements IKsPropertySet.

Definition at line 971 of file input_pin.cpp.

978{
980
981 if (cbInstanceData)
982 {
983 PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
984 if (!Property)
985 return E_OUTOFMEMORY;
986
987 Property->Set = guidPropSet;
988 Property->Id = dwPropID;
990
991 CopyMemory((Property+1), pInstanceData, cbInstanceData);
992
993 HRESULT hr = KsProperty(Property, sizeof(KSPROPERTY) + cbInstanceData, pPropData, cbPropData, &BytesReturned);
995 return hr;
996 }
997 else
998 {
1000
1001 Property.Set = guidPropSet;
1002 Property.Id = dwPropID;
1004
1005 HRESULT hr = KsProperty(&Property, sizeof(KSPROPERTY), pPropData, cbPropData, &BytesReturned);
1006 return hr;
1007 }
1008}

◆ SetSink()

HRESULT STDMETHODCALLTYPE CInputPin::SetSink ( IQualityControl piqc)

Implements IQualityControl.

Definition at line 351 of file input_pin.cpp.

353{
354#ifdef KSPROXY_TRACE
355 OutputDebugStringW(L"CInputPin::SetSink NotImplemented\n");
356#endif
357
358 return E_NOTIMPL;
359}

◆ STDMETHODIMP_() [1/2]

CInputPin::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 46 of file input_pin.cpp.

47 {
49 return m_Ref;
50 }

◆ STDMETHODIMP_() [2/2]

CInputPin::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 51 of file input_pin.cpp.

52 {
54 if (!m_Ref)
55 {
56 delete this;
57 return 0;
58 }
59 return m_Ref;
60 }

Member Data Documentation

◆ m_bPinBusCacheInitialized

BOOL CInputPin::m_bPinBusCacheInitialized
protected

Definition at line 174 of file input_pin.cpp.

Referenced by KsGetPinBusCache().

◆ m_Communication

KSPIN_COMMUNICATION CInputPin::m_Communication
protected

Definition at line 165 of file input_pin.cpp.

Referenced by CreatePin(), and KsGetCurrentCommunication().

◆ m_FilterName

LPWSTR CInputPin::m_FilterName
protected

Definition at line 176 of file input_pin.cpp.

Referenced by KsGetFilterName().

◆ m_FramingEx

PKSALLOCATOR_FRAMING_EX CInputPin::m_FramingEx[4]
protected

Definition at line 178 of file input_pin.cpp.

Referenced by CInputPin(), KsGetPinFramingCache(), and KsSetPinFramingCache().

◆ m_FramingProp

FRAMING_PROP CInputPin::m_FramingProp[4]
protected

Definition at line 177 of file input_pin.cpp.

Referenced by CInputPin(), KsGetPinFramingCache(), and KsSetPinFramingCache().

◆ m_hPin

◆ m_Interface

KSPIN_INTERFACE CInputPin::m_Interface
protected

Definition at line 166 of file input_pin.cpp.

Referenced by CreatePinHandle(), and KsGetCurrentCommunication().

◆ m_InterfaceHandler

IKsInterfaceHandler* CInputPin::m_InterfaceHandler
protected

Definition at line 171 of file input_pin.cpp.

Referenced by CreatePin().

◆ m_IoCount

LONG CInputPin::m_IoCount
protected

Definition at line 164 of file input_pin.cpp.

Referenced by KsDecrementPendingIoCount(), and KsIncrementPendingIoCount().

◆ m_KsAllocatorEx

IKsAllocatorEx* CInputPin::m_KsAllocatorEx
protected

Definition at line 172 of file input_pin.cpp.

Referenced by KsGetPipe(), and KsSetPipe().

◆ m_MediaFormat

AM_MEDIA_TYPE CInputPin::m_MediaFormat
protected

Definition at line 168 of file input_pin.cpp.

Referenced by CInputPin(), CreatePinHandle(), KsCreateSinkPinHandle(), and QueryInterface().

◆ m_Medium

KSPIN_MEDIUM CInputPin::m_Medium
protected

Definition at line 167 of file input_pin.cpp.

Referenced by CreatePinHandle(), KsGetCurrentCommunication(), and KsGetPinBusCache().

◆ m_MemAllocator

IMemAllocator* CInputPin::m_MemAllocator
protected

Definition at line 163 of file input_pin.cpp.

Referenced by KsPeekAllocator(), KsReceiveAllocator(), and NotifyAllocator().

◆ m_ParentFilter

IBaseFilter* CInputPin::m_ParentFilter
protected

◆ m_Pin

IPin* CInputPin::m_Pin
protected

◆ m_PinBusCache

GUID CInputPin::m_PinBusCache
protected

Definition at line 175 of file input_pin.cpp.

Referenced by KsGetPinBusCache(), and KsSetPinBusCache().

◆ m_PinId

ULONG CInputPin::m_PinId
protected

◆ m_PinName

LPCWSTR CInputPin::m_PinName
protected

Definition at line 160 of file input_pin.cpp.

Referenced by CreatePin(), KsGetPinName(), QueryId(), and QueryPinInfo().

◆ m_PipeAllocatorFlag

ULONG CInputPin::m_PipeAllocatorFlag
protected

Definition at line 173 of file input_pin.cpp.

Referenced by KsGetPipeAllocatorFlag(), and KsSetPipeAllocatorFlag().

◆ m_Plugins

ProxyPluginVector CInputPin::m_Plugins
protected

Definition at line 179 of file input_pin.cpp.

Referenced by LoadProxyPlugins().

◆ m_ReadOnly

BOOL CInputPin::m_ReadOnly
protected

Definition at line 170 of file input_pin.cpp.

Referenced by NotifyAllocator().

◆ m_Ref

LONG CInputPin::m_Ref
protected

Definition at line 158 of file input_pin.cpp.

Referenced by STDMETHODIMP_().


The documentation for this class was generated from the following file: