ReactOS 0.4.16-dev-112-g52265ae
transform.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "amvideo.h"
#include "strmif.h"
#include "vfw.h"
#include <assert.h>
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/strmbase.h"
#include "strmbase_private.h"
Include dependency graph for transform.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (strmbase)
 
static BaseInputPinimpl_BaseInputPin_from_BasePin (BasePin *iface)
 
static BasePinimpl_BasePin_from_IPin (IPin *iface)
 
static BaseInputPinimpl_BaseInputPin_from_IPin (IPin *iface)
 
static BaseOutputPinimpl_BaseOutputPin_from_IPin (IPin *iface)
 
static TransformFilterimpl_from_IBaseFilter (IBaseFilter *iface)
 
static TransformFilterimpl_from_BaseFilter (BaseFilter *iface)
 
static HRESULT WINAPI TransformFilter_Input_CheckMediaType (BasePin *iface, const AM_MEDIA_TYPE *pmt)
 
static HRESULT WINAPI TransformFilter_Input_Receive (BaseInputPin *This, IMediaSample *pInSample)
 
static HRESULT WINAPI TransformFilter_Output_QueryAccept (IPin *iface, const AM_MEDIA_TYPE *pmt)
 
static HRESULT WINAPI TransformFilter_Output_DecideBufferSize (BaseOutputPin *This, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
 
static HRESULT WINAPI TransformFilter_Output_GetMediaType (BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt)
 
static IPin *WINAPI TransformFilter_GetPin (BaseFilter *iface, int pos)
 
static LONG WINAPI TransformFilter_GetPinCount (BaseFilter *iface)
 
static HRESULT TransformFilter_Init (const IBaseFilterVtbl *pVtbl, const CLSID *pClsid, const TransformFilterFuncTable *pFuncsTable, TransformFilter *pTransformFilter)
 
HRESULT TransformFilter_Construct (const IBaseFilterVtbl *pVtbl, LONG filter_size, const CLSID *pClsid, const TransformFilterFuncTable *pFuncsTable, IBaseFilter **ppTransformFilter)
 
HRESULT WINAPI TransformFilterImpl_QueryInterface (IBaseFilter *iface, REFIID riid, LPVOID *ppv)
 
ULONG WINAPI TransformFilterImpl_Release (IBaseFilter *iface)
 
HRESULT WINAPI TransformFilterImpl_Stop (IBaseFilter *iface)
 
HRESULT WINAPI TransformFilterImpl_Pause (IBaseFilter *iface)
 
HRESULT WINAPI TransformFilterImpl_Run (IBaseFilter *iface, REFERENCE_TIME tStart)
 
HRESULT WINAPI TransformFilterImpl_Notify (TransformFilter *iface, IBaseFilter *sender, Quality qm)
 
HRESULT WINAPI TransformFilterImpl_FindPin (IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
 
static HRESULT WINAPI TransformFilter_InputPin_EndOfStream (IPin *iface)
 
static HRESULT WINAPI TransformFilter_InputPin_ReceiveConnection (IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
 
static HRESULT WINAPI TransformFilter_InputPin_Disconnect (IPin *iface)
 
static HRESULT WINAPI TransformFilter_InputPin_BeginFlush (IPin *iface)
 
static HRESULT WINAPI TransformFilter_InputPin_EndFlush (IPin *iface)
 
static HRESULT WINAPI TransformFilter_InputPin_NewSegment (IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
 
static HRESULT WINAPI TransformFilter_QualityControlImpl_Notify (IQualityControl *iface, IBaseFilter *sender, Quality qm)
 

Variables

static const WCHAR wcsInputPinName [] = {'i','n','p','u','t',' ','p','i','n',0}
 
static const WCHAR wcsOutputPinName [] = {'o','u','t','p','u','t',' ','p','i','n',0}
 
static const IPinVtbl TransformFilter_InputPin_Vtbl
 
static const IPinVtbl TransformFilter_OutputPin_Vtbl
 
static const IQualityControlVtbl TransformFilter_QualityControl_Vtbl
 
static const BaseFilterFuncTable tfBaseFuncTable
 
static const BaseInputPinFuncTable tf_input_BaseInputFuncTable
 
static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file transform.c.

Function Documentation

◆ impl_BaseInputPin_from_BasePin()

static BaseInputPin * impl_BaseInputPin_from_BasePin ( BasePin iface)
inlinestatic

Definition at line 49 of file transform.c.

50{
51 return CONTAINING_RECORD(iface, BaseInputPin, pin);
52}
Definition: regsvr.c:104
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by TransformFilter_Input_CheckMediaType().

◆ impl_BaseInputPin_from_IPin()

◆ impl_BaseOutputPin_from_IPin()

static BaseOutputPin * impl_BaseOutputPin_from_IPin ( IPin iface)
inlinestatic

Definition at line 64 of file transform.c.

65{
66 return CONTAINING_RECORD(iface, BaseOutputPin, pin.IPin_iface);
67}

Referenced by TransformFilterImpl_Run(), and TransformFilterImpl_Stop().

◆ impl_BasePin_from_IPin()

static BasePin * impl_BasePin_from_IPin ( IPin iface)
inlinestatic

Definition at line 54 of file transform.c.

55{
56 return CONTAINING_RECORD(iface, BasePin, IPin_iface);
57}

Referenced by TransformFilter_Output_QueryAccept().

◆ impl_from_BaseFilter()

static TransformFilter * impl_from_BaseFilter ( BaseFilter iface)
inlinestatic

Definition at line 74 of file transform.c.

75{
77}
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005

Referenced by TransformFilter_GetPin(), and TransformFilter_GetPinCount().

◆ impl_from_IBaseFilter()

◆ TransformFilter_Construct()

HRESULT TransformFilter_Construct ( const IBaseFilterVtbl *  pVtbl,
LONG  filter_size,
const CLSID pClsid,
const TransformFilterFuncTable pFuncsTable,
IBaseFilter **  ppTransformFilter 
)

Definition at line 263 of file transform.c.

264{
265 TransformFilter* pTf;
266
267 *ppTransformFilter = NULL;
268
269 assert(filter_size >= sizeof(TransformFilter));
270
271 pTf = CoTaskMemAlloc(filter_size);
272
273 if (!pTf)
274 return E_OUTOFMEMORY;
275
276 ZeroMemory(pTf, filter_size);
277
278 if (SUCCEEDED(TransformFilter_Init(pVtbl, pClsid, pFuncsTable, pTf)))
279 {
280 *ppTransformFilter = &pTf->filter.IBaseFilter_iface;
281 return S_OK;
282 }
283
284 CoTaskMemFree(pTf);
285 return E_FAIL;
286}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define assert(x)
Definition: debug.h:53
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HRESULT TransformFilter_Init(const IBaseFilterVtbl *pVtbl, const CLSID *pClsid, const TransformFilterFuncTable *pFuncsTable, TransformFilter *pTransformFilter)
Definition: transform.c:199
IBaseFilter IBaseFilter_iface
Definition: strmbase.h:163
BaseFilter filter
Definition: strmbase.h:213
#define ZeroMemory
Definition: winbase.h:1712

Referenced by ACMWrapper_create(), and AVIDec_create().

◆ TransformFilter_GetPin()

static IPin *WINAPI TransformFilter_GetPin ( BaseFilter iface,
int  pos 
)
static

Definition at line 154 of file transform.c.

155{
157
158 if (pos >= This->npins || pos < 0)
159 return NULL;
160
161 IPin_AddRef(This->ppPins[pos]);
162 return This->ppPins[pos];
163}
static TransformFilter * impl_from_BaseFilter(BaseFilter *iface)
Definition: transform.c:74

◆ TransformFilter_GetPinCount()

static LONG WINAPI TransformFilter_GetPinCount ( BaseFilter iface)
static

Definition at line 165 of file transform.c.

166{
168
169 return (This->npins+1);
170}

◆ TransformFilter_Init()

static HRESULT TransformFilter_Init ( const IBaseFilterVtbl *  pVtbl,
const CLSID pClsid,
const TransformFilterFuncTable pFuncsTable,
TransformFilter pTransformFilter 
)
static

Definition at line 199 of file transform.c.

200{
201 HRESULT hr;
202 PIN_INFO piInput;
203 PIN_INFO piOutput;
204
205 BaseFilter_Init(&pTransformFilter->filter, pVtbl, pClsid, (DWORD_PTR)(__FILE__ ": TransformFilter.csFilter"), &tfBaseFuncTable);
206
207 InitializeCriticalSection(&pTransformFilter->csReceive);
208 pTransformFilter->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": TransformFilter.csReceive");
209
210 /* pTransformFilter is already allocated */
211 pTransformFilter->pFuncsTable = pFuncsTable;
212 ZeroMemory(&pTransformFilter->pmt, sizeof(pTransformFilter->pmt));
213 pTransformFilter->npins = 2;
214
215 pTransformFilter->ppPins = CoTaskMemAlloc(2 * sizeof(IPin *));
216
217 /* construct input pin */
218 piInput.dir = PINDIR_INPUT;
219 piInput.pFilter = &pTransformFilter->filter.IBaseFilter_iface;
220 lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
221 piOutput.dir = PINDIR_OUTPUT;
222 piOutput.pFilter = &pTransformFilter->filter.IBaseFilter_iface;
223 lstrcpynW(piOutput.achName, wcsOutputPinName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0]));
224
226 &tf_input_BaseInputFuncTable, &pTransformFilter->filter.csFilter, NULL, &pTransformFilter->ppPins[0]);
227
228 if (SUCCEEDED(hr))
229 {
230 hr = BaseOutputPin_Construct(&TransformFilter_OutputPin_Vtbl, sizeof(BaseOutputPin), &piOutput, &tf_output_BaseOutputFuncTable, &pTransformFilter->filter.csFilter, &pTransformFilter->ppPins[1]);
231
232 if (FAILED(hr))
233 ERR("Cannot create output pin (%x)\n", hr);
234 else {
235 QualityControlImpl_Create( pTransformFilter->ppPins[0], &pTransformFilter->filter.IBaseFilter_iface, &pTransformFilter->qcimpl);
236 pTransformFilter->qcimpl->IQualityControl_iface.lpVtbl = &TransformFilter_QualityControl_Vtbl;
237 }
238 }
239
240 if (SUCCEEDED(hr))
241 {
242 ISeekingPassThru *passthru;
243 pTransformFilter->seekthru_unk = NULL;
244 hr = CoCreateInstance(&CLSID_SeekingPassThru, (IUnknown *)&pTransformFilter->filter.IBaseFilter_iface, CLSCTX_INPROC_SERVER,
245 &IID_IUnknown, (void **)&pTransformFilter->seekthru_unk);
246 if (SUCCEEDED(hr))
247 {
248 IUnknown_QueryInterface(pTransformFilter->seekthru_unk, &IID_ISeekingPassThru, (void**)&passthru);
249 ISeekingPassThru_Init(passthru, FALSE, pTransformFilter->ppPins[0]);
250 ISeekingPassThru_Release(passthru);
251 }
252 }
253
254 if (FAILED(hr))
255 {
256 CoTaskMemFree(pTransformFilter->ppPins);
258 }
259
260 return hr;
261}
@ PINDIR_OUTPUT
Definition: axcore.idl:42
@ PINDIR_INPUT
Definition: axcore.idl:41
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define FALSE
Definition: types.h:117
#define lstrcpynW
Definition: compat.h:738
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
Definition: axcore.idl:92
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv)
static const IQualityControlVtbl TransformFilter_QualityControl_Vtbl
Definition: transform.c:47
static const BaseInputPinFuncTable tf_input_BaseInputFuncTable
Definition: transform.c:177
static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable
Definition: transform.c:187
static const BaseFilterFuncTable tfBaseFuncTable
Definition: transform.c:172
static const WCHAR wcsOutputPinName[]
Definition: transform.c:43
static const IPinVtbl TransformFilter_OutputPin_Vtbl
Definition: transform.c:46
static const IPinVtbl TransformFilter_InputPin_Vtbl
Definition: transform.c:45
static const WCHAR wcsInputPinName[]
Definition: transform.c:42
HRESULT hr
Definition: shlfolder.c:183
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter *iface)
Definition: filter.c:64
HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO *pPinInfo, const BaseInputPinFuncTable *pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin **ppPin)
Definition: pin.c:1189
HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO *pPinInfo, const BaseOutputPinFuncTable *pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin **ppPin)
Definition: pin.c:791
HRESULT WINAPI BaseFilter_Init(BaseFilter *This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable *pBaseFuncsTable)
Definition: filter.c:196
CRITICAL_SECTION csFilter
Definition: strmbase.h:165
IPin ** ppPins
Definition: strmbase.h:215
const struct TransformFilterFuncTable * pFuncsTable
Definition: strmbase.h:220
struct QualityControlImpl * qcimpl
Definition: strmbase.h:221
CRITICAL_SECTION csReceive
Definition: strmbase.h:218
AM_MEDIA_TYPE pmt
Definition: strmbase.h:217
IUnknown * seekthru_unk
Definition: strmbase.h:223
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:887
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:894
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76
uint32_t DWORD_PTR
Definition: typedefs.h:65

Referenced by TransformFilter_Construct().

◆ TransformFilter_Input_CheckMediaType()

static HRESULT WINAPI TransformFilter_Input_CheckMediaType ( BasePin iface,
const AM_MEDIA_TYPE pmt 
)
static

Definition at line 79 of file transform.c.

80{
82 TransformFilter * pTransform;
83
84 TRACE("%p\n", iface);
85 pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
86
87 if (pTransform->pFuncsTable->pfnCheckInputType)
88 return pTransform->pFuncsTable->pfnCheckInputType(pTransform, pmt);
89 /* Assume OK if there's no query method (the connection will fail if
90 needed) */
91 return S_OK;
92}
static TransformFilter * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: transform.c:69
static BaseInputPin * impl_BaseInputPin_from_BasePin(BasePin *iface)
Definition: transform.c:49
#define TRACE(s)
Definition: solgame.cpp:4

◆ TransformFilter_Input_Receive()

static HRESULT WINAPI TransformFilter_Input_Receive ( BaseInputPin This,
IMediaSample pInSample 
)
static

Definition at line 94 of file transform.c.

95{
96 HRESULT hr;
97 TransformFilter * pTransform;
98 TRACE("%p\n", This);
99 pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
100
101 EnterCriticalSection(&pTransform->csReceive);
102 if (pTransform->filter.state == State_Stopped)
103 {
104 LeaveCriticalSection(&pTransform->csReceive);
105 return VFW_E_WRONG_STATE;
106 }
107
108 if (This->end_of_stream || This->flushing)
109 {
110 LeaveCriticalSection(&pTransform->csReceive);
111 return S_FALSE;
112 }
113
114 LeaveCriticalSection(&pTransform->csReceive);
115 if (pTransform->pFuncsTable->pfnReceive)
116 hr = pTransform->pFuncsTable->pfnReceive(pTransform, pInSample);
117 else
118 hr = S_FALSE;
119
120 return hr;
121}
FILTER_STATE state
Definition: strmbase.h:167
#define VFW_E_WRONG_STATE
Definition: vfwmsgs.h:78
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define S_FALSE
Definition: winerror.h:2357

◆ TransformFilter_InputPin_BeginFlush()

static HRESULT WINAPI TransformFilter_InputPin_BeginFlush ( IPin iface)
static

Definition at line 507 of file transform.c.

508{
510 TransformFilter* pTransform;
511 HRESULT hr = S_OK;
512
513 TRACE("(%p)->()\n", iface);
514
515 pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
517 if (pTransform->pFuncsTable->pfnBeginFlush)
518 hr = pTransform->pFuncsTable->pfnBeginFlush(pTransform);
519 if (SUCCEEDED(hr))
522 return hr;
523}
static BaseInputPin * impl_BaseInputPin_from_IPin(IPin *iface)
Definition: transform.c:59
HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin *iface)
Definition: pin.c:968

◆ TransformFilter_InputPin_Disconnect()

static HRESULT WINAPI TransformFilter_InputPin_Disconnect ( IPin iface)
static

Definition at line 493 of file transform.c.

494{
496 TransformFilter* pTransform;
497
498 TRACE("(%p)->()\n", iface);
499
500 pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
501 if (pTransform->pFuncsTable->pfnBreakConnect)
502 pTransform->pFuncsTable->pfnBreakConnect(pTransform, PINDIR_INPUT);
503
504 return BasePinImpl_Disconnect(iface);
505}
HRESULT WINAPI BasePinImpl_Disconnect(IPin *iface)
Definition: pin.c:197

◆ TransformFilter_InputPin_EndFlush()

static HRESULT WINAPI TransformFilter_InputPin_EndFlush ( IPin iface)
static

Definition at line 525 of file transform.c.

526{
528 TransformFilter* pTransform;
529 HRESULT hr = S_OK;
530
531 TRACE("(%p)->()\n", iface);
532
533 pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
535 if (pTransform->pFuncsTable->pfnEndFlush)
536 hr = pTransform->pFuncsTable->pfnEndFlush(pTransform);
537 if (SUCCEEDED(hr))
540 return hr;
541}
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin *iface)
Definition: pin.c:988

◆ TransformFilter_InputPin_EndOfStream()

static HRESULT WINAPI TransformFilter_InputPin_EndOfStream ( IPin iface)
static

Definition at line 441 of file transform.c.

442{
444 TransformFilter* pTransform;
445 IPin* ppin;
446 HRESULT hr;
447
448 TRACE("(%p)->()\n", iface);
449
450 /* Since we process samples synchronously, just forward notification downstream */
451 pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
452 if (!pTransform)
453 hr = E_FAIL;
454 else
455 hr = IPin_ConnectedTo(pTransform->ppPins[1], &ppin);
456 if (SUCCEEDED(hr))
457 {
458 hr = IPin_EndOfStream(ppin);
459 IPin_Release(ppin);
460 }
461
462 if (FAILED(hr))
463 ERR("%x\n", hr);
464 return hr;
465}

◆ TransformFilter_InputPin_NewSegment()

static HRESULT WINAPI TransformFilter_InputPin_NewSegment ( IPin iface,
REFERENCE_TIME  tStart,
REFERENCE_TIME  tStop,
double  dRate 
)
static

Definition at line 543 of file transform.c.

544{
546 TransformFilter* pTransform;
547 HRESULT hr = S_OK;
548
549 TRACE("(%p)->(%s %s %e)\n", iface, wine_dbgstr_longlong(tStart), wine_dbgstr_longlong(tStop), dRate);
550
551 pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
553 if (pTransform->pFuncsTable->pfnNewSegment)
554 hr = pTransform->pFuncsTable->pfnNewSegment(pTransform, tStart, tStop, dRate);
555 if (SUCCEEDED(hr))
556 hr = BaseInputPinImpl_NewSegment(iface, tStart, tStop, dRate);
558 return hr;
559}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
Definition: pin.c:1015

◆ TransformFilter_InputPin_ReceiveConnection()

static HRESULT WINAPI TransformFilter_InputPin_ReceiveConnection ( IPin iface,
IPin pReceivePin,
const AM_MEDIA_TYPE pmt 
)
static

Definition at line 467 of file transform.c.

468{
470 TransformFilter* pTransform;
471 HRESULT hr = S_OK;
472
473 TRACE("(%p)->(%p, %p)\n", iface, pReceivePin, pmt);
474
475 pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
476
477 if (pTransform->pFuncsTable->pfnSetMediaType)
478 hr = pTransform->pFuncsTable->pfnSetMediaType(pTransform, PINDIR_INPUT, pmt);
479
480 if (SUCCEEDED(hr) && pTransform->pFuncsTable->pfnCompleteConnect)
481 hr = pTransform->pFuncsTable->pfnCompleteConnect(pTransform, PINDIR_INPUT, pReceivePin);
482
483 if (SUCCEEDED(hr))
484 {
485 hr = BaseInputPinImpl_ReceiveConnection(iface, pReceivePin, pmt);
486 if (FAILED(hr) && pTransform->pFuncsTable->pfnBreakConnect)
487 pTransform->pFuncsTable->pfnBreakConnect(pTransform, PINDIR_INPUT);
488 }
489
490 return hr;
491}
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:889

◆ TransformFilter_Output_DecideBufferSize()

static HRESULT WINAPI TransformFilter_Output_DecideBufferSize ( BaseOutputPin This,
IMemAllocator pAlloc,
ALLOCATOR_PROPERTIES ppropInputRequest 
)
static

Definition at line 136 of file transform.c.

137{
138 TransformFilter *pTransformFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
139 return pTransformFilter->pFuncsTable->pfnDecideBufferSize(pTransformFilter, pAlloc, ppropInputRequest);
140}

◆ TransformFilter_Output_GetMediaType()

static HRESULT WINAPI TransformFilter_Output_GetMediaType ( BasePin This,
int  iPosition,
AM_MEDIA_TYPE pmt 
)
static

Definition at line 142 of file transform.c.

143{
144 TransformFilter *pTransform = impl_from_IBaseFilter(This->pinInfo.pFilter);
145
146 if (iPosition < 0)
147 return E_INVALIDARG;
148 if (iPosition > 0)
149 return VFW_S_NO_MORE_ITEMS;
150 CopyMediaType(pmt, &pTransform->pmt);
151 return S_OK;
152}
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
Definition: filtergraph.c:706
#define VFW_S_NO_MORE_ITEMS
Definition: vfwmsgs.h:19

◆ TransformFilter_Output_QueryAccept()

static HRESULT WINAPI TransformFilter_Output_QueryAccept ( IPin iface,
const AM_MEDIA_TYPE pmt 
)
static

Definition at line 123 of file transform.c.

124{
126 TransformFilter *pTransformFilter = impl_from_IBaseFilter(This->pinInfo.pFilter);
127 AM_MEDIA_TYPE* outpmt = &pTransformFilter->pmt;
128 TRACE("%p\n", iface);
129
130 if (IsEqualIID(&pmt->majortype, &outpmt->majortype)
131 && (IsEqualIID(&pmt->subtype, &outpmt->subtype) || IsEqualIID(&outpmt->subtype, &GUID_NULL)))
132 return S_OK;
133 return S_FALSE;
134}
#define GUID_NULL
Definition: ks.h:106
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
static BasePin * impl_BasePin_from_IPin(IPin *iface)
Definition: transform.c:54

◆ TransformFilter_QualityControlImpl_Notify()

static HRESULT WINAPI TransformFilter_QualityControlImpl_Notify ( IQualityControl iface,
IBaseFilter sender,
Quality  qm 
)
static

Definition at line 605 of file transform.c.

605 {
608
609 if (This->pFuncsTable->pfnNotify)
610 return This->pFuncsTable->pfnNotify(This, sender, qm);
611 else
612 return TransformFilterImpl_Notify(This, sender, qm);
613}
HRESULT WINAPI TransformFilterImpl_Notify(TransformFilter *iface, IBaseFilter *sender, Quality qm)
Definition: transform.c:425
IBaseFilter * self

◆ TransformFilterImpl_FindPin()

HRESULT WINAPI TransformFilterImpl_FindPin ( IBaseFilter iface,
LPCWSTR  Id,
IPin **  ppPin 
)

IBaseFilter implementation

Definition at line 432 of file transform.c.

433{
435
436 TRACE("(%p/%p)->(%s,%p)\n", This, iface, debugstr_w(Id), ppPin);
437
438 return E_NOTIMPL;
439}
DWORD Id
#define E_NOTIMPL
Definition: ddrawi.h:99
#define debugstr_w
Definition: kernel32.h:32

◆ TransformFilterImpl_Notify()

HRESULT WINAPI TransformFilterImpl_Notify ( TransformFilter iface,
IBaseFilter sender,
Quality  qm 
)

Definition at line 425 of file transform.c.

426{
427 return QualityControlImpl_Notify((IQualityControl*)iface->qcimpl, sender, qm);
428}
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)

Referenced by TransformFilter_QualityControlImpl_Notify().

◆ TransformFilterImpl_Pause()

HRESULT WINAPI TransformFilterImpl_Pause ( IBaseFilter iface)

Definition at line 374 of file transform.c.

375{
377 HRESULT hr;
378
379 TRACE("(%p/%p)->()\n", This, iface);
380
381 EnterCriticalSection(&This->csReceive);
382 {
383 if (This->filter.state == State_Stopped)
384 hr = IBaseFilter_Run(iface, -1);
385 else
386 hr = S_OK;
387
388 if (SUCCEEDED(hr))
389 This->filter.state = State_Paused;
390 }
391 LeaveCriticalSection(&This->csReceive);
392
393 return hr;
394}

◆ TransformFilterImpl_QueryInterface()

HRESULT WINAPI TransformFilterImpl_QueryInterface ( IBaseFilter iface,
REFIID  riid,
LPVOID ppv 
)

Definition at line 288 of file transform.c.

289{
290 HRESULT hr;
292 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
293
294 if (IsEqualIID(riid, &IID_IQualityControl)) {
295 *ppv = (IQualityControl*)This->qcimpl;
296 IUnknown_AddRef((IUnknown*)*ppv);
297 return S_OK;
298 }
299 else if (IsEqualIID(riid, &IID_IMediaSeeking) ||
300 IsEqualIID(riid, &IID_IMediaPosition))
301 {
302 return IUnknown_QueryInterface(This->seekthru_unk, riid, ppv);
303 }
305
306 if (FAILED(hr) && !IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow) &&
307 !IsEqualIID(riid, &IID_IAMFilterMiscFlags))
308 FIXME("No interface for %s!\n", debugstr_guid(riid));
309
310 return hr;
311}
#define FIXME(fmt,...)
Definition: precomp.h:53
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IPin
Definition: pincontrol.cpp:15
HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: filter.c:37

◆ TransformFilterImpl_Release()

ULONG WINAPI TransformFilterImpl_Release ( IBaseFilter iface)

Definition at line 313 of file transform.c.

314{
316 ULONG refCount = InterlockedDecrement(&This->filter.refCount);
317
318 TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
319
320 if (!refCount)
321 {
322 ULONG i;
323
324 for (i = 0; i < This->npins; i++)
325 {
326 IPin *pConnectedTo;
327
328 if (SUCCEEDED(IPin_ConnectedTo(This->ppPins[i], &pConnectedTo)))
329 {
330 IPin_Disconnect(pConnectedTo);
331 IPin_Release(pConnectedTo);
332 }
333 IPin_Disconnect(This->ppPins[i]);
334
335 IPin_Release(This->ppPins[i]);
336 }
337
338 CoTaskMemFree(This->ppPins);
339
340 TRACE("Destroying transform filter\n");
341 This->csReceive.DebugInfo->Spare[0] = 0;
342 DeleteCriticalSection(&This->csReceive);
343 FreeMediaType(&This->pmt);
345 IUnknown_Release(This->seekthru_unk);
346 BaseFilter_Destroy(&This->filter);
348 }
349 return refCount;
350}
#define InterlockedDecrement
Definition: armddk.h:52
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void FreeMediaType(AM_MEDIA_TYPE *pMediaType)
Definition: filtergraph.c:692
void QualityControlImpl_Destroy(QualityControlImpl *This)
HRESULT WINAPI BaseFilter_Destroy(BaseFilter *This)
Definition: filter.c:214
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

◆ TransformFilterImpl_Run()

HRESULT WINAPI TransformFilterImpl_Run ( IBaseFilter iface,
REFERENCE_TIME  tStart 
)

Definition at line 396 of file transform.c.

397{
398 HRESULT hr = S_OK;
400
401 TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
402
403 EnterCriticalSection(&This->csReceive);
404 {
405 if (This->filter.state == State_Stopped)
406 {
408 if (This->pFuncsTable->pfnStartStreaming)
409 hr = This->pFuncsTable->pfnStartStreaming(This);
410 if (SUCCEEDED(hr))
412 }
413
414 if (SUCCEEDED(hr))
415 {
416 This->filter.rtStreamStart = tStart;
417 This->filter.state = State_Running;
418 }
419 }
420 LeaveCriticalSection(&This->csReceive);
421
422 return hr;
423}
static BaseOutputPin * impl_BaseOutputPin_from_IPin(IPin *iface)
Definition: transform.c:64
HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This)
Definition: pin.c:614
BOOL end_of_stream
Definition: strmbase.h:94

◆ TransformFilterImpl_Stop()

HRESULT WINAPI TransformFilterImpl_Stop ( IBaseFilter iface)

IMediaFilter methods

Definition at line 354 of file transform.c.

355{
357 HRESULT hr = S_OK;
358
359 TRACE("(%p/%p)\n", This, iface);
360
361 EnterCriticalSection(&This->csReceive);
362 {
363 This->filter.state = State_Stopped;
364 if (This->pFuncsTable->pfnStopStreaming)
365 hr = This->pFuncsTable->pfnStopStreaming(This);
366 if (SUCCEEDED(hr))
368 }
369 LeaveCriticalSection(&This->csReceive);
370
371 return hr;
372}
HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This)
Definition: pin.c:634

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( strmbase  )

Variable Documentation

◆ tf_input_BaseInputFuncTable

const BaseInputPinFuncTable tf_input_BaseInputFuncTable
static
Initial value:
= {
{
},
}
static HRESULT WINAPI TransformFilter_Input_CheckMediaType(BasePin *iface, const AM_MEDIA_TYPE *pmt)
Definition: transform.c:79
static HRESULT WINAPI TransformFilter_Input_Receive(BaseInputPin *This, IMediaSample *pInSample)
Definition: transform.c:94
LONG WINAPI BasePinImpl_GetMediaTypeVersion(BasePin *This)
Definition: pin.c:182
HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt)
Definition: pin.c:175

Definition at line 177 of file transform.c.

Referenced by TransformFilter_Init().

◆ tf_output_BaseOutputFuncTable

const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable
static
Initial value:
= {
{
},
}
static HRESULT WINAPI TransformFilter_Output_DecideBufferSize(BaseOutputPin *This, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
Definition: transform.c:136
static HRESULT WINAPI TransformFilter_Output_GetMediaType(BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt)
Definition: transform.c:142
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:712
HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc)
Definition: pin.c:683
HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin *This)
Definition: pin.c:654

Definition at line 187 of file transform.c.

Referenced by TransformFilter_Init().

◆ tfBaseFuncTable

const BaseFilterFuncTable tfBaseFuncTable
static
Initial value:
= {
}
static LONG WINAPI TransformFilter_GetPinCount(BaseFilter *iface)
Definition: transform.c:165
static IPin *WINAPI TransformFilter_GetPin(BaseFilter *iface, int pos)
Definition: transform.c:154

Definition at line 172 of file transform.c.

Referenced by TransformFilter_Init().

◆ TransformFilter_InputPin_Vtbl

static const IPinVtbl TransformFilter_InputPin_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI TransformFilter_InputPin_EndFlush(IPin *iface)
Definition: transform.c:525
static HRESULT WINAPI TransformFilter_InputPin_EndOfStream(IPin *iface)
Definition: transform.c:441
static HRESULT WINAPI TransformFilter_InputPin_BeginFlush(IPin *iface)
Definition: transform.c:507
static HRESULT WINAPI TransformFilter_InputPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: transform.c:467
static HRESULT WINAPI TransformFilter_InputPin_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
Definition: transform.c:543
static HRESULT WINAPI TransformFilter_InputPin_Disconnect(IPin *iface)
Definition: transform.c:493
HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
Definition: pin.c:248
ULONG WINAPI BaseInputPinImpl_Release(IPin *iface)
Definition: pin.c:868
HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:935
HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
Definition: pin.c:329
HRESULT WINAPI BasePinImpl_ConnectedTo(IPin *iface, IPin **ppPin)
Definition: pin.c:222
HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, LPWSTR *Id)
Definition: pin.c:296
HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *pInfo)
Definition: pin.c:273
HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
Definition: pin.c:838
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
Definition: pin.c:318
HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *pPinDir)
Definition: pin.c:285
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pConnector, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:881
ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
Definition: pin.c:187

Definition at line 45 of file transform.c.

Referenced by TransformFilter_Init().

◆ TransformFilter_OutputPin_Vtbl

static const IPinVtbl TransformFilter_OutputPin_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI TransformFilter_Output_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
Definition: transform.c:123
HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin *iface)
Definition: pin.c:545
HRESULT WINAPI BasePinImpl_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
Definition: pin.c:338
HRESULT WINAPI BaseOutputPinImpl_EndOfStream(IPin *iface)
Definition: pin.c:527
HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
Definition: pin.c:363
HRESULT WINAPI BaseOutputPinImpl_BeginFlush(IPin *iface)
Definition: pin.c:536
ULONG WINAPI BaseOutputPinImpl_Release(IPin *iface)
Definition: pin.c:392
HRESULT WINAPI BaseOutputPinImpl_Connect(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:405
HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:490
HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin *iface)
Definition: pin.c:497

Definition at line 46 of file transform.c.

Referenced by TransformFilter_Init().

◆ TransformFilter_QualityControl_Vtbl

static const IQualityControlVtbl TransformFilter_QualityControl_Vtbl
static
Initial value:
= {
}
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface)
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface)
HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify)
static HRESULT WINAPI TransformFilter_QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
Definition: transform.c:605

Definition at line 47 of file transform.c.

Referenced by TransformFilter_Init().

◆ wcsInputPinName

const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0}
static

Definition at line 42 of file transform.c.

Referenced by TransformFilter_Init().

◆ wcsOutputPinName

const WCHAR wcsOutputPinName[] = {'o','u','t','p','u','t',' ','p','i','n',0}
static

Definition at line 43 of file transform.c.

Referenced by TransformFilter_Init().