82 IMemAllocator_Release(
This->allocator);
83 if (
This->grabberIface)
84 ISampleGrabberCB_Release(
This->grabberIface);
96 return &
filter->source.pin;
137 if (
This->bufferLen >= 0) {
154 if (!
This->grabberIface)
157 time = 1
e-7 * tStart;
158 switch (
This->grabberMethod) {
181 FIXME(
"Unknown method %ld.\n",
This->grabberMethod);
183 This->grabberMethod = -1;
248 if (!
filter->sink.pin.peer)
263 if (
This->bufferLen < 0)
267 This->bufferLen = -1;
282 if (!
This->sink.pin.peer)
284 else if (
This->bufferLen < 0)
286 else if (
This->bufferLen == 0)
316 TRACE(
"filter %p, callback %p, method %ld.\n",
This,
cb, whichMethod);
318 if (
This->grabberIface)
319 ISampleGrabberCB_Release(
This->grabberIface);
321 This->grabberMethod = whichMethod;
323 ISampleGrabberCB_AddRef(
cb);
330 return IPin_QueryInterface(&
filter->sink.pin.IPin_iface, iid,
out);
336 return IPin_AddRef(&
filter->sink.pin.IPin_iface);
342 return IPin_Release(&
filter->sink.pin.IPin_iface);
369 IMemAllocator_Release(
This->allocator);
384 return This->source.pMemInputPin ? IMemInputPin_GetAllocatorRequirements(
This->source.pMemInputPin,
props) :
E_NOTIMPL;
399 hr =
This->source.pMemInputPin ? IMemInputPin_Receive(
This->source.pMemInputPin,
sample) :
S_OK;
403 if (
This->source.pin.peer)
404 IPin_EndOfStream(
This->source.pin.peer);
416 TRACE(
"filter %p, samples %p, count %lu, ret_count %p.\n",
This,
samples, nSamples, nProcessed);
424 return This->source.pMemInputPin ? IMemInputPin_ReceiveMultiple(
This->source.pMemInputPin,
samples, nSamples, nProcessed) :
S_OK;
433 return This->source.pMemInputPin ? IMemInputPin_ReceiveCanBlock(
This->source.pMemInputPin) :
S_OK;
516 if (!
filter->source.pin.peer)
519 if (
FAILED(
hr = IPin_EnumMediaTypes(
filter->source.pin.peer, &enummt)))
523 && IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL) ==
S_OK)
527 IEnumMediaTypes_Release(enummt);
531 IEnumMediaTypes_Release(enummt);
552 *
out = &
filter->passthrough.IMediaPosition_iface;
566 if (
filter->sink.pin.peer && IPin_QueryAccept(
filter->sink.pin.peer, mt) !=
S_OK)
580 if (!
filter->sink.pin.peer)
583 if (
FAILED(
hr = IPin_EnumMediaTypes(
filter->sink.pin.peer, &enummt)))
587 && IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL) ==
S_OK)
591 IEnumMediaTypes_Release(enummt);
595 IEnumMediaTypes_Release(enummt);
602 && !
memcmp(
a->pbFormat,
b->pbFormat,
a->cbFormat);
617 &IID_IFilterGraph2, (
void **)&
graph)))
619 ERR(
"Failed to get IFilterGraph2 interface, hr %#lx.\n",
hr);
623 hr = IFilterGraph2_ReconnectEx(
graph, &
filter->sink.pin.IPin_iface, mt);
624 IFilterGraph2_Release(
graph);
644 if (!(
object =
calloc(1,
sizeof(*
object))))
658 ISeekingPassThru_Init(&
object->passthrough.ISeekingPassThru_iface,
FALSE,
659 &
object->sink.pin.IPin_iface);
661 object->grabberMethod = -1;
663 object->bufferLen = -1;
665 TRACE(
"Created sample grabber %p.\n",
object);
666 *
out = &
object->filter.IUnknown_inner;
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static HRESULT sample_grabber_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
static struct strmbase_pin * sample_grabber_get_pin(struct strmbase_filter *iface, unsigned int index)
static BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b)
static void SampleGrabber_callback(struct sample_grabber *This, IMediaSample *sample)
static const IMemInputPinVtbl IMemInputPin_VTable
static HRESULT WINAPI SampleGrabber_IMemInputPin_ReceiveMultiple(IMemInputPin *iface, IMediaSample **samples, LONG nSamples, LONG *nProcessed)
static HRESULT sample_grabber_source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_GetCurrentSample(ISampleGrabber *iface, IMediaSample **sample)
static ULONG WINAPI SampleGrabber_IMemInputPin_Release(IMemInputPin *iface)
static struct sample_grabber * impl_from_sink_pin(struct strmbase_pin *iface)
HRESULT sample_grabber_create(IUnknown *outer, IUnknown **out)
static ULONG WINAPI SampleGrabber_IMemInputPin_AddRef(IMemInputPin *iface)
static HRESULT WINAPI sample_grabber_source_DecideAllocator(struct strmbase_source *iface, IMemInputPin *peer, IMemAllocator **allocator)
static HRESULT WINAPI SampleGrabber_IMemInputPin_QueryInterface(IMemInputPin *iface, REFIID iid, void **out)
static HRESULT sample_grabber_source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
static HRESULT sample_grabber_sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_QueryInterface(ISampleGrabber *iface, REFIID riid, void **ppv)
static const ISampleGrabberVtbl ISampleGrabber_VTable
static HRESULT WINAPI SampleGrabber_ISampleGrabber_GetCurrentBuffer(ISampleGrabber *iface, LONG *bufSize, LONG *buffer)
static const struct strmbase_source_ops source_ops
static HRESULT sample_grabber_source_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
static ULONG WINAPI SampleGrabber_ISampleGrabber_AddRef(ISampleGrabber *iface)
static const struct strmbase_sink_ops sink_ops
static HRESULT WINAPI SampleGrabber_IMemInputPin_NotifyAllocator(IMemInputPin *iface, IMemAllocator *allocator, BOOL readOnly)
static const struct strmbase_filter_ops filter_ops
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetOneShot(ISampleGrabber *iface, BOOL oneShot)
static HRESULT sample_grabber_query_interface(struct strmbase_filter *iface, REFIID iid, void **out)
static HRESULT WINAPI SampleGrabber_IMemInputPin_Receive(IMemInputPin *iface, IMediaSample *sample)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_GetConnectedMediaType(ISampleGrabber *iface, AM_MEDIA_TYPE *mt)
static struct sample_grabber * impl_from_ISampleGrabber(ISampleGrabber *iface)
static HRESULT WINAPI SampleGrabber_IMemInputPin_ReceiveCanBlock(IMemInputPin *iface)
static void sample_grabber_destroy(struct strmbase_filter *iface)
static struct sample_grabber * impl_from_source_pin(struct strmbase_pin *iface)
static struct sample_grabber * impl_from_IMemInputPin(IMemInputPin *iface)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetBufferSamples(ISampleGrabber *iface, BOOL bufferEm)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetCallback(ISampleGrabber *iface, ISampleGrabberCB *cb, LONG whichMethod)
static HRESULT WINAPI SampleGrabber_IMemInputPin_GetAllocatorRequirements(IMemInputPin *iface, ALLOCATOR_PROPERTIES *props)
static ULONG WINAPI SampleGrabber_ISampleGrabber_Release(ISampleGrabber *iface)
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetMediaType(ISampleGrabber *iface, const AM_MEDIA_TYPE *mt)
static void SampleGrabber_cleanup(struct sample_grabber *This)
static HRESULT sample_grabber_sink_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
static HRESULT WINAPI SampleGrabber_IMemInputPin_GetAllocator(IMemInputPin *iface, IMemAllocator **allocator)
static struct sample_grabber * impl_from_strmbase_filter(struct strmbase_filter *iface)
static BOOL check_filter_mt(struct sample_grabber *filter, const AM_MEDIA_TYPE *mt)
void *WINAPI CoTaskMemAlloc(SIZE_T size)
void WINAPI CoTaskMemFree(void *ptr)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLboolean GLboolean GLboolean b
GLsizei GLenum GLboolean sink
GLboolean GLboolean GLboolean GLboolean a
#define IsEqualGUID(rguid1, rguid2)
#define offsetof(TYPE, MEMBER)
HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
void WINAPI FreeMediaType(AM_MEDIA_TYPE *pMediaType)
void strmbase_passthrough_cleanup(struct strmbase_passthrough *passthrough)
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt)
void strmbase_sink_cleanup(struct strmbase_sink *pin)
void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator)
void strmbase_filter_cleanup(struct strmbase_filter *filter)
void strmbase_passthrough_init(struct strmbase_passthrough *passthrough, IUnknown *outer)
void strmbase_source_cleanup(struct strmbase_source *pin)
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
void WINAPI DeleteMediaType(AM_MEDIA_TYPE *pMediaType)
IMediaSeeking IMediaSeeking_iface
IMemAllocator * allocator
ISampleGrabberCB * grabberIface
struct strmbase_passthrough passthrough
IMemInputPin IMemInputPin_iface
ISampleGrabber ISampleGrabber_iface
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_WRONG_STATE
#define VFW_E_NO_ALLOCATOR
#define VFW_S_NO_MORE_ITEMS
#define VFW_E_NOT_CONNECTED
static const WCHAR props[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)