ReactOS 0.4.15-dev-7918-g2a2556c
CPin Class Reference
Inheritance diagram for CPin:
Collaboration diagram for CPin:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
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)
 
 CPin (IBaseFilter *ParentFilter)
 
virtual ~CPin ()
 
- 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 ()
 

Static Public Attributes

static LPCWSTR PIN_ID = L"Antenna Out"
 

Protected Attributes

LONG m_Ref
 
IBaseFilterm_ParentFilter
 
AM_MEDIA_TYPE m_MediaType
 
IPinm_Pin
 

Additional Inherited Members

- Public Types inherited from IPin
typedef struct IPin::_PinInfo PIN_INFO
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 16 of file pin.cpp.

Constructor & Destructor Documentation

◆ CPin()

CPin::CPin ( IBaseFilter ParentFilter)

Definition at line 70 of file pin.cpp.

71 : m_Ref(0),
72 m_ParentFilter(ParentFilter),
73 m_Pin(0)
74{
76 m_MediaType.subtype = MEDIASUBTYPE_None;
77 m_MediaType.formattype = FORMAT_None;
78 m_MediaType.bFixedSizeSamples = true;
79 m_MediaType.bTemporalCompression = false;
80 m_MediaType.lSampleSize = sizeof(CHAR);
81 m_MediaType.pUnk = NULL;
82 m_MediaType.cbFormat = 0;
83 m_MediaType.pbFormat = NULL;
84}
#define CHAR(Char)
IBaseFilter * m_ParentFilter
Definition: pin.cpp:61
LONG m_Ref
Definition: pin.cpp:60
AM_MEDIA_TYPE m_MediaType
Definition: pin.cpp:62
IPin * m_Pin
Definition: pin.cpp:63
#define NULL
Definition: types.h:112
const GUID KSDATAFORMAT_TYPE_BDA_ANTENNA
Definition: pin.cpp:12

◆ ~CPin()

virtual CPin::~CPin ( )
inlinevirtual

Definition at line 55 of file pin.cpp.

55{};

Member Function Documentation

◆ BeginFlush()

HRESULT STDMETHODCALLTYPE CPin::BeginFlush ( void  )

Implements IPin.

Definition at line 296 of file pin.cpp.

297{
298 OutputDebugStringW(L"CPin::BeginFlush NotImplemented\n");
299 return E_NOTIMPL;
300}
#define E_NOTIMPL
Definition: ddrawi.h:99
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define L(x)
Definition: ntvdm.h:50

◆ Connect()

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

Definition at line 121 of file pin.cpp.

122{
123 HRESULT hr;
124 OutputDebugStringW(L"CPin::Connect called\n");
125
126 if (pmt)
127 {
128 hr = pReceivePin->QueryAccept(pmt);
129 if (FAILED(hr))
130 {
131 OutputDebugStringW(L"CPin::Connect QueryAccept failed\n");
132 return hr;
133 }
134 }
135 else
136 {
137 // query accept
138 hr = pReceivePin->QueryAccept(&m_MediaType);
139 if (FAILED(hr))
140 {
141 OutputDebugStringW(L"CPin::Connect QueryAccept pmt default failed\n");
142 return hr;
143 }
144
145 pmt = &m_MediaType;
146 }
147
148 // receive connection;
149 hr = pReceivePin->ReceiveConnection((IPin*)this, pmt);
150 if (SUCCEEDED(hr))
151 {
152 // increment reference count
153 pReceivePin->AddRef();
154 m_Pin = pReceivePin;
155 OutputDebugStringW(L"CPin::Connect success\n");
156 }
157
158 return hr;
159}
Definition: axcore.idl:92
HRESULT ReceiveConnection([in] IPin *pConnector, [in] const AM_MEDIA_TYPE *pmt)
HRESULT QueryAccept([in] const AM_MEDIA_TYPE *pmt)
ULONG AddRef()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183

◆ ConnectedTo()

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

Implements IPin.

Definition at line 189 of file pin.cpp.

190{
191#ifdef MSDVBNP_TRACE
192 OutputDebugStringW(L"CPin::ConnectedTo\n");
193#endif
194
195 if (!pPin)
196 return E_POINTER;
197
198 if (m_Pin)
199 {
200 // increment reference count
201 m_Pin->AddRef();
202 *pPin = m_Pin;
203 return S_OK;
204 }
205
206 *pPin = NULL;
207 return VFW_E_NOT_CONNECTED;
208}
#define S_OK
Definition: intsafe.h:52
#define VFW_E_NOT_CONNECTED
Definition: vfwmsgs.h:48
#define E_POINTER
Definition: winerror.h:2365

◆ ConnectionMediaType()

HRESULT STDMETHODCALLTYPE CPin::ConnectionMediaType ( AM_MEDIA_TYPE pmt)

Definition at line 211 of file pin.cpp.

212{
213 OutputDebugStringW(L"CPin::ConnectionMediaType NotImplemented\n");
214 return E_NOTIMPL;
215}

◆ Disconnect()

HRESULT STDMETHODCALLTYPE CPin::Disconnect ( void  )

Implements IPin.

Definition at line 170 of file pin.cpp.

171{
172#ifdef MSDVBNP_TRACE
173 OutputDebugStringW(L"CPin::Disconnect\n");
174#endif
175
176 if (!m_Pin)
177 {
178 // pin was not connected
179 return S_FALSE;
180 }
181
182 m_Pin->Release();
183 m_Pin = NULL;
184
185 return S_OK;
186}
ULONG Release()
#define S_FALSE
Definition: winerror.h:2357

◆ EndFlush()

HRESULT STDMETHODCALLTYPE CPin::EndFlush ( void  )

Implements IPin.

Definition at line 303 of file pin.cpp.

304{
305 OutputDebugStringW(L"CPin::EndFlush NotImplemented\n");
306 return E_NOTIMPL;
307}

◆ EndOfStream()

HRESULT STDMETHODCALLTYPE CPin::EndOfStream ( void  )

Implements IPin.

Definition at line 289 of file pin.cpp.

290{
291 OutputDebugStringW(L"CPin::EndOfStream NotImplemented\n");
292 return E_NOTIMPL;
293}

◆ EnumMediaTypes()

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

Implements IPin.

Definition at line 259 of file pin.cpp.

260{
262
263 if (!MediaType)
264 {
265 return E_OUTOFMEMORY;
266 }
267
268 MediaType->majortype = KSDATAFORMAT_TYPE_BDA_ANTENNA;
269 MediaType->subtype = MEDIASUBTYPE_None;
270 MediaType->formattype = FORMAT_None;
271 MediaType->bFixedSizeSamples = true;
272 MediaType->bTemporalCompression = false;
273 MediaType->lSampleSize = sizeof(CHAR);
274 MediaType->pUnk = NULL;
275 MediaType->cbFormat = 0;
276 MediaType->pbFormat = NULL;
277
278 return CEnumMediaTypes_fnConstructor(NULL, 1, MediaType, IID_IEnumMediaTypes, (void**)ppEnum);
279}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
HRESULT WINAPI CEnumMediaTypes_fnConstructor(ULONG MediaTypeCount, AM_MEDIA_TYPE *MediaTypes, REFIID riid, LPVOID *ppv)

◆ NewSegment()

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

Implements IPin.

Definition at line 310 of file pin.cpp.

311{
312 OutputDebugStringW(L"CPin::NewSegment NotImplemented\n");
313 return E_NOTIMPL;
314}

◆ QueryAccept()

HRESULT STDMETHODCALLTYPE CPin::QueryAccept ( const AM_MEDIA_TYPE pmt)

Definition at line 252 of file pin.cpp.

253{
254 OutputDebugStringW(L"CPin::QueryAccept NotImplemented\n");
255 return E_NOTIMPL;
256}

◆ QueryDirection()

HRESULT STDMETHODCALLTYPE CPin::QueryDirection ( PIN_DIRECTION pPinDir)

Implements IPin.

Definition at line 229 of file pin.cpp.

230{
231 if (pPinDir)
232 {
233 *pPinDir = PINDIR_OUTPUT;
234 return S_OK;
235 }
236
237 return E_POINTER;
238}
@ PINDIR_OUTPUT
Definition: axcore.idl:42

◆ QueryId()

HRESULT STDMETHODCALLTYPE CPin::QueryId ( LPWSTR Id)

Implements IPin.

Definition at line 241 of file pin.cpp.

242{
243 *Id = (LPWSTR)CoTaskMemAlloc(sizeof(PIN_ID));
244 if (!*Id)
245 return E_OUTOFMEMORY;
246
247 wcscpy(*Id, PIN_ID);
248 return S_OK;
249}
DWORD Id
static LPCWSTR PIN_ID
Definition: pin.cpp:57
_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 CPin::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

Definition at line 89 of file pin.cpp.

92{
93 if (IsEqualGUID(refiid, IID_IUnknown))
94 {
95 *Output = PVOID(this);
96 reinterpret_cast<IUnknown*>(*Output)->AddRef();
97 return NOERROR;
98 }
99 if (IsEqualGUID(refiid, IID_IPin))
100 {
101 *Output = (IPin*)(this);
102 reinterpret_cast<IPin*>(*Output)->AddRef();
103 return NOERROR;
104 }
105
108 StringFromCLSID(refiid, &lpstr);
109 swprintf(Buffer, L"CPin::QueryInterface: NoInterface for %s\n", lpstr);
112
113 return E_NOINTERFACE;
114}
const GUID IID_IUnknown
Definition: bufpool.h:45
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
#define swprintf
Definition: precomp.h:40
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
static LPCSTR lpstr
Definition: font.c:51
static LPOLESTR
Definition: stg_prop.c:27
const GUID IID_IPin
Definition: pincontrol.cpp:15
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
@ Output
Definition: arc.h:85
void * PVOID
Definition: typedefs.h:50
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ QueryInternalConnections()

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

Implements IPin.

Definition at line 282 of file pin.cpp.

283{
284 OutputDebugStringW(L"CPin::QueryInternalConnections NotImplemented\n");
285 return E_NOTIMPL;
286}

◆ QueryPinInfo()

HRESULT STDMETHODCALLTYPE CPin::QueryPinInfo ( PIN_INFO pInfo)

Implements IPin.

Definition at line 218 of file pin.cpp.

219{
220 wcscpy(pInfo->achName, PIN_ID);
221 pInfo->dir = PINDIR_OUTPUT;
222 pInfo->pFilter = m_ParentFilter;
224
225 return S_OK;
226}

◆ ReceiveConnection()

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

Definition at line 163 of file pin.cpp.

164{
165 return E_UNEXPECTED;
166}
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ STDMETHODIMP_() [1/2]

CPin::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 21 of file pin.cpp.

22 {
24 return m_Ref;
25 }
#define InterlockedIncrement
Definition: armddk.h:53

◆ STDMETHODIMP_() [2/2]

CPin::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 26 of file pin.cpp.

27 {
29 if (!m_Ref)
30 {
31 delete this;
32 return 0;
33 }
34 return m_Ref;
35 }
#define InterlockedDecrement
Definition: armddk.h:52

Member Data Documentation

◆ m_MediaType

AM_MEDIA_TYPE CPin::m_MediaType
protected

Definition at line 62 of file pin.cpp.

Referenced by Connect(), and CPin().

◆ m_ParentFilter

IBaseFilter* CPin::m_ParentFilter
protected

Definition at line 61 of file pin.cpp.

Referenced by QueryPinInfo().

◆ m_Pin

IPin* CPin::m_Pin
protected

Definition at line 63 of file pin.cpp.

Referenced by Connect(), ConnectedTo(), and Disconnect().

◆ m_Ref

LONG CPin::m_Ref
protected

Definition at line 60 of file pin.cpp.

Referenced by STDMETHODIMP_().

◆ PIN_ID

LPCWSTR CPin::PIN_ID = L"Antenna Out"
static

Definition at line 57 of file pin.cpp.

Referenced by QueryId(), and QueryPinInfo().


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