67 IEnumMediaTypes_AddRef(iface);
80 TRACE(
"(%p) new ref = %u\n",
This, refCount);
89 TRACE(
"(%p) new ref = %u\n",
This, refCount);
108 if (!
types || ((nTypes != 1) && !fetched))
112 *mtype =
This->mtype;
113 if (mtype->cbFormat) {
115 CopyMemory(mtype->pbFormat,
This->mtype.pbFormat, mtype->cbFormat);
185 if (mtype->cbFormat) {
187 CopyMemory(
obj->mtype.pbFormat, mtype->pbFormat, mtype->cbFormat);
195 return &
obj->IEnumMediaTypes_iface;
270 if (
This->filter.filterInfo.pGraph)
271 WARN(
"(%p) still joined to filter graph %p\n",
This,
This->filter.filterInfo.pGraph);
273 IMemAllocator_Release(
This->allocator);
275 IMemInputPin_Release(
This->memOutput);
276 if (
This->grabberIface)
277 ISampleGrabberCB_Release(
This->grabberIface);
280 if(
This->seekthru_unk)
281 IUnknown_Release(
This->seekthru_unk);
296 *
ppv = &
This->filter.IBaseFilter_iface;
298 *
ppv = &
This->ISampleGrabber_iface;
300 return IUnknown_QueryInterface(
This->seekthru_unk,
riid,
ppv);
302 return IUnknown_QueryInterface(
This->seekthru_unk,
riid,
ppv);
351 pin = &
This->pin_in.IPin_iface;
353 pin = &
This->pin_out.IPin_iface;
376 if (
This->bufferLen >= 0) {
378 LONG size = IMediaSample_GetActualDataLength(sample);
393 if (!
This->grabberIface)
395 if (
SUCCEEDED(IMediaSample_GetTime(sample, &tStart, &tEnd)))
396 time = 1
e-7 * tStart;
397 switch (
This->grabberMethod) {
400 ULONG ref = IMediaSample_AddRef(sample);
401 ISampleGrabberCB_SampleCB(
This->grabberIface,
time, sample);
402 ref = IMediaSample_Release(sample) + 1 -
ref;
405 ERR(
"(%p) Callback referenced sample %p by %u\n",
This, sample,
ref);
408 IMediaSample_Release(sample);
415 LONG size = IMediaSample_GetActualDataLength(sample);
423 FIXME(
"unsupported method %d\n",
This->grabberMethod);
425 This->grabberMethod = -1;
437 return IUnknown_QueryInterface(
This->outer_unk,
riid,
ppv);
445 return IUnknown_AddRef(
This->outer_unk);
453 return IUnknown_Release(
This->outer_unk);
462 This->filter.state = State_Stopped;
472 This->filter.state = State_Paused;
482 This->filter.state = State_Running;
496 *
pin = &
This->pin_in.IPin_iface;
502 *
pin = &
This->pin_out.IPin_iface;
544 return IUnknown_QueryInterface(
This->outer_unk,
riid,
ppv);
552 return IUnknown_AddRef(
This->outer_unk);
560 return IUnknown_Release(
This->outer_unk);
581 TRACE(
"Media type: %s/%s ssize: %u format: %s (%u bytes)\n",
588 if (
type->cbFormat) {
605 if (!
This->pin_in.pair)
608 if (
type->cbFormat) {
623 if (
This->bufferLen < 0)
627 This->bufferLen = -1;
642 if (!
This->pin_in.pair)
644 else if (
This->bufferLen < 0)
646 else if (
This->bufferLen == 0)
666 WARN(
"(%p): not implemented\n", sample);
676 if (
This->grabberIface)
677 ISampleGrabberCB_Release(
This->grabberIface);
679 This->grabberMethod = whichMethod;
681 ISampleGrabberCB_AddRef(
cb);
693 return IUnknown_QueryInterface(
This->outer_unk,
riid,
ppv);
701 return IUnknown_AddRef(
This->outer_unk);
709 return IUnknown_Release(
This->outer_unk);
736 IMemAllocator_Release(
This->allocator);
760 TRACE(
"(%p)->(%p) output = %p, grabber = %p\n",
This, sample,
This->memOutput,
This->grabberIface);
766 hr =
This->memOutput ? IMemInputPin_Receive(
This->memOutput, sample) :
S_OK;
770 if (
This->pin_out.pair)
771 IPin_EndOfStream(
This->pin_out.pair);
782 TRACE(
"(%p)->(%p, %u, %p) output = %p, grabber = %p\n",
This,
samples, nSamples, nProcessed,
This->memOutput,
This->grabberIface);
789 return This->memOutput ? IMemInputPin_ReceiveMultiple(
This->memOutput,
samples, nSamples, nProcessed) :
S_OK;
798 return This->memOutput ? IMemInputPin_ReceiveCanBlock(
This->memOutput) :
S_OK;
809 return ISampleGrabber_AddRef(&
This->sg->ISampleGrabber_iface);
817 return ISampleGrabber_Release(&
This->sg->ISampleGrabber_iface);
831 *
ppv = &
This->sg->IMemInputPin_iface;
833 return IUnknown_QueryInterface(&
This->sg->IUnknown_inner,
riid,
ppv);
835 return IUnknown_QueryInterface(&
This->sg->IUnknown_inner,
riid,
ppv);
849 WARN(
"(%p, %p): unexpected\n", receiver, mtype);
865 if (
This->sg->filter.state != State_Stopped)
868 TRACE(
"Media type: %s/%s ssize: %u format: %s (%u bytes)\n",
889 hr = IPin_ReceiveConnection(receiver, &
This->IPin_iface,
type);
892 This->pair = receiver;
893 if (
This->sg->memOutput) {
894 IMemInputPin_Release(
This->sg->memOutput);
897 IPin_QueryInterface(receiver,&IID_IMemInputPin,(
void **)&(
This->sg->memOutput));
898 TRACE(
"(%p) Accepted IPin %p, IMemInputPin %p\n",
This, receiver,
This->sg->memOutput);
913 if (
This->sg->filter.state != State_Stopped)
916 TRACE(
"Media type: %s/%s ssize: %u format: %s (%u bytes)\n",
937 if (
type->cbFormat) {
944 This->pair = connector;
945 TRACE(
"(%p) Accepted IPin %p\n",
This, connector);
953 WARN(
"(%p, %p): unexpected\n", connector, mtype);
964 if (
This->sg->filter.state != State_Stopped)
980 if (
This->sg->filter.state != State_Stopped)
984 if (
This->sg->memOutput) {
985 IMemInputPin_Release(
This->sg->memOutput);
1021 *mtype =
This->sg->mtype;
1022 if (mtype->cbFormat) {
1024 CopyMemory(mtype->pbFormat,
This->sg->mtype.pbFormat, mtype->cbFormat);
1038 info->pFilter = &
This->sg->filter.IBaseFilter_iface;
1039 IBaseFilter_AddRef(
info->pFilter);
1078 TRACE(
"(%p)\n", mtype);
1101 TRACE(
"(%p)->(%p, %p) size = %u\n",
This, pins, nPins, (nPins ? *nPins : 0));
1107 IPin_AddRef(&
This->sg->pin_out.IPin_iface);
1108 *pins = &
This->sg->pin_out.IPin_iface;
1120 WARN(
"(%p, %p): unexpected\n", pins, nPins);
1257 TRACE(
"(%p,%p)\n", pUnkOuter,
ppv);
1282 obj->mtype.subtype = MEDIASUBTYPE_None;
1283 obj->mtype.formattype = FORMAT_None;
1287 obj->grabberMethod = -1;
1289 obj->bufferLen = -1;
1293 obj->outer_unk = pUnkOuter;
1295 obj->outer_unk = &
obj->IUnknown_inner;
1301 IUnknown_QueryInterface(
obj->seekthru_unk, &IID_ISeekingPassThru, (
void**)&passthru);
1302 ISeekingPassThru_Init(passthru,
FALSE, &
obj->pin_in.IPin_iface);
1303 ISeekingPassThru_Release(passthru);
1305 *
ppv = &
obj->IUnknown_inner;
#define InterlockedIncrement
#define InterlockedDecrement
enum _PinDirection PIN_DIRECTION
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
const GUID IID_IBaseFilter
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
static HMODULE MODULEINFO DWORD cb
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
static const BaseFilterFuncTable basefunc_vtbl
static HRESULT WINAPI SampleGrabber_IPin_QueryInterface(IPin *iface, REFIID riid, void **ppv)
static ULONG WINAPI SampleGrabber_Release(IUnknown *iface)
static ULONG WINAPI SampleGrabber_IPin_AddRef(IPin *iface)
static HRESULT WINAPI SampleGrabber_IPin_EndFlush(IPin *iface)
static HRESULT WINAPI Single_IEnumMediaTypes_Clone(IEnumMediaTypes *iface, IEnumMediaTypes **me)
static HRESULT WINAPI SampleGrabber_IPin_ConnectedTo(IPin *iface, IPin **pin)
static SG_Impl * impl_from_IBaseFilter(IBaseFilter *iface)
static HRESULT WINAPI Single_IEnumMediaTypes_Skip(IEnumMediaTypes *iface, ULONG nTypes)
static LONG WINAPI SampleGrabber_GetPinCount(BaseFilter *iface)
static HRESULT WINAPI SampleGrabber_IBaseFilter_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
static ULONG WINAPI SampleGrabber_IBaseFilter_AddRef(IBaseFilter *iface)
static HRESULT WINAPI SampleGrabber_IPin_QueryId(IPin *iface, LPWSTR *id)
static HRESULT WINAPI SampleGrabber_IPin_QueryPinInfo(IPin *iface, PIN_INFO *info)
static const IMemInputPinVtbl IMemInputPin_VTable
static IEnumMediaTypes * mediaenum_create(const AM_MEDIA_TYPE *mtype, BOOL past)
static const IPinVtbl IPin_In_VTable
static HRESULT WINAPI SampleGrabber_IMemInputPin_ReceiveMultiple(IMemInputPin *iface, IMediaSample **samples, LONG nSamples, LONG *nProcessed)
static HRESULT WINAPI SampleGrabber_Out_IPin_Connect(IPin *iface, IPin *receiver, const AM_MEDIA_TYPE *type)
static HRESULT WINAPI SampleGrabber_IBaseFilter_Pause(IBaseFilter *iface)
static SG_Impl * impl_from_ISampleGrabber(ISampleGrabber *iface)
static HRESULT WINAPI SampleGrabber_Out_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_MEDIA_TYPE *mtype)
static HRESULT WINAPI SampleGrabber_IBaseFilter_Stop(IBaseFilter *iface)
static SG_Impl * impl_from_IMemInputPin(IMemInputPin *iface)
static SG_Pin * impl_from_IPin(IPin *iface)
static HRESULT WINAPI SampleGrabber_IPin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **mtypes)
static void SampleGrabber_callback(SG_Impl *This, IMediaSample *sample)
static SG_Impl * impl_from_IUnknown(IUnknown *iface)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_GetCurrentSample(ISampleGrabber *iface, IMediaSample **sample)
static HRESULT WINAPI SampleGrabber_IPin_BeginFlush(IPin *iface)
static ULONG WINAPI SampleGrabber_IMemInputPin_Release(IMemInputPin *iface)
static const WCHAR pin_in_name[]
static SG_Impl * impl_from_BaseFilter(BaseFilter *iface)
static HRESULT WINAPI SampleGrabber_In_IPin_Disconnect(IPin *iface)
static ULONG WINAPI SampleGrabber_IPin_Release(IPin *iface)
static ULONG WINAPI SampleGrabber_IMemInputPin_AddRef(IMemInputPin *iface)
HRESULT SampleGrabber_create(IUnknown *pUnkOuter, LPVOID *ppv)
static void SampleGrabber_cleanup(SG_Impl *This)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_QueryInterface(ISampleGrabber *iface, REFIID riid, void **ppv)
static ULONG WINAPI SampleGrabber_AddRef(IUnknown *iface)
static const ISampleGrabberVtbl ISampleGrabber_VTable
static HRESULT WINAPI Single_IEnumMediaTypes_Next(IEnumMediaTypes *iface, ULONG nTypes, AM_MEDIA_TYPE **types, ULONG *fetched)
static const IBaseFilterVtbl IBaseFilter_VTable
static HRESULT WINAPI SampleGrabber_ISampleGrabber_GetCurrentBuffer(ISampleGrabber *iface, LONG *bufSize, LONG *buffer)
static const IEnumMediaTypesVtbl IEnumMediaTypes_VTable
static HRESULT WINAPI SampleGrabber_In_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_MEDIA_TYPE *type)
static HRESULT WINAPI Single_IEnumMediaTypes_QueryInterface(IEnumMediaTypes *iface, REFIID riid, void **ret_iface)
static HRESULT WINAPI SampleGrabber_Out_IPin_QueryInternalConnections(IPin *iface, IPin **pins, ULONG *nPins)
static ULONG WINAPI SampleGrabber_ISampleGrabber_AddRef(ISampleGrabber *iface)
static IPin *WINAPI SampleGrabber_GetPin(BaseFilter *iface, int pos)
static HRESULT WINAPI SampleGrabber_IPin_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
static HRESULT WINAPI SampleGrabber_Out_IPin_Disconnect(IPin *iface)
static HRESULT WINAPI SampleGrabber_IMemInputPin_NotifyAllocator(IMemInputPin *iface, IMemAllocator *allocator, BOOL readOnly)
static HRESULT WINAPI SampleGrabber_IPin_EndOfStream(IPin *iface)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetMediaType(ISampleGrabber *iface, const AM_MEDIA_TYPE *type)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetOneShot(ISampleGrabber *iface, BOOL oneShot)
static HRESULT WINAPI SampleGrabber_IPin_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double rate)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_GetConnectedMediaType(ISampleGrabber *iface, AM_MEDIA_TYPE *type)
static HRESULT WINAPI SampleGrabber_In_IPin_Connect(IPin *iface, IPin *receiver, const AM_MEDIA_TYPE *mtype)
static HRESULT WINAPI SampleGrabber_IBaseFilter_FindPin(IBaseFilter *iface, LPCWSTR id, IPin **pin)
static HRESULT WINAPI SampleGrabber_IMemInputPin_Receive(IMemInputPin *iface, IMediaSample *sample)
static HRESULT WINAPI SampleGrabber_IBaseFilter_QueryVendorInfo(IBaseFilter *iface, LPWSTR *vendor)
static HRESULT WINAPI SampleGrabber_IBaseFilter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *graph, LPCWSTR name)
static HRESULT WINAPI SampleGrabber_IBaseFilter_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv)
static const WCHAR vendor_name[]
static const WCHAR pin_out_name[]
static const IUnknownVtbl samplegrabber_vtbl
static HRESULT WINAPI SampleGrabber_IMemInputPin_ReceiveCanBlock(IMemInputPin *iface)
static HRESULT WINAPI SampleGrabber_IMemInputPin_QueryInterface(IMemInputPin *iface, REFIID riid, void **ppv)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetBufferSamples(ISampleGrabber *iface, BOOL bufferEm)
static HRESULT WINAPI SampleGrabber_IPin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mtype)
static ULONG WINAPI Single_IEnumMediaTypes_Release(IEnumMediaTypes *iface)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetCallback(ISampleGrabber *iface, ISampleGrabberCB *cb, LONG whichMethod)
static HRESULT WINAPI SampleGrabber_In_IPin_QueryInternalConnections(IPin *iface, IPin **pins, ULONG *nPins)
static const IPinVtbl IPin_Out_VTable
static HRESULT WINAPI Single_IEnumMediaTypes_Reset(IEnumMediaTypes *iface)
static ME_Impl * impl_from_IEnumMediaTypes(IEnumMediaTypes *iface)
static ULONG WINAPI SampleGrabber_IBaseFilter_Release(IBaseFilter *iface)
static HRESULT WINAPI SampleGrabber_IMemInputPin_GetAllocatorRequirements(IMemInputPin *iface, ALLOCATOR_PROPERTIES *props)
static ULONG WINAPI SampleGrabber_ISampleGrabber_Release(ISampleGrabber *iface)
static ULONG WINAPI Single_IEnumMediaTypes_AddRef(IEnumMediaTypes *iface)
static HRESULT WINAPI SampleGrabber_IMemInputPin_GetAllocator(IMemInputPin *iface, IMemAllocator **allocator)
static HRESULT WINAPI SampleGrabber_IPin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *mtype)
static HRESULT WINAPI SampleGrabber_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter *iface)
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
HRESULT WINAPI BaseFilter_Init(BaseFilter *This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable *pBaseFuncsTable)
IEnumMediaTypes IEnumMediaTypes_iface
IMemInputPin IMemInputPin_iface
ISampleGrabberCB * grabberIface
IMemAllocator * allocator
ISampleGrabber ISampleGrabber_iface
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_ALREADY_CONNECTED
#define VFW_E_INVALIDMEDIATYPE
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_E_NOT_STOPPED
#define VFW_E_WRONG_STATE
#define VFW_E_NO_ALLOCATOR
#define VFW_E_NOT_CONNECTED
static const WCHAR props[]
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)