Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/audiorecord.c | 1 - dlls/qcap/avico.c | 7 ++++--- dlls/qcap/avimux.c | 6 +++--- dlls/qcap/capture.h | 2 +- dlls/qcap/smartteefilter.c | 8 ++++--- dlls/qcap/v4l.c | 6 +++--- dlls/qcap/vfwcapture.c | 5 +++-- dlls/quartz/filesource.c | 11 +++++----- dlls/quartz/parser.c | 12 +++++++---- dlls/quartz/parser.h | 2 +- dlls/strmbase/outputqueue.c | 12 +++-------- dlls/strmbase/pin.c | 31 ++++++++++++++------------- dlls/strmbase/transform.c | 3 ++- dlls/winegstreamer/gstdemux.c | 8 ++++--- dlls/wineqtdecoder/qtsplitter.c | 10 +++++---- include/wine/strmbase.h | 37 +++++++++++++++++---------------- 16 files changed, 86 insertions(+), 75 deletions(-)
diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index 6d487dbe2d9..5d636937f81 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -37,7 +37,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap); typedef struct { struct strmbase_filter filter; IPersistPropertyBag IPersistPropertyBag_iface; - BaseOutputPin *output; } AudioRecord;
static inline AudioRecord *impl_from_strmbase_filter(struct strmbase_filter *filter) diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 918cabd8191..c052bda5995 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -38,7 +38,7 @@ typedef struct { IPersistPropertyBag IPersistPropertyBag_iface;
BaseInputPin sink; - BaseOutputPin source; + struct strmbase_source source;
DWORD fcc_handler; HIC hic; @@ -554,7 +554,8 @@ static HRESULT WINAPI AVICompressorOut_GetMediaType(BasePin *base, int iPosition return S_OK; }
-static HRESULT WINAPI AVICompressorOut_DecideBufferSize(BaseOutputPin *base, IMemAllocator *alloc, ALLOCATOR_PROPERTIES *ppropInputRequest) +static HRESULT WINAPI AVICompressorOut_DecideBufferSize(struct strmbase_source *base, + IMemAllocator *alloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { AVICompressor *This = impl_from_BasePin(&base->pin); ALLOCATOR_PROPERTIES actual; @@ -571,7 +572,7 @@ static HRESULT WINAPI AVICompressorOut_DecideBufferSize(BaseOutputPin *base, IMe return IMemAllocator_SetProperties(alloc, ppropInputRequest, &actual); }
-static HRESULT WINAPI AVICompressorOut_DecideAllocator(BaseOutputPin *base, +static HRESULT WINAPI AVICompressorOut_DecideAllocator(struct strmbase_source *base, IMemInputPin *pPin, IMemAllocator **pAlloc) { TRACE("(%p)->(%p %p)\n", base, pPin, pAlloc); diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index adc848f6dda..fbc74ae4880 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -81,7 +81,7 @@ typedef struct { REFERENCE_TIME interleave; REFERENCE_TIME preroll;
- BaseOutputPin source; + struct strmbase_source source; IQualityControl IQualityControl_iface;
int input_pin_no; @@ -1158,7 +1158,7 @@ static HRESULT WINAPI AviMuxOut_CheckMediaType(BasePin *base, const AM_MEDIA_TYP return S_OK; }
-static HRESULT WINAPI AviMuxOut_AttemptConnection(BaseOutputPin *base, +static HRESULT WINAPI AviMuxOut_AttemptConnection(struct strmbase_source *base, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) { PIN_DIRECTION dir; @@ -1195,7 +1195,7 @@ static HRESULT WINAPI AviMuxOut_GetMediaType(BasePin *base, int iPosition, AM_ME return S_OK; }
-static HRESULT WINAPI AviMuxOut_DecideAllocator(BaseOutputPin *base, +static HRESULT WINAPI AviMuxOut_DecideAllocator(struct strmbase_source *base, IMemInputPin *pPin, IMemAllocator **pAlloc) { ALLOCATOR_PROPERTIES req, actual; diff --git a/dlls/qcap/capture.h b/dlls/qcap/capture.h index 82f5eb2461c..131487ad5fb 100644 --- a/dlls/qcap/capture.h +++ b/dlls/qcap/capture.h @@ -23,7 +23,7 @@ struct _Capture; typedef struct _Capture Capture;
-Capture *qcap_driver_init(BaseOutputPin*,USHORT) DECLSPEC_HIDDEN; +Capture *qcap_driver_init(struct strmbase_source *,USHORT) DECLSPEC_HIDDEN; HRESULT qcap_driver_destroy(Capture*) DECLSPEC_HIDDEN; HRESULT qcap_driver_check_format(Capture*,const AM_MEDIA_TYPE*) DECLSPEC_HIDDEN; HRESULT qcap_driver_set_format(Capture*,AM_MEDIA_TYPE*) DECLSPEC_HIDDEN; diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index c53c7af9bbd..353409dcfc1 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap); typedef struct { struct strmbase_filter filter; BaseInputPin sink; - BaseOutputPin capture, preview; + struct strmbase_source capture, preview; } SmartTeeFilter;
static inline SmartTeeFilter *impl_from_strmbase_filter(struct strmbase_filter *filter) @@ -379,7 +379,8 @@ static HRESULT WINAPI SmartTeeFilterCapture_GetMediaType(BasePin *base, int iPos return S_FALSE; }
-static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(BaseOutputPin *base, IMemInputPin *pPin, IMemAllocator **pAlloc) +static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_source *base, + IMemInputPin *pPin, IMemAllocator **pAlloc) { SmartTeeFilter *This = impl_from_BasePin(&base->pin); TRACE("(%p, %p, %p)\n", This, pPin, pAlloc); @@ -450,7 +451,8 @@ static HRESULT WINAPI SmartTeeFilterPreview_GetMediaType(BasePin *base, int iPos return S_FALSE; }
-static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(BaseOutputPin *base, IMemInputPin *pPin, IMemAllocator **pAlloc) +static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_source *base, + IMemInputPin *pPin, IMemAllocator **pAlloc) { SmartTeeFilter *This = impl_from_BasePin(&base->pin); TRACE("(%p, %p, %p)\n", This, pPin, pAlloc); diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c index b308f14786e..c9102accb80 100644 --- a/dlls/qcap/v4l.c +++ b/dlls/qcap/v4l.c @@ -101,7 +101,7 @@ struct _Capture
CRITICAL_SECTION CritSect;
- BaseOutputPin *pin; + struct strmbase_source *pin; int fd, mmap; BOOL iscommitted, stopped;
@@ -562,7 +562,7 @@ HRESULT qcap_driver_stop(Capture *capBox, FILTER_STATE *state) return S_OK; }
-Capture * qcap_driver_init(BaseOutputPin *pin, USHORT card) +Capture *qcap_driver_init(struct strmbase_source *pin, USHORT card) { struct v4l2_capability caps = {{0}}; struct v4l2_format format = {0}; @@ -659,7 +659,7 @@ error:
#else
-Capture * qcap_driver_init(BaseOutputPin *pin, USHORT card) +Capture *qcap_driver_init(struct strmbase_source *pin, USHORT card) { static const char msg[] = "The v4l headers were not available at compile time,\n" diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index c4605ce10cc..ed8c050828a 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -53,7 +53,7 @@ typedef struct VfwCapture BOOL init; Capture *driver_info;
- BaseOutputPin source; + struct strmbase_source source; IKsPropertySet IKsPropertySet_iface; } VfwCapture;
@@ -537,7 +537,8 @@ static HRESULT WINAPI VfwPin_GetMediaType(BasePin *pin, int iPosition, AM_MEDIA_ return hr; }
-static HRESULT WINAPI VfwPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) +static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface, + IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { ALLOCATOR_PROPERTIES actual;
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 77385009f24..006c6592b56 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -61,7 +61,7 @@ typedef struct AsyncReader struct strmbase_filter filter; IFileSourceFilter IFileSourceFilter_iface;
- BaseOutputPin source; + struct strmbase_source source; IAsyncReader IAsyncReader_iface;
LPOLESTR pszFileName; @@ -571,7 +571,7 @@ static inline AsyncReader *impl_from_BasePin(BasePin *iface) return CONTAINING_RECORD(iface, AsyncReader, source.pin); }
-static inline AsyncReader *impl_from_BaseOutputPin(BaseOutputPin *iface) +static inline AsyncReader *impl_from_strmbase_source(struct strmbase_source *iface) { return CONTAINING_RECORD(iface, AsyncReader, source); } @@ -657,7 +657,7 @@ static const IPinVtbl FileAsyncReaderPin_Vtbl = /* specific AM_MEDIA_TYPE - it cannot be NULL */ /* this differs from standard OutputPin_AttemptConnection only in that it * doesn't need the IMemInputPin interface on the receiving pin */ -static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(BaseOutputPin *This, +static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_source *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) { HRESULT hr; @@ -684,9 +684,10 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(BaseOutputPin *This, return hr; }
-static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) +static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(struct strmbase_source *iface, + IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { - AsyncReader *This = impl_from_BaseOutputPin(iface); + AsyncReader *This = impl_from_strmbase_source(iface); ALLOCATOR_PROPERTIES actual;
if (ppropInputRequest->cbAlign && ppropInputRequest->cbAlign != This->allocProps.cbAlign) diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 5b09f70758c..2768d013573 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -41,10 +41,12 @@ static const IPinVtbl Parser_InputPin_Vtbl; static HRESULT WINAPI Parser_ChangeStart(IMediaSeeking *iface); static HRESULT WINAPI Parser_ChangeStop(IMediaSeeking *iface); static HRESULT WINAPI Parser_ChangeRate(IMediaSeeking *iface); -static HRESULT WINAPI Parser_OutputPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest); +static HRESULT WINAPI Parser_OutputPin_DecideBufferSize(struct strmbase_source *iface, + IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props); static HRESULT WINAPI Parser_OutputPin_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt); static HRESULT WINAPI Parser_OutputPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_TYPE *pmt); -static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); +static HRESULT WINAPI Parser_OutputPin_DecideAllocator(struct strmbase_source *iface, + IMemInputPin *peer, IMemAllocator **allocator);
static inline ParserImpl *impl_from_IMediaSeeking( IMediaSeeking *iface ) { @@ -469,7 +471,8 @@ static const IMediaSeekingVtbl Parser_Seeking_Vtbl = SourceSeekingImpl_GetPreroll };
-static HRESULT WINAPI Parser_OutputPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) +static HRESULT WINAPI Parser_OutputPin_DecideBufferSize(struct strmbase_source *iface, + IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { Parser_OutputPin *This = (Parser_OutputPin*)iface; ALLOCATOR_PROPERTIES actual; @@ -497,7 +500,8 @@ static HRESULT WINAPI Parser_OutputPin_GetMediaType(BasePin *iface, int iPositio return S_OK; }
-static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *iface, IMemInputPin *pPin, IMemAllocator **pAlloc) +static HRESULT WINAPI Parser_OutputPin_DecideAllocator(struct strmbase_source *iface, + IMemInputPin *pPin, IMemAllocator **pAlloc) { Parser_OutputPin *This = (Parser_OutputPin*)iface; HRESULT hr; diff --git a/dlls/quartz/parser.h b/dlls/quartz/parser.h index e0ea780e11f..748b7131926 100644 --- a/dlls/quartz/parser.h +++ b/dlls/quartz/parser.h @@ -28,7 +28,7 @@ typedef HRESULT (*PFN_DISCONNECT) (LPVOID iface);
typedef struct Parser_OutputPin { - BaseOutputPin pin; + struct strmbase_source pin;
AM_MEDIA_TYPE * pmt; LONGLONG dwSamplesProcessed; diff --git a/dlls/strmbase/outputqueue.c b/dlls/strmbase/outputqueue.c index e3515c0e317..6cb74f3e26c 100644 --- a/dlls/strmbase/outputqueue.c +++ b/dlls/strmbase/outputqueue.c @@ -48,15 +48,9 @@ static void OutputQueue_FreeSamples(OutputQueue *pOutputQueue) } }
-HRESULT WINAPI OutputQueue_Construct( - BaseOutputPin *pInputPin, - BOOL bAuto, - BOOL bQueue, - LONG lBatchSize, - BOOL bBatchExact, - DWORD dwPriority, - const OutputQueueFuncTable* pFuncsTable, - OutputQueue **ppOutputQueue ) +HRESULT WINAPI OutputQueue_Construct(struct strmbase_source *pInputPin, BOOL bAuto, + BOOL bQueue, LONG lBatchSize, BOOL bBatchExact, DWORD dwPriority, + const OutputQueueFuncTable *pFuncsTable, OutputQueue **ppOutputQueue)
{ BOOL threaded = FALSE; diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 6f1f96c9d53..cbf4db9fd05 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -334,14 +334,14 @@ HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFER
/*** OutputPin implementation ***/
-static inline BaseOutputPin *impl_BaseOutputPin_from_IPin( IPin *iface ) +static inline struct strmbase_source *impl_source_from_IPin( IPin *iface ) { - return CONTAINING_RECORD(iface, BaseOutputPin, pin.IPin_iface); + return CONTAINING_RECORD(iface, struct strmbase_source, pin.IPin_iface); }
HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) { - BaseOutputPin *This = impl_BaseOutputPin_from_IPin(iface); + struct strmbase_source *This = impl_source_from_IPin(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
@@ -371,7 +371,7 @@ HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOI HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) { HRESULT hr; - BaseOutputPin *This = impl_BaseOutputPin_from_IPin(iface); + struct strmbase_source *This = impl_source_from_IPin(iface);
TRACE("(%p)->(%p, %p)\n", This, pReceivePin, pmt); dump_AM_MEDIA_TYPE(pmt); @@ -462,7 +462,7 @@ HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin *iface, IPin *pin, const HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface) { HRESULT hr; - BaseOutputPin *This = impl_BaseOutputPin_from_IPin(iface); + struct strmbase_source *This = impl_source_from_IPin(iface);
TRACE("(%p)->()\n", This);
@@ -516,7 +516,8 @@ HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin * iface) return E_UNEXPECTED; }
-HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin *This, IMediaSample ** ppSample, REFERENCE_TIME * tStart, REFERENCE_TIME * tStop, DWORD dwFlags) +HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This, + IMediaSample **ppSample, REFERENCE_TIME *tStart, REFERENCE_TIME *tStop, DWORD dwFlags) { HRESULT hr;
@@ -536,7 +537,7 @@ HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin *This, IMediaSa }
/* replaces OutputPin_SendSample */ -HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin *This, IMediaSample * pSample) +HRESULT WINAPI BaseOutputPinImpl_Deliver(struct strmbase_source *This, IMediaSample *pSample) { IMemInputPin * pMemConnected = NULL; PIN_INFO pinInfo; @@ -576,7 +577,7 @@ HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin *This, IMediaSample * pSa }
/* replaces OutputPin_CommitAllocator */ -HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This) +HRESULT WINAPI BaseOutputPinImpl_Active(struct strmbase_source *This) { HRESULT hr;
@@ -596,7 +597,7 @@ HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This) }
/* replaces OutputPin_DecommitAllocator */ -HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This) +HRESULT WINAPI BaseOutputPinImpl_Inactive(struct strmbase_source *This) { HRESULT hr;
@@ -615,12 +616,13 @@ HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This) return hr; }
-HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocator **pMemAlloc) +HRESULT WINAPI BaseOutputPinImpl_InitAllocator(struct strmbase_source *This, IMemAllocator **pMemAlloc) { return CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (LPVOID*)pMemAlloc); }
-HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc) +HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(struct strmbase_source *This, + IMemInputPin *pPin, IMemAllocator **pAlloc) { HRESULT hr;
@@ -649,7 +651,8 @@ HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputP
/* Function called as a helper to IPin_Connect */ /* specific AM_MEDIA_TYPE - it cannot be NULL */ -HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BaseOutputPin *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) +HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This, + IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) { HRESULT hr; IMemAllocator * pMemAlloc = NULL; @@ -704,7 +707,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BaseOutputPin *This, IPin *pR return hr; }
-void strmbase_source_init(BaseOutputPin *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, +void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, const WCHAR *name, const BaseOutputPinFuncTable *func_table) { memset(pin, 0, sizeof(*pin)); @@ -717,7 +720,7 @@ void strmbase_source_init(BaseOutputPin *pin, const IPinVtbl *vtbl, struct strmb pin->pFuncsTable = func_table; }
-void strmbase_source_cleanup(BaseOutputPin *pin) +void strmbase_source_cleanup(struct strmbase_source *pin) { FreeMediaType(&pin->pin.mtCurrent); if (pin->pAllocator) diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 83a7ee1129e..fe4260edcaf 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -103,7 +103,8 @@ static HRESULT WINAPI TransformFilter_Output_CheckMediaType(BasePin *This, const return S_FALSE; }
-static HRESULT WINAPI TransformFilter_Output_DecideBufferSize(BaseOutputPin *This, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) +static HRESULT WINAPI TransformFilter_Output_DecideBufferSize(struct strmbase_source *This, + IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { TransformFilter *pTransformFilter = impl_from_source_IPin(&This->pin.IPin_iface); return pTransformFilter->pFuncsTable->pfnDecideBufferSize(pTransformFilter, pAlloc, ppropInputRequest); diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 22eedfd4267..1b02373e11d 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -72,7 +72,7 @@ typedef struct GSTImpl { } GSTImpl;
struct GSTOutPin { - BaseOutputPin pin; + struct strmbase_source pin; IQualityControl IQualityControl_iface;
GstElement *flipfilter; @@ -1657,7 +1657,8 @@ static HRESULT WINAPI GSTOutPin_GetMediaType(BasePin *iface, int iPosition, AM_M return S_OK; }
-static HRESULT WINAPI GSTOutPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) +static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface, + IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { GSTOutPin *This = impl_source_from_IPin(&iface->pin.IPin_iface); TRACE("(%p)->(%p, %p)\n", This, pAlloc, ppropInputRequest); @@ -1665,7 +1666,8 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(BaseOutputPin *iface, IMemAlloc return S_OK; }
-static HRESULT WINAPI GSTOutPin_DecideAllocator(BaseOutputPin *base, IMemInputPin *pPin, IMemAllocator **pAlloc) +static HRESULT WINAPI GSTOutPin_DecideAllocator(struct strmbase_source *base, + IMemInputPin *pPin, IMemAllocator **pAlloc) { GSTOutPin *pin = impl_source_from_IPin(&base->pin.IPin_iface); GSTImpl *filter = impl_from_strmbase_filter(pin->pin.pin.filter); diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 5fe58cd7598..7333e705b76 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -129,7 +129,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qtsplitter); extern CLSID CLSID_QTSplitter;
typedef struct QTOutPin { - BaseOutputPin pin; + struct strmbase_source pin; IQualityControl IQualityControl_iface;
AM_MEDIA_TYPE * pmt; @@ -1262,7 +1262,7 @@ static inline QTOutPin *impl_QTOutPin_from_BasePin( BasePin *iface ) return CONTAINING_RECORD(iface, QTOutPin, pin.pin); }
-static inline QTOutPin *impl_QTOutPin_from_BaseOutputPin( BaseOutputPin *iface ) +static inline QTOutPin *impl_QTOutPin_from_BaseOutputPin(struct strmbase_source *iface) { return CONTAINING_RECORD(iface, QTOutPin, pin); } @@ -1311,13 +1311,15 @@ static HRESULT WINAPI QTOutPin_GetMediaType(BasePin *iface, int iPosition, AM_ME return S_OK; }
-static HRESULT WINAPI QTOutPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) +static HRESULT WINAPI QTOutPin_DecideBufferSize(struct strmbase_source *iface, + IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { /* Unused */ return S_OK; }
-static HRESULT WINAPI QTOutPin_DecideAllocator(BaseOutputPin *iface, IMemInputPin *pPin, IMemAllocator **pAlloc) +static HRESULT WINAPI QTOutPin_DecideAllocator(struct strmbase_source *iface, + IMemInputPin *pPin, IMemAllocator **pAlloc) { HRESULT hr; QTOutPin *This = impl_QTOutPin_from_BaseOutputPin(iface); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index b2903999155..e5bed6c547b 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -53,7 +53,7 @@ typedef struct BasePinFuncTable { BasePin_GetMediaType pfnGetMediaType; } BasePinFuncTable;
-typedef struct BaseOutputPin +struct strmbase_source { /* inheritance C style! */ BasePin pin; @@ -61,11 +61,11 @@ typedef struct BaseOutputPin IMemAllocator * pAllocator;
const struct BaseOutputPinFuncTable* pFuncsTable; -} BaseOutputPin; +};
-typedef HRESULT (WINAPI *BaseOutputPin_AttemptConnection)(BaseOutputPin *pin, IPin *peer, const AM_MEDIA_TYPE *mt); -typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(BaseOutputPin *This, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest); -typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); +typedef HRESULT (WINAPI *BaseOutputPin_AttemptConnection)(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt); +typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(struct strmbase_source *pin, IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props); +typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator);
typedef struct BaseOutputPinFuncTable { BasePinFuncTable base; @@ -124,16 +124,17 @@ HRESULT WINAPI BaseOutputPinImpl_EndOfStream(IPin * iface); HRESULT WINAPI BaseOutputPinImpl_BeginFlush(IPin * iface); HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin * iface);
-HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin * This, IMediaSample ** ppSample, REFERENCE_TIME * tStart, REFERENCE_TIME * tStop, DWORD dwFlags); -HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin * This, IMediaSample * pSample); -HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin * This); -HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin * This); -HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocator **pMemAlloc); -HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); -HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BaseOutputPin *pin, IPin *peer, const AM_MEDIA_TYPE *mt); - -void strmbase_source_cleanup(BaseOutputPin *pin); -void strmbase_source_init(BaseOutputPin *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, +HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *pin, + IMediaSample **sample, REFERENCE_TIME *start, REFERENCE_TIME *stop, DWORD flags); +HRESULT WINAPI BaseOutputPinImpl_Deliver(struct strmbase_source *pin, IMediaSample *sample); +HRESULT WINAPI BaseOutputPinImpl_Active(struct strmbase_source *pin); +HRESULT WINAPI BaseOutputPinImpl_Inactive(struct strmbase_source *pin); +HRESULT WINAPI BaseOutputPinImpl_InitAllocator(struct strmbase_source *pin, IMemAllocator **allocator); +HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator); +HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt); + +void strmbase_source_cleanup(struct strmbase_source *pin); +void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, const WCHAR *name, const BaseOutputPinFuncTable *func_table);
/* Base Input Pin */ @@ -204,7 +205,7 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enu typedef struct TransformFilter { struct strmbase_filter filter; - BaseOutputPin source; + struct strmbase_source source; BaseInputPin sink;
AM_MEDIA_TYPE pmt; @@ -328,7 +329,7 @@ HRESULT WINAPI AMovieSetupRegisterFilter2(const AMOVIESETUP_FILTER *pFilter, IFi typedef struct tagOutputQueue { CRITICAL_SECTION csQueue;
- BaseOutputPin * pInputPin; + struct strmbase_source *pInputPin;
HANDLE hThread; HANDLE hProcessQueue; @@ -350,7 +351,7 @@ typedef struct OutputQueueFuncTable OutputQueue_ThreadProc pfnThreadProc; } OutputQueueFuncTable;
-HRESULT WINAPI OutputQueue_Construct( BaseOutputPin *pInputPin, BOOL bAuto, +HRESULT WINAPI OutputQueue_Construct( struct strmbase_source *pin, BOOL bAuto, BOOL bQueue, LONG lBatchSize, BOOL bBatchExact, DWORD dwPriority, const OutputQueueFuncTable* pFuncsTable, OutputQueue **ppOutputQueue ); HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 5 +++-- dlls/qcap/avimux.c | 5 +++-- dlls/qcap/smartteefilter.c | 10 ++++++---- dlls/qcap/vfwcapture.c | 5 +++-- dlls/quartz/filesource.c | 7 ++++--- dlls/quartz/parser.c | 5 +++-- dlls/strmbase/pin.c | 2 +- dlls/strmbase/transform.c | 5 +++-- dlls/winegstreamer/gstdemux.c | 5 +++-- dlls/wineqtdecoder/qtsplitter.c | 5 +++-- include/wine/strmbase.h | 9 +++++---- 11 files changed, 37 insertions(+), 26 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index c052bda5995..e7804c06a36 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -579,7 +579,8 @@ static HRESULT WINAPI AVICompressorOut_DecideAllocator(struct strmbase_source *b return BaseOutputPinImpl_DecideAllocator(base, pPin, pAlloc); }
-static const BaseOutputPinFuncTable AVICompressorBaseOutputPinVtbl = { +static const struct strmbase_source_ops source_ops = +{ { NULL, AVICompressorOut_GetMediaType @@ -608,7 +609,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr) strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl, &compressor->filter, sink_name, &AVICompressorBaseInputPinVtbl, NULL); strmbase_source_init(&compressor->source, &AVICompressorOutputPinVtbl, - &compressor->filter, source_name, &AVICompressorBaseOutputPinVtbl); + &compressor->filter, source_name, &source_ops);
*phr = S_OK; return &compressor->filter.IUnknown_inner; diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index fbc74ae4880..304b34f5f9f 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1221,7 +1221,8 @@ static HRESULT WINAPI AviMuxOut_DecideAllocator(struct strmbase_source *base, return IMemInputPin_NotifyAllocator(pPin, *pAlloc, TRUE); }
-static const BaseOutputPinFuncTable AviMuxOut_BaseOutputFuncTable = { +static const struct strmbase_source_ops source_ops = +{ { AviMuxOut_CheckMediaType, AviMuxOut_GetMediaType @@ -2018,7 +2019,7 @@ IUnknown * WINAPI QCAP_createAVIMux(IUnknown *outer, HRESULT *phr) info.pFilter = &avimux->filter.IBaseFilter_iface; lstrcpyW(info.achName, output_name); strmbase_source_init(&avimux->source, &AviMuxOut_PinVtbl, &avimux->filter, - output_name, &AviMuxOut_BaseOutputFuncTable); + output_name, &source_ops); avimux->IQualityControl_iface.lpVtbl = &AviMuxOut_QualityControlVtbl; avimux->cur_stream = 0; avimux->cur_time = 0; diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index 353409dcfc1..dd819c23be0 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -389,7 +389,8 @@ static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_sour return IMemInputPin_NotifyAllocator(pPin, This->sink.pAllocator, TRUE); }
-static const BaseOutputPinFuncTable SmartTeeFilterCaptureFuncs = { +static const struct strmbase_source_ops capture_ops = +{ { SmartTeeFilterCapture_CheckMediaType, SmartTeeFilterCapture_GetMediaType @@ -461,7 +462,8 @@ static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_sour return IMemInputPin_NotifyAllocator(pPin, This->sink.pAllocator, TRUE); }
-static const BaseOutputPinFuncTable SmartTeeFilterPreviewFuncs = { +static const struct strmbase_source_ops preview_ops = +{ { SmartTeeFilterPreview_CheckMediaType, SmartTeeFilterPreview_GetMediaType @@ -498,9 +500,9 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr) }
strmbase_source_init(&object->capture, &SmartTeeFilterCaptureVtbl, - &object->filter, captureW, &SmartTeeFilterCaptureFuncs); + &object->filter, captureW, &capture_ops); strmbase_source_init(&object->preview, &SmartTeeFilterPreviewVtbl, - &object->filter, previewW, &SmartTeeFilterPreviewFuncs); + &object->filter, previewW, &preview_ops);
*phr = S_OK; return &object->filter.IUnknown_inner; diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index ed8c050828a..17c40505bdb 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -554,7 +554,8 @@ static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface, return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual); }
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { +static const struct strmbase_source_ops source_ops = +{ { VfwPin_CheckMediaType, VfwPin_GetMediaType @@ -651,7 +652,7 @@ IUnknown * WINAPI QCAP_createVFWCaptureFilter(IUnknown *outer, HRESULT *phr) object->init = FALSE;
strmbase_source_init(&object->source, &VfwPin_Vtbl, &object->filter, - source_name, &output_BaseOutputFuncTable); + source_name, &source_ops);
object->IKsPropertySet_iface.lpVtbl = &IKsPropertySet_VTable;
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 006c6592b56..cbd54b60ccb 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -79,7 +79,7 @@ typedef struct AsyncReader } AsyncReader;
static const IPinVtbl FileAsyncReaderPin_Vtbl; -static const BaseOutputPinFuncTable output_BaseOutputFuncTable; +static const struct strmbase_source_ops source_ops;
static inline AsyncReader *impl_from_strmbase_filter(struct strmbase_filter *iface) { @@ -489,7 +489,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi }
strmbase_source_init(&This->source, &FileAsyncReaderPin_Vtbl, &This->filter, - wszOutputPinName, &output_BaseOutputFuncTable); + wszOutputPinName, &source_ops); BaseFilterImpl_IncrementPinVersion(&This->filter);
This->file = hFile; @@ -702,7 +702,8 @@ static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(struct strmbase_source return IMemAllocator_SetProperties(pAlloc, &This->allocProps, &actual); }
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { +static const struct strmbase_source_ops source_ops = +{ { FileAsyncReaderPin_CheckMediaType, FileAsyncReaderPin_GetMediaType diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 2768d013573..e4e6036aff7 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -334,7 +334,8 @@ HRESULT WINAPI Parser_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock return S_OK; }
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { +static const struct strmbase_source_ops source_ops = +{ { Parser_OutputPin_CheckMediaType, Parser_OutputPin_GetMediaType @@ -360,7 +361,7 @@ HRESULT Parser_AddPin(ParserImpl *filter, const WCHAR *name, filter->sources[filter->cStreams] = object;
strmbase_source_init(&object->pin, &Parser_OutputPin_Vtbl, &filter->filter, - name, &output_BaseOutputFuncTable); + name, &source_ops);
object->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)); CopyMediaType(object->pmt, mt); diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index cbf4db9fd05..2fb9cf012f2 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -708,7 +708,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This, }
void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, - const WCHAR *name, const BaseOutputPinFuncTable *func_table) + const WCHAR *name, const struct strmbase_source_ops *func_table) { memset(pin, 0, sizeof(*pin)); pin->pin.IPin_iface.lpVtbl = vtbl; diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index fe4260edcaf..c5310cdab95 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -171,7 +171,8 @@ static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = { TransformFilter_Input_Receive };
-static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable = { +static const struct strmbase_source_ops source_ops = +{ { TransformFilter_Output_CheckMediaType, TransformFilter_Output_GetMediaType @@ -290,7 +291,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid, wcsInputPinName, &tf_input_BaseInputFuncTable, NULL);
strmbase_source_init(&filter->source, &TransformFilter_OutputPin_Vtbl, &filter->filter, - wcsOutputPinName, &tf_output_BaseOutputFuncTable); + wcsOutputPinName, &source_ops);
QualityControlImpl_Create(&filter->sink.pin.IPin_iface, &filter->filter.IBaseFilter_iface, &filter->qcimpl); diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 1b02373e11d..c0ff9e53b49 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1745,7 +1745,8 @@ static const IPinVtbl GST_OutputPin_Vtbl = { BasePinImpl_NewSegment };
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { +static const struct strmbase_source_ops source_ops = +{ { GSTOutPin_CheckMediaType, GSTOutPin_GetMediaType @@ -1767,7 +1768,7 @@ static BOOL create_pin(GSTImpl *filter, const WCHAR *name, const AM_MEDIA_TYPE * return FALSE;
strmbase_source_init(&pin->pin, &GST_OutputPin_Vtbl, &filter->filter, name, - &output_BaseOutputFuncTable); + &source_ops); pin->pmt = heap_alloc(sizeof(AM_MEDIA_TYPE)); CopyMediaType(pin->pmt, mt); pin->caps_event = CreateEventW(NULL, FALSE, FALSE, NULL); diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 7333e705b76..599407d4ca4 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -1408,7 +1408,8 @@ static const IQualityControlVtbl QTOutPin_QualityControl_Vtbl = { QT_QualityControl_SetSink };
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { +static const struct strmbase_source_ops source_ops = +{ { QTOutPin_CheckMediaType, QTOutPin_GetMediaType @@ -1436,7 +1437,7 @@ static HRESULT QT_AddPin(QTSplitter *filter, const WCHAR *name, filter->pAudio_Pin = pin;
strmbase_source_init(&pin->pin, &QT_OutputPin_Vtbl, &filter->filter, name, - &output_BaseOutputFuncTable); + &source_ops); pin->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)); CopyMediaType(pin->pmt, mt); pin->IQualityControl_iface.lpVtbl = &QTOutPin_QualityControl_Vtbl; diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index e5bed6c547b..85801ebabcc 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -60,14 +60,15 @@ struct strmbase_source IMemInputPin * pMemInputPin; IMemAllocator * pAllocator;
- const struct BaseOutputPinFuncTable* pFuncsTable; + const struct strmbase_source_ops *pFuncsTable; };
typedef HRESULT (WINAPI *BaseOutputPin_AttemptConnection)(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt); typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(struct strmbase_source *pin, IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props); typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator);
-typedef struct BaseOutputPinFuncTable { +struct strmbase_source_ops +{ BasePinFuncTable base;
/* Required for Connect(). */ @@ -76,7 +77,7 @@ typedef struct BaseOutputPinFuncTable { BaseOutputPin_DecideBufferSize pfnDecideBufferSize; /* Required for BaseOutputPinImpl_AttemptConnection */ BaseOutputPin_DecideAllocator pfnDecideAllocator; -} BaseOutputPinFuncTable; +};
typedef struct BaseInputPin { @@ -135,7 +136,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin,
void strmbase_source_cleanup(struct strmbase_source *pin); void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, - const WCHAR *name, const BaseOutputPinFuncTable *func_table); + const WCHAR *name, const struct strmbase_source_ops *func_table);
/* Base Input Pin */ HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 37 +++++++++++++++-------------------- 1 file changed, 16 insertions(+), 21 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index c0ff9e53b49..828d67fc3a8 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1211,6 +1211,19 @@ static const struct strmbase_filter_ops filter_ops = .filter_destroy = gstdemux_destroy, };
+static HRESULT WINAPI sink_CheckMediaType(BasePin *iface, const AM_MEDIA_TYPE *mt) +{ + if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Stream)) + return S_OK; + return S_FALSE; +} + +static const BasePinFuncTable sink_ops = +{ + .pfnCheckMediaType = sink_CheckMediaType, + .pfnGetMediaType = BasePinImpl_GetMediaType, +}; + IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr) { GSTImpl *object; @@ -1236,6 +1249,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr) object->sink.filter = &object->filter; lstrcpynW(object->sink.name, wcsInputPinName, ARRAY_SIZE(object->sink.name)); object->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl; + object->sink.pFuncsTable = &sink_ops; *phr = S_OK;
TRACE("Created GStreamer demuxer %p.\n", object); @@ -1916,16 +1930,6 @@ static HRESULT WINAPI GSTInPin_Disconnect(IPin *iface) return hr; }
-static HRESULT WINAPI GSTInPin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt) -{ - TRACE("iface %p, mt %p.\n", iface, pmt); - dump_AM_MEDIA_TYPE(pmt); - - if (IsEqualIID(&pmt->majortype, &MEDIATYPE_Stream)) - return S_OK; - return S_FALSE; -} - static HRESULT WINAPI GSTInPin_EndOfStream(IPin *iface) { FIXME("iface %p, stub!\n", iface); @@ -1982,15 +1986,6 @@ static HRESULT WINAPI GSTInPin_QueryInterface(IPin * iface, REFIID riid, LPVOID return E_NOINTERFACE; }
-static HRESULT WINAPI GSTInPin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum) -{ - BasePin *This = (BasePin *)iface; - - TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum); - - return EnumMediaTypes_Construct(This, BasePinImpl_GetMediaType, BasePinImpl_GetMediaTypeVersion, ppEnum); -} - static const IPinVtbl GST_InputPin_Vtbl = { GSTInPin_QueryInterface, BasePinImpl_AddRef, @@ -2003,8 +1998,8 @@ static const IPinVtbl GST_InputPin_Vtbl = { BasePinImpl_QueryPinInfo, BasePinImpl_QueryDirection, BasePinImpl_QueryId, - GSTInPin_QueryAccept, - GSTInPin_EnumMediaTypes, + BasePinImpl_QueryAccept, + BasePinImpl_EnumMediaTypes, BasePinImpl_QueryInternalConnections, GSTInPin_EndOfStream, GSTInPin_BeginFlush,
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 77 ++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 38 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 828d67fc3a8..641678b28cc 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -49,7 +49,8 @@ static pthread_key_t wine_gst_key;
typedef struct GSTOutPin GSTOutPin;
-typedef struct GSTImpl { +struct gstdemux +{ struct strmbase_filter filter;
BasePin sink; @@ -69,7 +70,7 @@ typedef struct GSTImpl { HANDLE no_more_pads_event;
HANDLE push_thread; -} GSTImpl; +};
struct GSTOutPin { struct strmbase_source pin; @@ -85,14 +86,14 @@ struct GSTOutPin { SourceSeeking seek; };
-static inline GSTImpl *impl_from_IBaseFilter(IBaseFilter *iface) +static inline struct gstdemux *impl_from_IBaseFilter(IBaseFilter *iface) { - return CONTAINING_RECORD(iface, GSTImpl, filter.IBaseFilter_iface); + return CONTAINING_RECORD(iface, struct gstdemux, filter.IBaseFilter_iface); }
-static inline GSTImpl *impl_from_strmbase_filter(struct strmbase_filter *iface) +static inline struct gstdemux *impl_from_strmbase_filter(struct strmbase_filter *iface) { - return CONTAINING_RECORD(iface, GSTImpl, filter); + return CONTAINING_RECORD(iface, struct gstdemux, filter); }
const char* media_quark_string = "media-sample"; @@ -104,8 +105,8 @@ static const IPinVtbl GST_InputPin_Vtbl; static const IBaseFilterVtbl GST_Vtbl; static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl;
-static BOOL create_pin(GSTImpl *filter, const WCHAR *name, const AM_MEDIA_TYPE *mt); -static HRESULT GST_RemoveOutputPins(GSTImpl *This); +static BOOL create_pin(struct gstdemux *filter, const WCHAR *name, const AM_MEDIA_TYPE *mt); +static HRESULT GST_RemoveOutputPins(struct gstdemux *This); static HRESULT WINAPI GST_ChangeCurrent(IMediaSeeking *iface); static HRESULT WINAPI GST_ChangeStop(IMediaSeeking *iface); static HRESULT WINAPI GST_ChangeRate(IMediaSeeking *iface); @@ -284,7 +285,7 @@ static gboolean accept_caps_sink(GstPad *pad, GstCaps *caps) static gboolean setcaps_sink(GstPad *pad, GstCaps *caps) { GSTOutPin *pin = gst_pad_get_element_private(pad); - GSTImpl *This = impl_from_strmbase_filter(pin->pin.pin.filter); + struct gstdemux *This = impl_from_strmbase_filter(pin->pin.pin.filter); AM_MEDIA_TYPE amt; GstStructure *arg; const char *typename; @@ -330,7 +331,7 @@ static gboolean query_sink(GstPad *pad, GstObject *parent, GstQuery *query) } }
-static gboolean gst_base_src_perform_seek(GSTImpl *This, GstEvent *event) +static gboolean gst_base_src_perform_seek(struct gstdemux *This, GstEvent *event) { gboolean res = TRUE; gdouble rate; @@ -385,7 +386,7 @@ static gboolean gst_base_src_perform_seek(GSTImpl *This, GstEvent *event)
static gboolean event_src(GstPad *pad, GstObject *parent, GstEvent *event) { - GSTImpl *This = gst_pad_get_element_private(pad); + struct gstdemux *This = gst_pad_get_element_private(pad);
TRACE("%p %p\n", pad, event);
@@ -495,7 +496,7 @@ static void release_sample(void *data) static DWORD CALLBACK push_data(LPVOID iface) { LONGLONG maxlen, curlen; - GSTImpl *This = iface; + struct gstdemux *This = iface; IMediaSample *buf; DWORD_PTR user; HRESULT hr; @@ -585,7 +586,7 @@ static DWORD CALLBACK push_data(LPVOID iface) static GstFlowReturn got_data_sink(GstPad *pad, GstObject *parent, GstBuffer *buf) { GSTOutPin *pin = gst_pad_get_element_private(pad); - GSTImpl *This = impl_from_strmbase_filter(pin->pin.pin.filter); + struct gstdemux *This = impl_from_strmbase_filter(pin->pin.pin.filter); HRESULT hr; BYTE *ptr = NULL; IMediaSample *sample; @@ -674,7 +675,7 @@ static GstFlowReturn got_data_sink(GstPad *pad, GstObject *parent, GstBuffer *bu
static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) { - GSTImpl *This = gst_pad_get_element_private(pad); + struct gstdemux *This = gst_pad_get_element_private(pad); HRESULT hr; GstMapInfo info;
@@ -706,7 +707,7 @@ static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64
static DWORD CALLBACK push_data_init(LPVOID iface) { - GSTImpl *This = iface; + struct gstdemux *This = iface; DWORD64 ofs = 0;
TRACE("Starting..\n"); @@ -730,7 +731,7 @@ static DWORD CALLBACK push_data_init(LPVOID iface)
static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user) { - GSTImpl *This = (GSTImpl*)user; + struct gstdemux *This = user; int x; GSTOutPin *pin;
@@ -758,7 +759,7 @@ out: LeaveCriticalSection(&This->filter.csFilter); }
-static void init_new_decoded_pad(GstElement *bin, GstPad *pad, GSTImpl *This) +static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *This) { const char *typename; char *name; @@ -894,7 +895,7 @@ exit:
static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user) { - GSTImpl *This = (GSTImpl*)user; + struct gstdemux *This = user; int x, ret;
TRACE("%p %p %p\n", This, bin, pad); @@ -934,7 +935,7 @@ static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user)
static gboolean query_function(GstPad *pad, GstObject *parent, GstQuery *query) { - GSTImpl *This = gst_pad_get_element_private(pad); + struct gstdemux *This = gst_pad_get_element_private(pad); GstFormat format; int ret; LONGLONG duration; @@ -971,7 +972,7 @@ static gboolean query_function(GstPad *pad, GstObject *parent, GstQuery *query)
static gboolean activate_push(GstPad *pad, gboolean activate) { - GSTImpl *This = gst_pad_get_element_private(pad); + struct gstdemux *This = gst_pad_get_element_private(pad);
TRACE("%p %p %u\n", This, pad, activate);
@@ -1016,7 +1017,7 @@ static gboolean activate_mode(GstPad *pad, GstObject *parent, GstPadMode mode, g
static void no_more_pads(GstElement *decodebin, gpointer user) { - GSTImpl *This = (GSTImpl*)user; + struct gstdemux *This = user; TRACE("%p %p\n", This, decodebin); SetEvent(This->no_more_pads_event); } @@ -1039,7 +1040,7 @@ static GstAutoplugSelectResult autoplug_blacklist(GstElement *bin, GstPad *pad,
static GstBusSyncReply watch_bus(GstBus *bus, GstMessage *msg, gpointer data) { - GSTImpl *This = data; + struct gstdemux *This = data; GError *err = NULL; gchar *dbg_info = NULL;
@@ -1067,7 +1068,7 @@ static void unknown_type(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer u g_free(strcaps); }
-static HRESULT GST_Connect(GSTImpl *This, IPin *pConnectPin, ALLOCATOR_PROPERTIES *props) +static HRESULT GST_Connect(struct gstdemux *This, IPin *pConnectPin, ALLOCATOR_PROPERTIES *props) { int ret, i; LONGLONG avail, duration; @@ -1162,7 +1163,7 @@ static inline GSTOutPin *impl_from_IMediaSeeking( IMediaSeeking *iface )
static IPin *gstdemux_get_pin(struct strmbase_filter *base, unsigned int index) { - GSTImpl *filter = impl_from_strmbase_filter(base); + struct gstdemux *filter = impl_from_strmbase_filter(base);
if (!index) return &filter->sink.IPin_iface; @@ -1173,7 +1174,7 @@ static IPin *gstdemux_get_pin(struct strmbase_filter *base, unsigned int index)
static void gstdemux_destroy(struct strmbase_filter *iface) { - GSTImpl *filter = impl_from_strmbase_filter(iface); + struct gstdemux *filter = impl_from_strmbase_filter(iface); HRESULT hr;
CloseHandle(filter->no_more_pads_event); @@ -1226,7 +1227,7 @@ static const BasePinFuncTable sink_ops =
IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr) { - GSTImpl *object; + struct gstdemux *object;
if (!init_gstreamer()) { @@ -1258,7 +1259,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
static HRESULT WINAPI GST_Stop(IBaseFilter *iface) { - GSTImpl *This = impl_from_IBaseFilter(iface); + struct gstdemux *This = impl_from_IBaseFilter(iface);
TRACE("(%p)\n", This);
@@ -1275,7 +1276,7 @@ static HRESULT WINAPI GST_Stop(IBaseFilter *iface)
static HRESULT WINAPI GST_Pause(IBaseFilter *iface) { - GSTImpl *This = impl_from_IBaseFilter(iface); + struct gstdemux *This = impl_from_IBaseFilter(iface); HRESULT hr = S_OK; GstState now; GstStateChangeReturn ret; @@ -1302,7 +1303,7 @@ static HRESULT WINAPI GST_Pause(IBaseFilter *iface)
static HRESULT WINAPI GST_Run(IBaseFilter *iface, REFERENCE_TIME tStart) { - GSTImpl *This = impl_from_IBaseFilter(iface); + struct gstdemux *This = impl_from_IBaseFilter(iface); HRESULT hr = S_OK; ULONG i; GstState now; @@ -1348,7 +1349,7 @@ static HRESULT WINAPI GST_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
static HRESULT WINAPI GST_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState) { - GSTImpl *This = impl_from_IBaseFilter(iface); + struct gstdemux *This = impl_from_IBaseFilter(iface); HRESULT hr = S_OK; GstState now, pending; GstStateChangeReturn ret; @@ -1684,7 +1685,7 @@ static HRESULT WINAPI GSTOutPin_DecideAllocator(struct strmbase_source *base, IMemInputPin *pPin, IMemAllocator **pAlloc) { GSTOutPin *pin = impl_source_from_IPin(&base->pin.IPin_iface); - GSTImpl *filter = impl_from_strmbase_filter(pin->pin.pin.filter); + struct gstdemux *filter = impl_from_strmbase_filter(pin->pin.pin.filter); HRESULT hr;
TRACE("pin %p, peer %p, allocator %p.\n", pin, pPin, pAlloc); @@ -1770,7 +1771,7 @@ static const struct strmbase_source_ops source_ops = GSTOutPin_DecideAllocator, };
-static BOOL create_pin(GSTImpl *filter, const WCHAR *name, const AM_MEDIA_TYPE *mt) +static BOOL create_pin(struct gstdemux *filter, const WCHAR *name, const AM_MEDIA_TYPE *mt) { GSTOutPin *pin, **new_array;
@@ -1796,7 +1797,7 @@ static BOOL create_pin(GSTImpl *filter, const WCHAR *name, const AM_MEDIA_TYPE * return TRUE; }
-static HRESULT GST_RemoveOutputPins(GSTImpl *This) +static HRESULT GST_RemoveOutputPins(struct gstdemux *This) { ULONG i;
@@ -1824,14 +1825,14 @@ static HRESULT GST_RemoveOutputPins(GSTImpl *This) return S_OK; }
-static inline GSTImpl *impl_from_sink_IPin(IPin *iface) +static inline struct gstdemux *impl_from_sink_IPin(IPin *iface) { - return CONTAINING_RECORD(iface, GSTImpl, sink.IPin_iface); + return CONTAINING_RECORD(iface, struct gstdemux, sink.IPin_iface); }
static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) { - GSTImpl *filter = impl_from_sink_IPin(iface); + struct gstdemux *filter = impl_from_sink_IPin(iface); PIN_DIRECTION pindirReceive; HRESULT hr = S_OK;
@@ -1904,7 +1905,7 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
static HRESULT WINAPI GSTInPin_Disconnect(IPin *iface) { - GSTImpl *filter = impl_from_sink_IPin(iface); + struct gstdemux *filter = impl_from_sink_IPin(iface); HRESULT hr; FILTER_STATE state;
@@ -1960,7 +1961,7 @@ static HRESULT WINAPI GSTInPin_NewSegment(IPin *iface, REFERENCE_TIME start,
static HRESULT WINAPI GSTInPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) { - GSTImpl *filter = impl_from_sink_IPin(iface); + struct gstdemux *filter = impl_from_sink_IPin(iface);
TRACE("filter %p, riid %s, ppv %p.\n", filter, debugstr_guid(riid), ppv);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 69 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 35 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 641678b28cc..e15072f6aa4 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -47,8 +47,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(gstreamer);
static pthread_key_t wine_gst_key;
-typedef struct GSTOutPin GSTOutPin; - struct gstdemux { struct strmbase_filter filter; @@ -56,7 +54,7 @@ struct gstdemux BasePin sink; IAsyncReader *reader; IMemAllocator *alloc; - GSTOutPin **ppPins; + struct gstdemux_source **ppPins; LONG cStreams;
LONGLONG filesize; @@ -72,7 +70,8 @@ struct gstdemux HANDLE push_thread; };
-struct GSTOutPin { +struct gstdemux_source +{ struct strmbase_source pin; IQualityControl IQualityControl_iface;
@@ -284,7 +283,7 @@ static gboolean accept_caps_sink(GstPad *pad, GstCaps *caps)
static gboolean setcaps_sink(GstPad *pad, GstCaps *caps) { - GSTOutPin *pin = gst_pad_get_element_private(pad); + struct gstdemux_source *pin = gst_pad_get_element_private(pad); struct gstdemux *This = impl_from_strmbase_filter(pin->pin.pin.filter); AM_MEDIA_TYPE amt; GstStructure *arg; @@ -417,7 +416,7 @@ static gboolean event_src(GstPad *pad, GstObject *parent, GstEvent *event)
static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) { - GSTOutPin *pin = gst_pad_get_element_private(pad); + struct gstdemux_source *pin = gst_pad_get_element_private(pad);
TRACE("%p %p\n", pad, event);
@@ -585,7 +584,7 @@ static DWORD CALLBACK push_data(LPVOID iface)
static GstFlowReturn got_data_sink(GstPad *pad, GstObject *parent, GstBuffer *buf) { - GSTOutPin *pin = gst_pad_get_element_private(pad); + struct gstdemux_source *pin = gst_pad_get_element_private(pad); struct gstdemux *This = impl_from_strmbase_filter(pin->pin.pin.filter); HRESULT hr; BYTE *ptr = NULL; @@ -733,7 +732,7 @@ static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user) { struct gstdemux *This = user; int x; - GSTOutPin *pin; + struct gstdemux_source *pin;
TRACE("%p %p %p\n", This, bin, pad);
@@ -767,7 +766,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux * GstCaps *caps; GstStructure *arg; GstPad *mypad; - GSTOutPin *pin; + struct gstdemux_source *pin; int ret; gchar my_name[1024]; WCHAR nameW[128]; @@ -911,7 +910,7 @@ static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user)
EnterCriticalSection(&This->filter.csFilter); for (x = 0; x < This->cStreams; ++x) { - GSTOutPin *pin = This->ppPins[x]; + struct gstdemux_source *pin = This->ppPins[x]; if (!pin->their_src) { gst_segment_init(pin->segment, GST_FORMAT_TIME);
@@ -1156,9 +1155,9 @@ static HRESULT GST_Connect(struct gstdemux *This, IPin *pConnectPin, ALLOCATOR_P return S_OK; }
-static inline GSTOutPin *impl_from_IMediaSeeking( IMediaSeeking *iface ) +static inline struct gstdemux_source *impl_from_IMediaSeeking(IMediaSeeking *iface) { - return CONTAINING_RECORD(iface, GSTOutPin, seek.IMediaSeeking_iface); + return CONTAINING_RECORD(iface, struct gstdemux_source, seek.IMediaSeeking_iface); }
static IPin *gstdemux_get_pin(struct strmbase_filter *base, unsigned int index) @@ -1397,21 +1396,21 @@ static const IBaseFilterVtbl GST_Vtbl = {
static HRESULT WINAPI GST_ChangeCurrent(IMediaSeeking *iface) { - GSTOutPin *This = impl_from_IMediaSeeking(iface); + struct gstdemux_source *This = impl_from_IMediaSeeking(iface); TRACE("(%p)\n", This); return S_OK; }
static HRESULT WINAPI GST_ChangeStop(IMediaSeeking *iface) { - GSTOutPin *This = impl_from_IMediaSeeking(iface); + struct gstdemux_source *This = impl_from_IMediaSeeking(iface); TRACE("(%p)\n", This); return S_OK; }
static HRESULT WINAPI GST_ChangeRate(IMediaSeeking *iface) { - GSTOutPin *This = impl_from_IMediaSeeking(iface); + struct gstdemux_source *This = impl_from_IMediaSeeking(iface); GstEvent *ev = gst_event_new_seek(This->seek.dRate, GST_FORMAT_TIME, 0, GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_NONE, -1); TRACE("(%p) New rate %g\n", This, This->seek.dRate); mark_wine_thread(); @@ -1421,25 +1420,25 @@ static HRESULT WINAPI GST_ChangeRate(IMediaSeeking *iface)
static HRESULT WINAPI GST_Seeking_QueryInterface(IMediaSeeking *iface, REFIID riid, void **ppv) { - GSTOutPin *This = impl_from_IMediaSeeking(iface); + struct gstdemux_source *This = impl_from_IMediaSeeking(iface); return IPin_QueryInterface(&This->pin.pin.IPin_iface, riid, ppv); }
static ULONG WINAPI GST_Seeking_AddRef(IMediaSeeking *iface) { - GSTOutPin *This = impl_from_IMediaSeeking(iface); + struct gstdemux_source *This = impl_from_IMediaSeeking(iface); return IPin_AddRef(&This->pin.pin.IPin_iface); }
static ULONG WINAPI GST_Seeking_Release(IMediaSeeking *iface) { - GSTOutPin *This = impl_from_IMediaSeeking(iface); + struct gstdemux_source *This = impl_from_IMediaSeeking(iface); return IPin_Release(&This->pin.pin.IPin_iface); }
static HRESULT WINAPI GST_Seeking_GetCurrentPosition(IMediaSeeking *iface, REFERENCE_TIME *pos) { - GSTOutPin *This = impl_from_IMediaSeeking(iface); + struct gstdemux_source *This = impl_from_IMediaSeeking(iface);
TRACE("(%p)->(%p)\n", This, pos);
@@ -1485,7 +1484,7 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, DWORD stopflags) { HRESULT hr; - GSTOutPin *This = impl_from_IMediaSeeking(iface); + struct gstdemux_source *This = impl_from_IMediaSeeking(iface); GstSeekFlags f = 0; GstSeekType curtype, stoptype; GstEvent *e; @@ -1552,32 +1551,32 @@ static const IMediaSeekingVtbl GST_Seeking_Vtbl = SourceSeekingImpl_GetPreroll };
-static inline GSTOutPin *impl_from_IQualityControl( IQualityControl *iface ) +static inline struct gstdemux_source *impl_from_IQualityControl( IQualityControl *iface ) { - return CONTAINING_RECORD(iface, GSTOutPin, IQualityControl_iface); + return CONTAINING_RECORD(iface, struct gstdemux_source, IQualityControl_iface); }
static HRESULT WINAPI GST_QualityControl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv) { - GSTOutPin *pin = impl_from_IQualityControl(iface); + struct gstdemux_source *pin = impl_from_IQualityControl(iface); return IPin_QueryInterface(&pin->pin.pin.IPin_iface, riid, ppv); }
static ULONG WINAPI GST_QualityControl_AddRef(IQualityControl *iface) { - GSTOutPin *pin = impl_from_IQualityControl(iface); + struct gstdemux_source *pin = impl_from_IQualityControl(iface); return IPin_AddRef(&pin->pin.pin.IPin_iface); }
static ULONG WINAPI GST_QualityControl_Release(IQualityControl *iface) { - GSTOutPin *pin = impl_from_IQualityControl(iface); + struct gstdemux_source *pin = impl_from_IQualityControl(iface); return IPin_Release(&pin->pin.pin.IPin_iface); }
static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) { - GSTOutPin *pin = impl_from_IQualityControl(iface); + struct gstdemux_source *pin = impl_from_IQualityControl(iface); GstEvent *evt;
TRACE("(%p)->(%p, { 0x%x %u %s %s })\n", pin, sender, @@ -1605,7 +1604,7 @@ static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFil
static HRESULT WINAPI GST_QualityControl_SetSink(IQualityControl *iface, IQualityControl *tonotify) { - GSTOutPin *pin = impl_from_IQualityControl(iface); + struct gstdemux_source *pin = impl_from_IQualityControl(iface); TRACE("(%p)->(%p)\n", pin, pin); /* Do nothing */ return S_OK; @@ -1619,14 +1618,14 @@ static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl = { GST_QualityControl_SetSink };
-static inline GSTOutPin *impl_source_from_IPin(IPin *iface) +static inline struct gstdemux_source *impl_source_from_IPin(IPin *iface) { - return CONTAINING_RECORD(iface, GSTOutPin, pin.pin.IPin_iface); + return CONTAINING_RECORD(iface, struct gstdemux_source, pin.pin.IPin_iface); }
static HRESULT WINAPI GSTOutPin_QueryInterface(IPin *iface, REFIID riid, void **ppv) { - GSTOutPin *This = impl_source_from_IPin(iface); + struct gstdemux_source *This = impl_source_from_IPin(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
@@ -1657,7 +1656,7 @@ static HRESULT WINAPI GSTOutPin_CheckMediaType(BasePin *base, const AM_MEDIA_TYP
static HRESULT WINAPI GSTOutPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_TYPE *pmt) { - GSTOutPin *This = impl_source_from_IPin(&iface->IPin_iface); + struct gstdemux_source *This = impl_source_from_IPin(&iface->IPin_iface);
TRACE("(%p)->(%i, %p)\n", This, iPosition, pmt);
@@ -1675,7 +1674,7 @@ static HRESULT WINAPI GSTOutPin_GetMediaType(BasePin *iface, int iPosition, AM_M static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { - GSTOutPin *This = impl_source_from_IPin(&iface->pin.IPin_iface); + struct gstdemux_source *This = impl_source_from_IPin(&iface->pin.IPin_iface); TRACE("(%p)->(%p, %p)\n", This, pAlloc, ppropInputRequest); /* Unused */ return S_OK; @@ -1684,7 +1683,7 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface, static HRESULT WINAPI GSTOutPin_DecideAllocator(struct strmbase_source *base, IMemInputPin *pPin, IMemAllocator **pAlloc) { - GSTOutPin *pin = impl_source_from_IPin(&base->pin.IPin_iface); + struct gstdemux_source *pin = impl_source_from_IPin(&base->pin.IPin_iface); struct gstdemux *filter = impl_from_strmbase_filter(pin->pin.pin.filter); HRESULT hr;
@@ -1706,7 +1705,7 @@ static HRESULT WINAPI GSTOutPin_DecideAllocator(struct strmbase_source *base, return hr; }
-static void free_source_pin(GSTOutPin *pin) +static void free_source_pin(struct gstdemux_source *pin) { if (pin->pin.pin.pConnectedTo) { @@ -1773,7 +1772,7 @@ static const struct strmbase_source_ops source_ops =
static BOOL create_pin(struct gstdemux *filter, const WCHAR *name, const AM_MEDIA_TYPE *mt) { - GSTOutPin *pin, **new_array; + struct gstdemux_source *pin, **new_array;
if (!(new_array = heap_realloc(filter->ppPins, (filter->cStreams + 1) * sizeof(*new_array)))) return FALSE;