28#include "wine/unicode.h"
88 return This->cStreams;
96HRESULT Parser_Create(
ParserImpl* pParser,
const IBaseFilterVtbl *Parser_Vtbl,
const CLSID* pClsid,
PFN_PROCESS_SAMPLE fnProcessSample,
PFN_QUERY_ACCEPT fnQueryAccept,
PFN_PRE_CONNECT fnPreConnect,
PFN_CLEANUP fnCleanup,
PFN_DISCONNECT fnDisconnect,
REQUESTPROC fnRequest,
STOPPROCESSPROC fnDone,
SourceSeeking_ChangeStop stop,
SourceSeeking_ChangeStart start,
SourceSeeking_ChangeRate rate)
153 *
ppv = &
This->filter.IBaseFilter_iface;
186 IPin_ConnectedTo(&
This->pInputPin->pin.IPin_iface, &
connected);
192 hr = IPin_Disconnect(&
This->pInputPin->pin.IPin_iface);
195 pinref = IPin_Release(&
This->pInputPin->pin.IPin_iface);
199 ERR(
"pinref should be null, is %u, destroying anyway\n", pinref);
203 pinref = IPin_Release(&
This->pInputPin->pin.IPin_iface);
209 TRACE(
"Destroying parser\n");
218 TRACE(
"(%p)->() Release from %d\n",
This, refCount + 1);
234 *pClsid =
This->filter.clsid;
251 IAsyncReader_BeginFlush(
This->pInputPin->pReader);
254 if (
This->filter.state == State_Stopped)
257 IAsyncReader_EndFlush(
This->pInputPin->pReader);
262 This->filter.state = State_Stopped;
264 for (
i = 1;
i < (
This->cStreams + 1);
i++)
273 IAsyncReader_EndFlush(
This->pInputPin->pReader);
290 if (
This->filter.state == State_Paused)
297 if (
This->filter.state == State_Stopped)
300 hr = IBaseFilter_Run(iface, -1);
305 This->filter.state = State_Paused;
328 This->filter.rtStreamStart = tStart;
329 if (
This->filter.state == State_Running ||
This->filter.state == State_Paused)
331 This->filter.state = State_Running;
337 for (
i = 1;
i < (
This->cStreams + 1);
i++)
353 This->filter.state = State_Running;
367 TRACE(
"%p->(%d, %p)\n",
This, dwMilliSecsTimeout, pState);
372 *pState =
This->filter.state;
451 ppOldPins =
This->ppPins;
464 pin->dwSamplesProcessed = 0;
466 pin->pin.pin.pinInfo.pFilter = &
This->filter.IBaseFilter_iface;
475 This->ppPins = ppOldPins;
476 ERR(
"Failed with error %x\n",
hr);
495 for (
i = 0;
i <
This->cStreams;
i++)
498 TRACE(
"Disconnect: %08x\n",
hr);
499 IPin_Release(ppOldPins[
i + 1]);
511 FIXME(
"(%p) filter hasn't implemented start position change!\n", iface);
517 FIXME(
"(%p) filter hasn't implemented stop position change!\n", iface);
523 FIXME(
"(%p) filter hasn't implemented rate change!\n", iface);
532 return IBaseFilter_QueryInterface(&
This->filter.IBaseFilter_iface,
riid,
ppv);
539 return IBaseFilter_AddRef(&
This->filter.IBaseFilter_iface);
546 return IBaseFilter_Release(&
This->filter.IBaseFilter_iface);
578 if (ppropInputRequest->
cbAlign && ppropInputRequest->
cbAlign !=
This->allocProps.cbAlign)
579 FIXME(
"Requested Buffer cbAlign mismatch %i,%i\n",
This->allocProps.cbAlign, ppropInputRequest->
cbAlign);
581 FIXME(
"Requested Buffer cbPrefix mismatch %i,%i\n",
This->allocProps.cbPrefix, ppropInputRequest->
cbPrefix);
583 FIXME(
"Requested Buffer cbBuffer mismatch %i,%i\n",
This->allocProps.cbBuffer, ppropInputRequest->
cbBuffer);
585 FIXME(
"Requested Buffer cBuffers mismatch %i,%i\n",
This->allocProps.cBuffers, ppropInputRequest->
cBuffers);
587 return IMemAllocator_SetProperties(pAlloc, &
This->allocProps, &actual);
610 hr = IMemInputPin_NotifyAllocator(pPin,
This->alloc,
This->readonly);
613 *pAlloc =
This->alloc;
614 IMemAllocator_AddRef(*pAlloc);
630 if (!
This->pin.pConnectedTo || !
This->pMemInputPin)
634 hr = IPin_Disconnect(
This->pin.pConnectedTo);
635 IPin_Disconnect(&
This->pin.IPin_iface);
675 TRACE(
"(%p)->() Release from %d\n", iface, refCount + 1);
682 if (
This->pin.pAllocator)
683 IMemAllocator_Release(
This->pin.pAllocator);
769 if (
This->pin.pConnectedTo)
820 TRACE(
"(%p/%p)->(%p)\n",
This, iface, ppEnum);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
const GUID IID_IBaseFilter
const char * qzdebugstr_guid(const GUID *id)
static HRESULT WINAPI Parser_OutputPin_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
HRESULT WINAPI Parser_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
static ULONG WINAPI Parser_Seeking_Release(IMediaSeeking *iface)
HRESULT WINAPI Parser_GetClassID(IBaseFilter *iface, CLSID *pClsid)
static const IPinVtbl Parser_OutputPin_Vtbl
static HRESULT WINAPI Parser_ChangeStop(IMediaSeeking *iface)
static HRESULT Parser_RemoveOutputPins(ParserImpl *This)
static ULONG WINAPI Parser_OutputPin_Release(IPin *iface)
static HRESULT WINAPI Parser_OutputPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
static const BaseOutputPinFuncTable output_BaseOutputFuncTable
HRESULT WINAPI Parser_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
HRESULT WINAPI Parser_Pause(IBaseFilter *iface)
static HRESULT WINAPI Parser_ChangeStart(IMediaSeeking *iface)
static const IPinVtbl Parser_InputPin_Vtbl
static HRESULT WINAPI Parser_PullPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
static HRESULT WINAPI Parser_OutputPin_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI Parser_Stop(IBaseFilter *iface)
static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc)
ULONG WINAPI Parser_AddRef(IBaseFilter *iface)
static HRESULT WINAPI Parser_OutputPin_BreakConnect(BaseOutputPin *This)
HRESULT WINAPI Parser_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
static ParserImpl * impl_from_BaseFilter(BaseFilter *iface)
static IPin *WINAPI Parser_GetPin(BaseFilter *iface, int pos)
static const BaseFilterFuncTable BaseFuncTable
static ParserImpl * impl_from_IBaseFilter(IBaseFilter *iface)
void Parser_Destroy(ParserImpl *This)
HRESULT Parser_AddPin(ParserImpl *This, const PIN_INFO *piOutput, ALLOCATOR_PROPERTIES *props, const AM_MEDIA_TYPE *amt)
static HRESULT WINAPI Parser_ChangeRate(IMediaSeeking *iface)
HRESULT WINAPI Parser_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
HRESULT Parser_Create(ParserImpl *pParser, const IBaseFilterVtbl *Parser_Vtbl, const CLSID *pClsid, PFN_PROCESS_SAMPLE fnProcessSample, PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect, PFN_CLEANUP fnCleanup, PFN_DISCONNECT fnDisconnect, REQUESTPROC fnRequest, STOPPROCESSPROC fnDone, SourceSeeking_ChangeStop stop, SourceSeeking_ChangeStart start, SourceSeeking_ChangeRate rate)
static ULONG WINAPI Parser_Seeking_AddRef(IMediaSeeking *iface)
HRESULT WINAPI Parser_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
ULONG WINAPI Parser_Release(IBaseFilter *iface)
static HRESULT WINAPI Parser_PullPin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
HRESULT WINAPI Parser_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
static HRESULT WINAPI Parser_OutputPin_Connect(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
static HRESULT WINAPI Parser_Seeking_QueryInterface(IMediaSeeking *iface, REFIID riid, LPVOID *ppv)
static const IMediaSeekingVtbl Parser_Seeking_Vtbl
static HRESULT WINAPI Parser_PullPin_Disconnect(IPin *iface)
static HRESULT WINAPI Parser_OutputPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_TYPE *pmt)
HRESULT WINAPI Parser_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
static HRESULT WINAPI Parser_PullPin_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
HRESULT WINAPI Parser_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
static LONG WINAPI Parser_GetPinCount(BaseFilter *iface)
HRESULT WINAPI Parser_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
static ParserImpl * impl_from_IMediaSeeking(IMediaSeeking *iface)
HRESULT WINAPI Parser_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
static const WCHAR wcsInputPinName[]
HRESULT(* PFN_PRE_CONNECT)(IPin *iface, IPin *pConnectPin, ALLOCATOR_PROPERTIES *prop)
HRESULT(* PFN_DISCONNECT)(LPVOID iface)
HRESULT(* PFN_PROCESS_SAMPLE)(LPVOID iface, IMediaSample *pSample, DWORD_PTR cookie)
HRESULT(* PFN_QUERY_ACCEPT)(LPVOID iface, const AM_MEDIA_TYPE *pmt)
HRESULT(* PFN_CLEANUP)(LPVOID iface)
static Parser_OutputPin * unsafe_impl_Parser_OutputPin_from_IPin(IPin *iface)
HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO *pPinInfo, SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, REQUESTPROC pCustomRequest, STOPPROCESSPROC pDone, LPCRITICAL_SECTION pCritSec, IPin **ppPin)
HRESULT PullPin_StartProcessing(PullPin *This)
HRESULT WINAPI PullPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI PullPin_EndFlush(IPin *iface)
HRESULT WINAPI PullPin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI PullPin_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
HRESULT WINAPI PullPin_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
HRESULT WINAPI PullPin_EndOfStream(IPin *iface)
HRESULT WINAPI PullPin_BeginFlush(IPin *iface)
HRESULT WINAPI PullPin_Disconnect(IPin *iface)
HRESULT PullPin_WaitForStateChange(PullPin *This, DWORD dwMilliseconds)
ULONG WINAPI PullPin_Release(IPin *iface)
HRESULT PullPin_PauseProcessing(PullPin *This)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
#define memcpy(s1, s2, n)
static void FreeMediaType(AM_MEDIA_TYPE *pMediaType)
static HRESULT CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
HRESULT(* STOPPROCESSPROC)(LPVOID userdata)
HRESULT(* REQUESTPROC)(LPVOID userdata)
static PullPin * impl_PullPin_from_IPin(IPin *iface)
#define IsEqualIID(riid1, riid2)
HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
HRESULT WINAPI SourceSeekingImpl_SetTimeFormat(IMediaSeeking *iface, const GUID *pFormat)
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin *iface)
HRESULT WINAPI BasePinImpl_ConnectedTo(IPin *iface, IPin **ppPin)
HRESULT WINAPI SourceSeekingImpl_SetPositions(IMediaSeeking *iface, LONGLONG *pCurrent, DWORD dwCurrentFlags, LONGLONG *pStop, DWORD dwStopFlags)
HRESULT WINAPI BasePinImpl_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter *iface)
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
HRESULT SourceSeeking_Init(SourceSeeking *pSeeking, const IMediaSeekingVtbl *Vtbl, SourceSeeking_ChangeStop fnChangeStop, SourceSeeking_ChangeStart fnChangeStart, SourceSeeking_ChangeRate fnChangeRate, PCRITICAL_SECTION crit_sect)
HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, LPWSTR *Id)
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI SourceSeekingImpl_IsUsingTimeFormat(IMediaSeeking *iface, const GUID *pFormat)
HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *pInfo)
HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This)
HRESULT WINAPI BaseOutputPinImpl_EndOfStream(IPin *iface)
HRESULT WINAPI SourceSeekingImpl_GetRate(IMediaSeeking *iface, double *dRate)
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
HRESULT WINAPI BaseFilter_Destroy(BaseFilter *This)
HRESULT WINAPI SourceSeekingImpl_GetTimeFormat(IMediaSeeking *iface, GUID *pFormat)
HRESULT WINAPI BaseOutputPinImpl_BeginFlush(IPin *iface)
HRESULT WINAPI SourceSeekingImpl_GetCapabilities(IMediaSeeking *iface, DWORD *pCapabilities)
HRESULT WINAPI SourceSeekingImpl_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *pCurrent)
HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO *pPinInfo, const BaseOutputPinFuncTable *pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin **ppPin)
HRESULT WINAPI SourceSeekingImpl_GetPreroll(IMediaSeeking *iface, LONGLONG *pPreroll)
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
HRESULT(WINAPI * SourceSeeking_ChangeStop)(IMediaSeeking *iface)
LONG WINAPI BasePinImpl_GetMediaTypeVersion(BasePin *This)
HRESULT WINAPI SourceSeekingImpl_SetRate(IMediaSeeking *iface, double dRate)
HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt)
HRESULT WINAPI BaseOutputPinImpl_Connect(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
HRESULT WINAPI SourceSeekingImpl_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
HRESULT(WINAPI * SourceSeeking_ChangeRate)(IMediaSeeking *iface)
HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *pPinDir)
HRESULT WINAPI SourceSeekingImpl_IsFormatSupported(IMediaSeeking *iface, const GUID *pFormat)
HRESULT WINAPI BasePinImpl_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes **ppEnum)
HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI SourceSeekingImpl_GetStopPosition(IMediaSeeking *iface, LONGLONG *pStop)
HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin *iface)
VOID WINAPI BaseFilterImpl_IncrementPinVersion(BaseFilter *This)
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pConnector, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI SourceSeekingImpl_GetDuration(IMediaSeeking *iface, LONGLONG *pDuration)
HRESULT WINAPI SourceSeekingImpl_GetPositions(IMediaSeeking *iface, LONGLONG *pCurrent, LONGLONG *pStop)
HRESULT WINAPI SourceSeekingImpl_CheckCapabilities(IMediaSeeking *iface, DWORD *pCapabilities)
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
HRESULT WINAPI SourceSeekingImpl_QueryPreferredFormat(IMediaSeeking *iface, GUID *pFormat)
HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This)
HRESULT WINAPI BaseFilter_Init(BaseFilter *This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable *pBaseFuncsTable)
HRESULT(WINAPI * SourceSeeking_ChangeStart)(IMediaSeeking *iface)
HRESULT WINAPI SourceSeekingImpl_GetAvailable(IMediaSeeking *iface, LONGLONG *pEarliest, LONGLONG *pLatest)
ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
IBaseFilter IBaseFilter_iface
CRITICAL_SECTION csFilter
SourceSeeking sourceSeeking
PFN_DISCONNECT fnDisconnect
PRECONNECTPROC fnPreConnect
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_NOT_STOPPED
#define VFW_S_STATE_INTERMEDIATE
#define VFW_E_NO_ALLOCATOR
#define VFW_S_NO_MORE_ITEMS
#define VFW_E_NOT_CONNECTED
static const WCHAR props[]
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)